linux/net/sunrpc
Stanislav Kinsbursky adb6fa7ffe SUNRPC: fix races on PipeFS UMOUNT notifications
CPU#0                                   CPU#1
-----------------------------           -----------------------------
rpc_kill_sb
sn->pipefs_sb = NULL                    rpc_release_client
(UMOUNT_EVENT)                          rpc_free_auth
rpc_pipefs_event
rpc_get_client_for_event
!atomic_inc_not_zero(cl_count)
<skip the client>
                                        atomic_inc(cl_count)
                                        rpc_free_client
                                        rpc_clnt_remove_pipedir
                                        <skip client dir removing>

To fix this, this patch does the following:

1) Calls RPC_PIPEFS_UMOUNT notification with sn->pipefs_sb_lock being held.
2) Removes SUNRPC client from the list AFTER pipes destroying.
3) Doesn't hold RPC client on notification: if client in the list, then it
can't be destroyed while sn->pipefs_sb_lock in hold by notification caller.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Cc: stable@vger.kernel.org
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2013-06-28 15:42:02 -04:00
..
auth_gss SUNRPC: Convert auth_gss pipe detection to work in namespaces 2013-05-16 06:17:54 -07:00
xprtrdma Merge branch 'for-3.9' of git://linux-nfs.org/~bfields/linux 2013-02-28 18:02:55 -08:00
Kconfig Merge branch 'rpcsec_gss-from_cel' into linux-next 2013-04-23 15:40:40 -04:00
Makefile
addr.c
auth.c SUNRPC: Don't recognize RPC_AUTH_MAXFLAVOR 2013-04-04 17:01:00 -04:00
auth_generic.c
auth_null.c
auth_unix.c
backchannel_rqst.c
bc_svc.c
cache.c Merge branch 'for-3.10' of git://linux-nfs.org/~bfields/linux 2013-05-03 10:59:39 -07:00
clnt.c SUNRPC: fix races on PipeFS UMOUNT notifications 2013-06-28 15:42:02 -04:00
netns.h SUNRPC: Convert auth_gss pipe detection to work in namespaces 2013-05-16 06:17:54 -07:00
rpc_pipe.c SUNRPC: fix races on PipeFS UMOUNT notifications 2013-06-28 15:42:02 -04:00
rpcb_clnt.c
sched.c SUNRPC: Remove redundant call to rpc_set_running() in __rpc_execute() 2013-06-06 16:24:40 -04:00
socklib.c
stats.c procfs: new helper - PDE_DATA(inode) 2013-04-09 14:13:32 -04:00
sunrpc.h
sunrpc_syms.c
svc.c
svc_xprt.c
svcauth.c hlist: drop the node parameter from iterators 2013-02-27 19:10:24 -08:00
svcauth_unix.c Merge branch 'for-3.9' of git://linux-nfs.org/~bfields/linux 2013-02-28 18:02:55 -08:00
svcsock.c
sysctl.c
timer.c
xdr.c
xprt.c SUNRPC: allow disabling idle timeout 2013-04-26 11:41:26 -04:00
xprtsock.c NFS client bugfixes and cleanups for 3.10 2013-04-30 11:28:08 -07:00