]> git.hungrycats.org Git - linux/commit
loop: don't call into filesystem while holding lo_ctl_mutex
authorOmar Sandoval <osandov@fb.com>
Tue, 27 Mar 2018 04:39:11 +0000 (21:39 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 May 2018 14:46:10 +0000 (16:46 +0200)
commit9a0e8aa0f0f2e8df4703c53b2a7f59a02b98a8da
treebe1ae94893d649a6d04ca12bfd20f7472043980e
parentd04d5683cfff53abff567f78e09bbc97bb6a80d7
loop: don't call into filesystem while holding lo_ctl_mutex

commit 2d1d4c1e591fd40bd7dafd868a249d7d00e215d5 upstream.

We hit an issue where a loop device on NFS was stuck in
loop_get_status() doing vfs_getattr() after the NFS server died, which
caused a pile-up of uninterruptible processes waiting on lo_ctl_mutex.
There's no reason to hold this lock while we wait on the filesystem;
let's drop it so that other processes can do their thing. We need to
grab a reference on lo_backing_file while we use it, and we can get rid
of the check on lo_device, which has been unnecessary since commit
a34c0ae9ebd6 ("[PATCH] loop: remove the bio remapping capability") in
the linux-history tree.

Signed-off-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/block/loop.c