diff options
author | Kinglong Mee <kinglongmee@gmail.com> | 2015-07-30 09:54:26 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2015-08-31 16:16:39 -0400 |
commit | 7d580722c9f353d19e255f929d341caa821060d6 (patch) | |
tree | 363d1488190e1fc2b04f6f76c8c474e3ceabf4b5 /fs/nfsd | |
parent | 6896f15aabde505b35888039af93d1d182a0108a (diff) |
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/nfsd')
-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: | |||
2735 | *p++ = cpu_to_be32(stat.blksize); | 2735 | *p++ = cpu_to_be32(stat.blksize); |
2736 | } | 2736 | } |
2737 | #endif /* CONFIG_NFSD_PNFS */ | 2737 | #endif /* CONFIG_NFSD_PNFS */ |
2738 | if (bmval2 & FATTR4_WORD2_SECURITY_LABEL) { | ||
2739 | status = nfsd4_encode_security_label(xdr, rqstp, context, | ||
2740 | contextlen); | ||
2741 | if (status) | ||
2742 | goto out; | ||
2743 | } | ||
2744 | if (bmval2 & FATTR4_WORD2_SUPPATTR_EXCLCREAT) { | 2738 | if (bmval2 & FATTR4_WORD2_SUPPATTR_EXCLCREAT) { |
2745 | p = xdr_reserve_space(xdr, 16); | 2739 | p = xdr_reserve_space(xdr, 16); |
2746 | if (!p) | 2740 | if (!p) |
@@ -2751,6 +2745,13 @@ out_acl: | |||
2751 | *p++ = cpu_to_be32(NFSD_SUPPATTR_EXCLCREAT_WORD2); | 2745 | *p++ = cpu_to_be32(NFSD_SUPPATTR_EXCLCREAT_WORD2); |
2752 | } | 2746 | } |
2753 | 2747 | ||
2748 | if (bmval2 & FATTR4_WORD2_SECURITY_LABEL) { | ||
2749 | status = nfsd4_encode_security_label(xdr, rqstp, context, | ||
2750 | contextlen); | ||
2751 | if (status) | ||
2752 | goto out; | ||
2753 | } | ||
2754 | |||
2754 | attrlen = htonl(xdr->buf->len - attrlen_offset - 4); | 2755 | attrlen = htonl(xdr->buf->len - attrlen_offset - 4); |
2755 | write_bytes_to_xdr_buf(xdr->buf, attrlen_offset, &attrlen, 4); | 2756 | write_bytes_to_xdr_buf(xdr->buf, attrlen_offset, &attrlen, 4); |
2756 | status = nfs_ok; | 2757 | status = nfs_ok; |