diff options
author | Bryan Schumaker <bjschuma@netapp.com> | 2012-09-26 15:25:52 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-10-01 18:17:25 -0400 |
commit | 6938867edba929a65a167a97581231e76aeb10b4 (patch) | |
tree | 9f1fcee1c9dc22515d335c69db0f01e5eb9f4bb1 /fs/nfs/nfs4proc.c | |
parent | fcb6d9c6b719b633e9b98d26d8a7937209e8bf21 (diff) |
NFS: Remove bad delegations during open recovery
I put the client into an open recovery loop by:
Client: Open file
read half
Server: Expire client (echo 0 > /sys/kernel/debug/nfsd/forget_clients)
Client: Drop vm cache (echo 3 > /proc/sys/vm/drop_caches)
finish reading file
This causes a loop because the client never updates the nfs4_state after
discovering that the delegation is invalid. This means it will keep
trying to read using the bad delegation rather than attempting to re-open
the file.
Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
CC: stable@vger.kernel.org [3.4+]
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r-- | fs/nfs/nfs4proc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 755ee162ee7e..471a75f11ea2 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -1774,7 +1774,11 @@ static void nfs41_clear_delegation_stateid(struct nfs4_state *state) | |||
1774 | * informs us the stateid is unrecognized. */ | 1774 | * informs us the stateid is unrecognized. */ |
1775 | if (status != -NFS4ERR_BAD_STATEID) | 1775 | if (status != -NFS4ERR_BAD_STATEID) |
1776 | nfs41_free_stateid(server, stateid); | 1776 | nfs41_free_stateid(server, stateid); |
1777 | nfs_remove_bad_delegation(state->inode); | ||
1777 | 1778 | ||
1779 | write_seqlock(&state->seqlock); | ||
1780 | nfs4_stateid_copy(&state->stateid, &state->open_stateid); | ||
1781 | write_sequnlock(&state->seqlock); | ||
1778 | clear_bit(NFS_DELEGATED_STATE, &state->flags); | 1782 | clear_bit(NFS_DELEGATED_STATE, &state->flags); |
1779 | } | 1783 | } |
1780 | } | 1784 | } |