diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2013-05-20 11:05:17 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2013-06-06 16:24:35 -0400 |
commit | 965e9c23de1c69a9fae2e68679027d01685530c4 (patch) | |
tree | 61d7f302648beb925232816ac2dd58f87911c4c6 | |
parent | 9556000d8c5af9fb3a5f0abd97c632108f3acfb1 (diff) |
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>
-rw-r--r-- | fs/nfs/nfs4_fs.h | 2 | ||||
-rw-r--r-- | fs/nfs/nfs4proc.c | 4 | ||||
-rw-r--r-- | fs/nfs/nfs4state.c | 13 |
3 files changed, 14 insertions, 5 deletions
diff --git a/fs/nfs/nfs4_fs.h b/fs/nfs/nfs4_fs.h index a1dd768d0a35..e64a00c03371 100644 --- a/fs/nfs/nfs4_fs.h +++ b/fs/nfs/nfs4_fs.h | |||
@@ -194,7 +194,7 @@ struct nfs4_state_recovery_ops { | |||
194 | int (*recover_lock)(struct nfs4_state *, struct file_lock *); | 194 | int (*recover_lock)(struct nfs4_state *, struct file_lock *); |
195 | int (*establish_clid)(struct nfs_client *, struct rpc_cred *); | 195 | int (*establish_clid)(struct nfs_client *, struct rpc_cred *); |
196 | struct rpc_cred * (*get_clid_cred)(struct nfs_client *); | 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 | int (*detect_trunking)(struct nfs_client *, struct nfs_client **, | 198 | int (*detect_trunking)(struct nfs_client *, struct nfs_client **, |
199 | struct rpc_cred *); | 199 | struct rpc_cred *); |
200 | }; | 200 | }; |
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index a8d035e2c53b..d94af83171af 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -6159,12 +6159,14 @@ static const struct rpc_call_ops nfs4_reclaim_complete_call_ops = { | |||
6159 | /* | 6159 | /* |
6160 | * Issue a global reclaim complete. | 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 | struct nfs4_reclaim_complete_data *calldata; | 6165 | struct nfs4_reclaim_complete_data *calldata; |
6165 | struct rpc_task *task; | 6166 | struct rpc_task *task; |
6166 | struct rpc_message msg = { | 6167 | struct rpc_message msg = { |
6167 | .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_RECLAIM_COMPLETE], | 6168 | .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_RECLAIM_COMPLETE], |
6169 | .rpc_cred = cred, | ||
6168 | }; | 6170 | }; |
6169 | struct rpc_task_setup task_setup_data = { | 6171 | struct rpc_task_setup task_setup_data = { |
6170 | .rpc_client = clp->cl_rpcclient, | 6172 | .rpc_client = clp->cl_rpcclient, |
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index 1fab140764c4..5244ffd304e8 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c | |||
@@ -1563,11 +1563,12 @@ static void nfs4_state_start_reclaim_reboot(struct nfs_client *clp) | |||
1563 | } | 1563 | } |
1564 | 1564 | ||
1565 | static void nfs4_reclaim_complete(struct nfs_client *clp, | 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 | /* Notify the server we're done reclaiming our state */ | 1569 | /* Notify the server we're done reclaiming our state */ |
1569 | if (ops->reclaim_complete) | 1570 | if (ops->reclaim_complete) |
1570 | (void)ops->reclaim_complete(clp); | 1571 | (void)ops->reclaim_complete(clp, cred); |
1571 | } | 1572 | } |
1572 | 1573 | ||
1573 | static void nfs4_clear_reclaim_server(struct nfs_server *server) | 1574 | static void nfs4_clear_reclaim_server(struct nfs_server *server) |
@@ -1612,9 +1613,15 @@ static int nfs4_state_clear_reclaim_reboot(struct nfs_client *clp) | |||
1612 | 1613 | ||
1613 | static void nfs4_state_end_reclaim_reboot(struct nfs_client *clp) | 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 | if (!nfs4_state_clear_reclaim_reboot(clp)) | 1619 | if (!nfs4_state_clear_reclaim_reboot(clp)) |
1616 | return; | 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 | static void nfs_delegation_clear_all(struct nfs_client *clp) | 1627 | static void nfs_delegation_clear_all(struct nfs_client *clp) |