diff options
author | Kinglong Mee <kinglongmee@gmail.com> | 2015-07-30 15:54:26 +0200 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2015-08-31 22:16:39 +0200 |
commit | 7d580722c9f353d19e255f929d341caa821060d6 (patch) | |
tree | 363d1488190e1fc2b04f6f76c8c474e3ceabf4b5 /fs | |
parent | nfsd: Fix an FS_LAYOUT_TYPES/LAYOUT_TYPES encode bug (diff) | |
download | linux-7d580722c9f353d19e255f929d341caa821060d6.tar.xz linux-7d580722c9f353d19e255f929d341caa821060d6.zip |
nfsd: SUPPATTR_EXCLCREAT must be encoded before SECURITY_LABEL.
The encode order should be as the bitmask defined order.
Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfsd/nfs4xdr.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index ea05dfb13249..565b69ca04cd 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c @@ -2735,12 +2735,6 @@ out_acl: *p++ = cpu_to_be32(stat.blksize); } #endif /* CONFIG_NFSD_PNFS */ - if (bmval2 & FATTR4_WORD2_SECURITY_LABEL) { - status = nfsd4_encode_security_label(xdr, rqstp, context, - contextlen); - if (status) - goto out; - } if (bmval2 & FATTR4_WORD2_SUPPATTR_EXCLCREAT) { p = xdr_reserve_space(xdr, 16); if (!p) @@ -2751,6 +2745,13 @@ out_acl: *p++ = cpu_to_be32(NFSD_SUPPATTR_EXCLCREAT_WORD2); } + if (bmval2 & FATTR4_WORD2_SECURITY_LABEL) { + status = nfsd4_encode_security_label(xdr, rqstp, context, + contextlen); + if (status) + goto out; + } + attrlen = htonl(xdr->buf->len - attrlen_offset - 4); write_bytes_to_xdr_buf(xdr->buf, attrlen_offset, &attrlen, 4); status = nfs_ok; |