Skip to content

Commit

Permalink
Return correct error on query of xattr on file with empty xattrs
Browse files Browse the repository at this point in the history
xfstest 020 detected a problem with cifs xattr handling.  When a file
had an empty xattr list, we returned success (with an empty xattr value)
on query of particular xattrs rather than returning ENODATA.
This patch fixes it so that query of an xattr returns ENODATA when the
xattr list is empty for the file.

Signed-off-by: Steve French <smfrench@gmail.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
  • Loading branch information
Steve French committed Apr 16, 2014
1 parent c11f1df commit 60977fc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fs/cifs/cifssmb.c
Original file line number Diff line number Diff line change
Expand Up @@ -6197,6 +6197,9 @@ CIFSSMBQAllEAs(const unsigned int xid, struct cifs_tcon *tcon,
cifs_dbg(FYI, "ea length %d\n", list_len);
if (list_len <= 8) {
cifs_dbg(FYI, "empty EA list returned from server\n");
/* didn't find the named attribute */
if (ea_name)
rc = -ENODATA;
goto QAllEAsOut;
}

Expand Down

0 comments on commit 60977fc

Please sign in to comment.