summaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4proc.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r--fs/nfs/nfs4proc.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 04baee4327b2..4cc86001220a 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -2385,9 +2385,10 @@ static int nfs4_open_expired(struct nfs4_state_owner *sp, struct nfs4_state *sta
2385 return ret; 2385 return ret;
2386} 2386}
2387 2387
2388static void nfs_finish_clear_delegation_stateid(struct nfs4_state *state) 2388static void nfs_finish_clear_delegation_stateid(struct nfs4_state *state,
2389 const nfs4_stateid *stateid)
2389{ 2390{
2390 nfs_remove_bad_delegation(state->inode); 2391 nfs_remove_bad_delegation(state->inode, stateid);
2391 write_seqlock(&state->seqlock); 2392 write_seqlock(&state->seqlock);
2392 nfs4_stateid_copy(&state->stateid, &state->open_stateid); 2393 nfs4_stateid_copy(&state->stateid, &state->open_stateid);
2393 write_sequnlock(&state->seqlock); 2394 write_sequnlock(&state->seqlock);
@@ -2397,7 +2398,7 @@ static void nfs_finish_clear_delegation_stateid(struct nfs4_state *state)
2397static void nfs40_clear_delegation_stateid(struct nfs4_state *state) 2398static void nfs40_clear_delegation_stateid(struct nfs4_state *state)
2398{ 2399{
2399 if (rcu_access_pointer(NFS_I(state->inode)->delegation) != NULL) 2400 if (rcu_access_pointer(NFS_I(state->inode)->delegation) != NULL)
2400 nfs_finish_clear_delegation_stateid(state); 2401 nfs_finish_clear_delegation_stateid(state, NULL);
2401} 2402}
2402 2403
2403static int nfs40_open_expired(struct nfs4_state_owner *sp, struct nfs4_state *state) 2404static int nfs40_open_expired(struct nfs4_state_owner *sp, struct nfs4_state *state)
@@ -2443,19 +2444,20 @@ static void nfs41_check_delegation_stateid(struct nfs4_state *state)
2443 rcu_read_unlock(); 2444 rcu_read_unlock();
2444 return; 2445 return;
2445 } 2446 }
2447
2448 nfs4_stateid_copy(&stateid, &delegation->stateid);
2446 if (test_bit(NFS_DELEGATION_REVOKED, &delegation->flags)) { 2449 if (test_bit(NFS_DELEGATION_REVOKED, &delegation->flags)) {
2447 rcu_read_unlock(); 2450 rcu_read_unlock();
2448 nfs_finish_clear_delegation_stateid(state); 2451 nfs_finish_clear_delegation_stateid(state, &stateid);
2449 return; 2452 return;
2450 } 2453 }
2451 2454
2452 nfs4_stateid_copy(&stateid, &delegation->stateid);
2453 cred = get_rpccred(delegation->cred); 2455 cred = get_rpccred(delegation->cred);
2454 rcu_read_unlock(); 2456 rcu_read_unlock();
2455 status = nfs41_test_and_free_expired_stateid(server, &stateid, cred); 2457 status = nfs41_test_and_free_expired_stateid(server, &stateid, cred);
2456 trace_nfs4_test_delegation_stateid(state, NULL, status); 2458 trace_nfs4_test_delegation_stateid(state, NULL, status);
2457 if (status != NFS_OK) 2459 if (status != NFS_OK)
2458 nfs_finish_clear_delegation_stateid(state); 2460 nfs_finish_clear_delegation_stateid(state, &stateid);
2459 2461
2460 put_rpccred(cred); 2462 put_rpccred(cred);
2461} 2463}