Re: [PATCH 1/2] NFS: Remove bad delegations during open recovery

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2012-09-26 at 13:12 -0400, bjschuma@xxxxxxxxxx wrote:
> From: Bryan Schumaker <bjschuma@xxxxxxxxxx>
> 
> 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@xxxxxxxxxx>
> ---
>  fs/nfs/nfs4proc.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
> index 1e50326..e47ec55 100644
> --- a/fs/nfs/nfs4proc.c
> +++ b/fs/nfs/nfs4proc.c
> @@ -1774,7 +1774,9 @@ static void nfs41_clear_delegation_stateid(struct nfs4_state *state)
>  		 * informs us the stateid is unrecognized. */
>  		if (status != -NFS4ERR_BAD_STATEID)
>  			nfs41_free_stateid(server, stateid);
> +		nfs_remove_bad_delegation(state->inode);
>  
> +		nfs4_stateid_copy(&state->stateid, &state->open_stateid);

nfs4_stateid_copy needs to be write-protected by the state->seqlock
here.

>  		clear_bit(NFS_DELEGATED_STATE, &state->flags);
>  	}
>  }

-- 
Trond Myklebust
Linux NFS client maintainer

NetApp
Trond.Myklebust@xxxxxxxxxx
www.netapp.com
��.n��������+%������w��{.n�����{��w���jg��������ݢj����G�������j:+v���w�m������w�������h�����٥



[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux