Re: [PATCH] NFS: Fix an rcu deadlock in nfs_delegation_find_inode()

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

 



On Thu, 2018-06-14 at 09:39 -0400, schumaker.anna@xxxxxxxxx wrote:
> From: Anna Schumaker <Anna.Schumaker@xxxxxxxxxx>
> 
> I was able to reproduce this pretty regularily using xfstests
> generic/013 on NFS v4.0.
> 
> Reported-by: Ross Zwisler <Ross.Zwisler@xxxxxxxxxxxxxxx>
> Fixes: a337fe91 (NFSv4: Return NFS4ERR_DELAY when a delegation recall
> fails due to igrab())
> Signed-off-by: Anna Schumaker <Anna.Schumaker@xxxxxxxxxx>
> ---
>  fs/nfs/delegation.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c
> index bbd0465535eb..f033f3a69a3b 100644
> --- a/fs/nfs/delegation.c
> +++ b/fs/nfs/delegation.c
> @@ -883,8 +883,10 @@ struct inode *nfs_delegation_find_inode(struct
> nfs_client *clp,
>  	rcu_read_lock();
>  	list_for_each_entry_rcu(server, &clp->cl_superblocks,
> client_link) {
>  		res = nfs_delegation_find_inode_server(server,
> fhandle);
> -		if (res != ERR_PTR(-ENOENT))
> +		if (res != ERR_PTR(-ENOENT)) {
> +			rcu_read_unlock();
>  			return res;
> +		}
>  	}
>  	rcu_read_unlock();
>  	return ERR_PTR(-ENOENT);

Oh, duh... Thanks for spotting that!

-- 
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trond.myklebust@xxxxxxxxxxxxxxx

��.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