提交 988b6dce 编写于 作者: F Fred Isaman 提交者: Trond Myklebust

NFSv4.1: remove GETATTR from ds commits

Any COMMIT compound directed to a data server needs to have the
GETATTR calls suppressed.  We here, make sure the field we are testing
(data->lseg) is set and refcounted correctly.
Signed-off-by: NFred Isaman <iisaman@netapp.com>
Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
上级 a861a1e1
...@@ -3218,6 +3218,10 @@ static void nfs4_proc_commit_setup(struct nfs_write_data *data, struct rpc_messa ...@@ -3218,6 +3218,10 @@ static void nfs4_proc_commit_setup(struct nfs_write_data *data, struct rpc_messa
{ {
struct nfs_server *server = NFS_SERVER(data->inode); struct nfs_server *server = NFS_SERVER(data->inode);
if (data->lseg) {
data->args.bitmask = NULL;
data->res.fattr = NULL;
} else
data->args.bitmask = server->cache_consistency_bitmask; data->args.bitmask = server->cache_consistency_bitmask;
if (!data->write_done_cb) if (!data->write_done_cb)
data->write_done_cb = nfs4_commit_done_cb; data->write_done_cb = nfs4_commit_done_cb;
......
...@@ -2294,6 +2294,7 @@ static void nfs4_xdr_enc_commit(struct rpc_rqst *req, struct xdr_stream *xdr, ...@@ -2294,6 +2294,7 @@ static void nfs4_xdr_enc_commit(struct rpc_rqst *req, struct xdr_stream *xdr,
encode_sequence(xdr, &args->seq_args, &hdr); encode_sequence(xdr, &args->seq_args, &hdr);
encode_putfh(xdr, args->fh, &hdr); encode_putfh(xdr, args->fh, &hdr);
encode_commit(xdr, args, &hdr); encode_commit(xdr, args, &hdr);
if (args->bitmask)
encode_getfattr(xdr, args->bitmask, &hdr); encode_getfattr(xdr, args->bitmask, &hdr);
encode_nops(&hdr); encode_nops(&hdr);
} }
...@@ -5723,6 +5724,7 @@ static int nfs4_xdr_dec_commit(struct rpc_rqst *rqstp, struct xdr_stream *xdr, ...@@ -5723,6 +5724,7 @@ static int nfs4_xdr_dec_commit(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
status = decode_commit(xdr, res); status = decode_commit(xdr, res);
if (status) if (status)
goto out; goto out;
if (res->fattr)
decode_getfattr(xdr, res->fattr, res->server, decode_getfattr(xdr, res->fattr, res->server,
!RPC_IS_ASYNC(rqstp->rq_task)); !RPC_IS_ASYNC(rqstp->rq_task));
out: out:
......
...@@ -1295,6 +1295,7 @@ static void nfs_commitdata_release(void *data) ...@@ -1295,6 +1295,7 @@ static void nfs_commitdata_release(void *data)
{ {
struct nfs_write_data *wdata = data; struct nfs_write_data *wdata = data;
put_lseg(wdata->lseg);
put_nfs_open_context(wdata->args.context); put_nfs_open_context(wdata->args.context);
nfs_commit_free(wdata); nfs_commit_free(wdata);
} }
...@@ -1338,7 +1339,8 @@ static int nfs_initiate_commit(struct nfs_write_data *data, struct rpc_clnt *cln ...@@ -1338,7 +1339,8 @@ static int nfs_initiate_commit(struct nfs_write_data *data, struct rpc_clnt *cln
* Set up the argument/result storage required for the RPC call. * Set up the argument/result storage required for the RPC call.
*/ */
static void nfs_init_commit(struct nfs_write_data *data, static void nfs_init_commit(struct nfs_write_data *data,
struct list_head *head) struct list_head *head,
struct pnfs_layout_segment *lseg)
{ {
struct nfs_page *first = nfs_list_entry(head->next); struct nfs_page *first = nfs_list_entry(head->next);
struct inode *inode = first->wb_context->path.dentry->d_inode; struct inode *inode = first->wb_context->path.dentry->d_inode;
...@@ -1350,6 +1352,7 @@ static void nfs_init_commit(struct nfs_write_data *data, ...@@ -1350,6 +1352,7 @@ static void nfs_init_commit(struct nfs_write_data *data,
data->inode = inode; data->inode = inode;
data->cred = first->wb_context->cred; data->cred = first->wb_context->cred;
data->lseg = lseg; /* reference transferred */
data->mds_ops = &nfs_commit_ops; data->mds_ops = &nfs_commit_ops;
data->args.fh = NFS_FH(data->inode); data->args.fh = NFS_FH(data->inode);
...@@ -1393,7 +1396,7 @@ nfs_commit_list(struct inode *inode, struct list_head *head, int how) ...@@ -1393,7 +1396,7 @@ nfs_commit_list(struct inode *inode, struct list_head *head, int how)
goto out_bad; goto out_bad;
/* Set up the argument struct */ /* Set up the argument struct */
nfs_init_commit(data, head); nfs_init_commit(data, head, NULL);
return nfs_initiate_commit(data, NFS_CLIENT(inode), data->mds_ops, how); return nfs_initiate_commit(data, NFS_CLIENT(inode), data->mds_ops, how);
out_bad: out_bad:
nfs_retry_commit(head, NULL); nfs_retry_commit(head, NULL);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册