Skip to content

Commit 53cb245

Browse files
WOnder93amschuma-ntap
authored andcommitted
NFSv4.2: fix return value of _nfs4_get_security_label()
An xattr 'get' handler is expected to return the length of the value on success, yet _nfs4_get_security_label() (and consequently also nfs4_xattr_get_nfs4_label(), which is used as an xattr handler) returns just 0 on success. Fix this by returning label.len instead, which contains the length of the result. Fixes: aa9c266 ("NFS: Client implementation of Labeled-NFS") Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com> Reviewed-by: James Morris <jamorris@linux.microsoft.com> Reviewed-by: Paul Moore <paul@paul-moore.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
1 parent b6f80a2 commit 53cb245

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/nfs/nfs4proc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5965,7 +5965,7 @@ static int _nfs4_get_security_label(struct inode *inode, void *buf,
59655965
return ret;
59665966
if (!(fattr.valid & NFS_ATTR_FATTR_V4_SECURITY_LABEL))
59675967
return -ENOENT;
5968-
return 0;
5968+
return label.len;
59695969
}
59705970

59715971
static int nfs4_get_security_label(struct inode *inode, void *buf,

0 commit comments

Comments
 (0)