Skip to content

Commit 45b3e8d

Browse files
committed
Merge: NFSv4.2: another fix for listxattr
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/1341 NFSv4.2: another fix for listxattr JIRA: https://issues.redhat.com/browse/RHEL-100709 Signed-off-by: Olga Kornievskaia <okorniev@redhat.com> Approved-by: Paulo Alcantara <paalcant@redhat.com> Approved-by: Benjamin Coddington <bcodding@redhat.com> Approved-by: Scott Mayhew <smayhew@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Julio Faracco <jfaracco@redhat.com>
2 parents c7e48b1 + 9686ba1 commit 45b3e8d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

fs/nfs/nfs4proc.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10831,7 +10831,7 @@ const struct nfs4_minor_version_ops *nfs_v4_minor_ops[] = {
1083110831

1083210832
static ssize_t nfs4_listxattr(struct dentry *dentry, char *list, size_t size)
1083310833
{
10834-
ssize_t error, error2, error3, error4;
10834+
ssize_t error, error2, error3, error4 = 0;
1083510835
size_t left = size;
1083610836

1083710837
error = generic_listxattr(dentry, list, left);
@@ -10859,9 +10859,11 @@ static ssize_t nfs4_listxattr(struct dentry *dentry, char *list, size_t size)
1085910859
left -= error3;
1086010860
}
1086110861

10862-
error4 = security_inode_listsecurity(d_inode(dentry), list, left);
10863-
if (error4 < 0)
10864-
return error4;
10862+
if (!nfs_server_capable(d_inode(dentry), NFS_CAP_SECURITY_LABEL)) {
10863+
error4 = security_inode_listsecurity(d_inode(dentry), list, left);
10864+
if (error4 < 0)
10865+
return error4;
10866+
}
1086510867

1086610868
error += error2 + error3 + error4;
1086710869
if (size && error > size)

0 commit comments

Comments
 (0)