]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
NFSv4/4.1: Fix bugs in nfs4[01]_walk_client_list
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Fri, 5 Apr 2013 20:11:11 +0000 (16:11 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 12 Apr 2013 16:52:10 +0000 (09:52 -0700)
commit3144c24db26e1ae4d64d26f5724b5500b1363fec
tree2013e91343e41cdc1a3d2095add5f76ef33969b4
parentc80a1c58deeac0c21cbf8d952c1bd08f1afbe8ed
NFSv4/4.1: Fix bugs in nfs4[01]_walk_client_list

commit 7b1f1fd1842e6ede25183c267ae733a7f67f00bc upstream.

It is unsafe to use list_for_each_entry_safe() here, because
when we drop the nn->nfs_client_lock, we pin the _current_ list
entry and ensure that it stays in the list, but we don't do the
same for the _next_ list entry. Use of list_for_each_entry() is
therefore the correct thing to do.

Also fix the refcounting in nfs41_walk_client_list().

Finally, ensure that the nfs_client has finished being initialised
and, in the case of NFSv4.1, that the session is set up.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: Chuck Lever <chuck.lever@oracle.com>
Cc: Bryan Schumaker <bjschuma@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/nfs4client.c