mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-26 08:31:13 +00:00
NFS: Get suppattr_exclcreat when getting server capabilities
Create file with attributs as NFS4_CREATE_EXCLUSIVE4_1 mode depends on suppattr_exclcreat attribut. v3, same as v2. Signed-off-by: Kinglong Mee <kinglongmee@gmail.com> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
This commit is contained in:
parent
5153aacfb8
commit
8c61282ff6
4 changed files with 41 additions and 6 deletions
|
@ -2582,6 +2582,7 @@ static void nfs4_xdr_enc_server_caps(struct rpc_rqst *req,
|
|||
struct xdr_stream *xdr,
|
||||
struct nfs4_server_caps_arg *args)
|
||||
{
|
||||
const u32 *bitmask = args->bitmask;
|
||||
struct compound_hdr hdr = {
|
||||
.minorversion = nfs4_xdr_minorversion(&args->seq_args),
|
||||
};
|
||||
|
@ -2589,11 +2590,7 @@ static void nfs4_xdr_enc_server_caps(struct rpc_rqst *req,
|
|||
encode_compound_hdr(xdr, req, &hdr);
|
||||
encode_sequence(xdr, &args->seq_args, &hdr);
|
||||
encode_putfh(xdr, args->fhandle, &hdr);
|
||||
encode_getattr_one(xdr, FATTR4_WORD0_SUPPORTED_ATTRS|
|
||||
FATTR4_WORD0_FH_EXPIRE_TYPE|
|
||||
FATTR4_WORD0_LINK_SUPPORT|
|
||||
FATTR4_WORD0_SYMLINK_SUPPORT|
|
||||
FATTR4_WORD0_ACLSUPPORT, &hdr);
|
||||
encode_getattr_three(xdr, bitmask[0], bitmask[1], bitmask[2], &hdr);
|
||||
encode_nops(&hdr);
|
||||
}
|
||||
|
||||
|
@ -3370,6 +3367,22 @@ out_overflow:
|
|||
return -EIO;
|
||||
}
|
||||
|
||||
static int decode_attr_exclcreat_supported(struct xdr_stream *xdr,
|
||||
uint32_t *bitmap, uint32_t *bitmask)
|
||||
{
|
||||
if (likely(bitmap[2] & FATTR4_WORD2_SUPPATTR_EXCLCREAT)) {
|
||||
int ret;
|
||||
ret = decode_attr_bitmap(xdr, bitmask);
|
||||
if (unlikely(ret < 0))
|
||||
return ret;
|
||||
bitmap[2] &= ~FATTR4_WORD2_SUPPATTR_EXCLCREAT;
|
||||
} else
|
||||
bitmask[0] = bitmask[1] = bitmask[2] = 0;
|
||||
dprintk("%s: bitmask=%08x:%08x:%08x\n", __func__,
|
||||
bitmask[0], bitmask[1], bitmask[2]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int decode_attr_filehandle(struct xdr_stream *xdr, uint32_t *bitmap, struct nfs_fh *fh)
|
||||
{
|
||||
__be32 *p;
|
||||
|
@ -4323,6 +4336,9 @@ static int decode_server_caps(struct xdr_stream *xdr, struct nfs4_server_caps_re
|
|||
goto xdr_error;
|
||||
if ((status = decode_attr_aclsupport(xdr, bitmap, &res->acl_bitmask)) != 0)
|
||||
goto xdr_error;
|
||||
if ((status = decode_attr_exclcreat_supported(xdr, bitmap,
|
||||
res->exclcreat_bitmask)) != 0)
|
||||
goto xdr_error;
|
||||
status = verify_attr_len(xdr, savep, attrlen);
|
||||
xdr_error:
|
||||
dprintk("%s: xdr returned %d!\n", __func__, -status);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue