ceph: make sure mdsc->mutex is nested in s->s_mutex to fix dead lock
authorXiubo Li <xiubli@redhat.com>
Wed, 20 May 2020 07:51:19 +0000 (03:51 -0400)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 1 Jun 2020 11:22:53 +0000 (13:22 +0200)
commitea8412b284c09742d5b11721e225b4ff011aa397
tree84699cc906c8a96ca329dda380a2628fe3acd931
parent878dabb64117406abd40977b87544d05bb3031fc
ceph: make sure mdsc->mutex is nested in s->s_mutex to fix dead lock

send_mds_reconnect takes the s_mutex while the mdsc->mutex is already
held. That inverts the locking order documented in mds_client.h. Drop
the mdsc->mutex, acquire the s_mutex and then reacquire the mdsc->mutex
to prevent a deadlock.

URL: https://tracker.ceph.com/issues/45609
Signed-off-by: Xiubo Li <xiubli@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/mds_client.c