Bug 59811

Summary: CIFS getxattr() returns success for non existing extended attributes
Product: File System Reporter: Jean-Francois Dockes (jf)
Component: CIFSAssignee: fs_cifs (fs_cifs)
Status: RESOLVED CODE_FIX    
Severity: normal CC: jlayton, lsahlber, sfrench, smfrench, szg00000
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 3.2.0-48-generic Subsystem:
Regression: No Bisected commit-id:

Description Jean-Francois Dockes 2013-06-17 09:30:46 UTC
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
Comment 1 Jeff Layton 2013-06-17 10:45:21 UTC
cc'ing Steve since he has been doing some xattr work recently. Steve maybe you can fix this while you're in there too?
Comment 2 Ronnie Sahlberg 2019-02-07 03:56:26 UTC
This bug has been fixed a while ago.

$ getfattr -n user.nosuchattr /mnt/foo
/mnt/foo: user.nosuchattr: No such attribute