Commit 965e9c23de1c69a9fae2e68679027d01685530c4

Authored by Trond Myklebust
1 parent 9556000d8c

NFSv4.1: Ensure that reclaim_complete uses the right credential

We want to use the same credential for reclaim_complete as we used
for the exchange_id call.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

Showing 3 changed files with 14 additions and 5 deletions Side-by-side Diff

... ... @@ -194,7 +194,7 @@
194 194 int (*recover_lock)(struct nfs4_state *, struct file_lock *);
195 195 int (*establish_clid)(struct nfs_client *, struct rpc_cred *);
196 196 struct rpc_cred * (*get_clid_cred)(struct nfs_client *);
197   - int (*reclaim_complete)(struct nfs_client *);
  197 + int (*reclaim_complete)(struct nfs_client *, struct rpc_cred *);
198 198 int (*detect_trunking)(struct nfs_client *, struct nfs_client **,
199 199 struct rpc_cred *);
200 200 };
... ... @@ -6159,12 +6159,14 @@
6159 6159 /*
6160 6160 * Issue a global reclaim complete.
6161 6161 */
6162   -static int nfs41_proc_reclaim_complete(struct nfs_client *clp)
  6162 +static int nfs41_proc_reclaim_complete(struct nfs_client *clp,
  6163 + struct rpc_cred *cred)
6163 6164 {
6164 6165 struct nfs4_reclaim_complete_data *calldata;
6165 6166 struct rpc_task *task;
6166 6167 struct rpc_message msg = {
6167 6168 .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_RECLAIM_COMPLETE],
  6169 + .rpc_cred = cred,
6168 6170 };
6169 6171 struct rpc_task_setup task_setup_data = {
6170 6172 .rpc_client = clp->cl_rpcclient,
... ... @@ -1563,11 +1563,12 @@
1563 1563 }
1564 1564  
1565 1565 static void nfs4_reclaim_complete(struct nfs_client *clp,
1566   - const struct nfs4_state_recovery_ops *ops)
  1566 + const struct nfs4_state_recovery_ops *ops,
  1567 + struct rpc_cred *cred)
1567 1568 {
1568 1569 /* Notify the server we're done reclaiming our state */
1569 1570 if (ops->reclaim_complete)
1570   - (void)ops->reclaim_complete(clp);
  1571 + (void)ops->reclaim_complete(clp, cred);
1571 1572 }
1572 1573  
1573 1574 static void nfs4_clear_reclaim_server(struct nfs_server *server)
1574 1575  
... ... @@ -1612,9 +1613,15 @@
1612 1613  
1613 1614 static void nfs4_state_end_reclaim_reboot(struct nfs_client *clp)
1614 1615 {
  1616 + const struct nfs4_state_recovery_ops *ops;
  1617 + struct rpc_cred *cred;
  1618 +
1615 1619 if (!nfs4_state_clear_reclaim_reboot(clp))
1616 1620 return;
1617   - nfs4_reclaim_complete(clp, clp->cl_mvops->reboot_recovery_ops);
  1621 + ops = clp->cl_mvops->reboot_recovery_ops;
  1622 + cred = ops->get_clid_cred(clp);
  1623 + nfs4_reclaim_complete(clp, ops, cred);
  1624 + put_rpccred(cred);
1618 1625 }
1619 1626  
1620 1627 static void nfs_delegation_clear_all(struct nfs_client *clp)