Cf the discussion here: https://lists.samba.org/archive/samba/2017-August/210145.html
We have a "almost correct" patch for this issue, I'll try to clean it up a bit and post here. Requires code reviews still.
Actually, you can take a peek here: https://github.com/freenas/samba/commit/f0a2dc4acc76bff4cf98639d12ebe3cc857574fa
(In reply to Timur Bakeyev from comment #2) Ok, this one solves origin of the problem, still need to address mapping of NO_MEMORY into NT_STATUS_FILE_SYSTEM_LIMITATION
(In reply to Timur Bakeyev from comment #2) I skimmed your patch and afaict this removes the optimisation in get_ea_value() that avoids an xattr syscall to fetch the xattr size for the common case of small xattrs (less then 256 bytes). There's also a lot of unrelated indentation changes and README.Coding issues. I also wonder whether simply raising the limit in get_ea_value() would do the trick. Something like 64 MB should cover even the largest streams. Maybe also add a parametric option that allows setting the limit to a configurable value (stored in a static variable to avoid expensive config parsing in every call to get_ea_value()).
Created attachment 13757 [details] WIP patch for master WIP patch that increases the max xattr size by adding a parametric option with a 64 MB default.
(In reply to Timur Bakeyev from comment #2) Oh, I noticed another thing in your patch: you call talloc_stackframe() but don't use the returned frame but talloc_tos() instead. There's no need to call talloc_stackframe() in order to be able to use talloc_tos(). It just triggers unneeded expensive talloc allocation. Just allocate of talloc_tos() and explicitly free the allocated object.
it might be the better approach to return NT_STATUS_OBJECT_NAME_COLLISION in case of overlage streams. This is also what a Windows servers return when there is no stream support like on vfat devices. The benefit with this is that windows explorer clients will then show the possiblity to skip writing the meta data only but copy the rest of the file. With NT_STATUS_FILE_SYSTEM_LIMITATION Windows explorer would only allow to skip copying the entire file.