Understanding fstat call in streams_xattr

Varun Mittal vmittal at egnyte.com
Sat Jun 22 04:54:56 UTC 2024

Going through other parts of the code, I can see similar jugglery being
done at other places
Adding +/-1 to the ea lengths.
It seems my VFS backend did not return the expected error if the attribute
was not found.
This was causing streams_xattr_openat not to create that 1-byte attribute,
which fstat was expecting.
Once I changed the error, it worked.

On Fri, Jun 21, 2024 at 2:28 PM Ralph Boehme <slow at samba.org> wrote:

> On 6/21/24 6:32 AM, Varun Mittal via samba-technical wrote:
> > Why is there -1 in the result ?
> > If I simply remove this -1, I was able to get setxattr to work
> that looks like the place where we're stripping off the trailing nul
> byte which in the past was required to have in order to implement
> zero-bytes sized streams with an xattr backend when in the past xattrs
> didn't allow for 0-byte sized xattrs, so we had to store an empty byte.
> -slow
> --
> SerNet Samba Team Lead
> Samba Support, Consulting and Development
> Samba Team Member      https://samba.org/
> SAMBA+ packages       https://samba.plus/

More information about the samba-technical mailing list