Re: [PATCH v4.14-stable v2] nfs: fix a deadlock in nfs client initialization

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

 



On Wed, Jan 23, 2019 at 11:00:24PM -0800, Qian Lu wrote:
> From: Scott Mayhew <smayhew@xxxxxxxxxx>
> 
> The following deadlock can occur between a process waiting for a client
> to initialize in while walking the client list during nfsv4 server trunking
> detection and another process waiting for the nfs_clid_init_mutex so it
> can initialize that client:
> 
> Process 1                               Process 2
> ---------                               ---------
> spin_lock(&nn->nfs_client_lock);
> list_add_tail(&CLIENTA->cl_share_link,
>         &nn->nfs_client_list);
> spin_unlock(&nn->nfs_client_lock);
>                                         spin_lock(&nn->nfs_client_lock);
>                                         list_add_tail(&CLIENTB->cl_share_link,
>                                                 &nn->nfs_client_list);
>                                         spin_unlock(&nn->nfs_client_lock);
>                                         mutex_lock(&nfs_clid_init_mutex);
>                                         nfs41_walk_client_list(clp, result, cred);
>                                         nfs_wait_client_init_complete(CLIENTA);
> (waiting for nfs_clid_init_mutex)
> 
> Make sure nfs_match_client() only evaluates clients that have completed
> initialization in order to prevent that deadlock.
> 
> This patch also fixes v4.0 trunking behavior by not marking the client
> NFS_CS_READY until the clientid has been confirmed.
> 
> Signed-off-by: Scott Mayhew <smayhew@xxxxxxxxxx>
> Signed-off-by: Anna Schumaker <Anna.Schumaker@xxxxxxxxxx>
> Signed-off-by: Qian Lu <luqia@xxxxxxxxxx>
> ---
>  fs/nfs/client.c     | 11 +++++++++++
>  fs/nfs/nfs4client.c | 17 +++++++++++++----
>  2 files changed, 24 insertions(+), 4 deletions(-)

You forgot to mention the sha1 of the commit :(

I dug it up this time...

greg k-h



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux