getxattr should return -1 for non-existing attributes, but it returns 0 (meaning existing attribute with empty value) instead. How to reproduce: just use getfattr: /mnt is cifs mount, /tmp/local is a local file system hautmedoc$ mount [...] //y/tmp on /mnt type cifs (rw) [...] hautmedoc$ cd /mnt hautmedoc$ getfattr -n user.nosuchattr orange3.pdf # file: orange3.pdf user.nosuchattr hautmedoc$ cd /tmp hautmedoc$ getfattr -n user.nosuchattr orange3.pdf orange3.pdf: user.nosuchattr: No such attribute
cc'ing Steve since he has been doing some xattr work recently. Steve maybe you can fix this while you're in there too?
This bug has been fixed a while ago. $ getfattr -n user.nosuchattr /mnt/foo /mnt/foo: user.nosuchattr: No such attribute