Skip to content

Commit eef7314

Browse files
author
Trond Myklebust
committed
NFSv4.2: Clear FATTR4_WORD2_SECURITY_LABEL when done decoding
We need to clear the FATTR4_WORD2_SECURITY_LABEL bitmap flag irrespective of whether or not the label is too long. Fixes: aa9c266 ("NFS: Client implementation of Labeled-NFS") Signed-off-by: Trond Myklebust <[email protected]>
1 parent 0eb4381 commit eef7314

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/nfs/nfs4xdr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4234,6 +4234,7 @@ static int decode_attr_security_label(struct xdr_stream *xdr, uint32_t *bitmap,
42344234
p = xdr_inline_decode(xdr, len);
42354235
if (unlikely(!p))
42364236
return -EIO;
4237+
bitmap[2] &= ~FATTR4_WORD2_SECURITY_LABEL;
42374238
if (len < NFS4_MAXLABELLEN) {
42384239
if (label) {
42394240
if (label->len) {
@@ -4246,7 +4247,6 @@ static int decode_attr_security_label(struct xdr_stream *xdr, uint32_t *bitmap,
42464247
label->lfs = lfs;
42474248
status = NFS_ATTR_FATTR_V4_SECURITY_LABEL;
42484249
}
4249-
bitmap[2] &= ~FATTR4_WORD2_SECURITY_LABEL;
42504250
} else
42514251
printk(KERN_WARNING "%s: label too long (%u)!\n",
42524252
__func__, len);

0 commit comments

Comments
 (0)