Skip to content

Commit 4fa7ef6

Browse files
author
Trond Myklebust
committed
NFS/pnfs: Don't use RPC_TASK_CRED_NOREF with pnfs
When we're doing pnfs then the credential being used for the RPC call is not necessarily the same as the one used in the open context, so don't use RPC_TASK_CRED_NOREF. Fixes: 6129650 ("NFSv4: Avoid referencing the cred unnecessarily during NFSv4 I/O") Signed-off-by: Trond Myklebust <[email protected]>
1 parent f304a80 commit 4fa7ef6

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

fs/nfs/pagelist.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ int nfs_initiate_pgio(struct rpc_clnt *clnt, struct nfs_pgio_header *hdr,
752752
.callback_ops = call_ops,
753753
.callback_data = hdr,
754754
.workqueue = nfsiod_workqueue,
755-
.flags = RPC_TASK_ASYNC | RPC_TASK_CRED_NOREF | flags,
755+
.flags = RPC_TASK_ASYNC | flags,
756756
};
757757

758758
hdr->rw_ops->rw_initiate(hdr, &msg, rpc_ops, &task_setup_data, how);
@@ -950,7 +950,8 @@ static int nfs_generic_pg_pgios(struct nfs_pageio_descriptor *desc)
950950
hdr->cred,
951951
NFS_PROTO(hdr->inode),
952952
desc->pg_rpc_callops,
953-
desc->pg_ioflags, 0);
953+
desc->pg_ioflags,
954+
RPC_TASK_CRED_NOREF);
954955
return ret;
955956
}
956957

fs/nfs/pnfs_nfs.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,8 @@ pnfs_generic_commit_pagelist(struct inode *inode, struct list_head *mds_pages,
536536
nfs_init_commit(data, NULL, NULL, cinfo);
537537
nfs_initiate_commit(NFS_CLIENT(inode), data,
538538
NFS_PROTO(data->inode),
539-
data->mds_ops, how, 0);
539+
data->mds_ops, how,
540+
RPC_TASK_CRED_NOREF);
540541
} else {
541542
nfs_init_commit(data, NULL, data->lseg, cinfo);
542543
initiate_commit(data, how);

fs/nfs/write.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1695,7 +1695,7 @@ int nfs_initiate_commit(struct rpc_clnt *clnt, struct nfs_commit_data *data,
16951695
.callback_ops = call_ops,
16961696
.callback_data = data,
16971697
.workqueue = nfsiod_workqueue,
1698-
.flags = RPC_TASK_ASYNC | RPC_TASK_CRED_NOREF | flags,
1698+
.flags = RPC_TASK_ASYNC | flags,
16991699
.priority = priority,
17001700
};
17011701
/* Set up the initial task struct. */
@@ -1813,7 +1813,7 @@ nfs_commit_list(struct inode *inode, struct list_head *head, int how,
18131813
nfs_init_commit(data, head, NULL, cinfo);
18141814
atomic_inc(&cinfo->mds->rpcs_out);
18151815
return nfs_initiate_commit(NFS_CLIENT(inode), data, NFS_PROTO(inode),
1816-
data->mds_ops, how, 0);
1816+
data->mds_ops, how, RPC_TASK_CRED_NOREF);
18171817
}
18181818

18191819
/*

0 commit comments

Comments
 (0)