]> git.hungrycats.org Git - linux/commit
loop: fix LO_FLAGS_PARTSCAN hang
authorOmar Sandoval <osandov@fb.com>
Wed, 1 Mar 2017 18:42:38 +0000 (10:42 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 12 Mar 2017 05:44:12 +0000 (06:44 +0100)
commitcdc13a3e453e5932fd7a35f3101688c1bd7b245a
tree3a634b387e156763b326bd1b3615a8801d344bba
parentd957eb76b46870e98fbe8d367daf89f7b4713337
loop: fix LO_FLAGS_PARTSCAN hang

commit e02898b423802b1f3a3aaa7f16e896da069ba8f7 upstream.

loop_reread_partitions() needs to do I/O, but we just froze the queue,
so we end up waiting forever. This can easily be reproduced with losetup
-P. Fix it by moving the reread to after we unfreeze the queue.

Fixes: ecdd09597a57 ("block/loop: fix race between I/O and set_status")
Reported-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Omar Sandoval <osandov@fb.com>
Reviewed-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/block/loop.c