]> www.infradead.org Git - users/jedix/linux-maple.git/commit
block: loop: fix another reread part failure
authorMing Lei <ming.lei@canonical.com>
Thu, 5 Sep 2019 07:55:27 +0000 (15:55 +0800)
committerBrian Maly <brian.maly@oracle.com>
Tue, 10 Sep 2019 14:49:06 +0000 (10:49 -0400)
commit21297b1770912bc4bf403e43499d500ef57fc30f
tree8df3d4e50f4a431b68c362db773b187cfbf59d71
parent93204e7b1fa59ea9aa717e9dcd71c08aece6a190
block: loop: fix another reread part failure

loop_clr_fd() can be run piggyback with lo_release(), and
under this situation, reread partition may always fail because
bd_mutex has been held already.

This patch detects the situation by the reference count, and
call __blkdev_reread_part() to avoid acquiring the lock again.

In the meantime, this patch switches to new kernel APIs
of blkdev_reread_part() and __blkdev_reread_part().

Reviewed-by: Christoph Hellwig <hch@lst.de>
Tested-by: Jarod Wilson <jarod@redhat.com>
Acked-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Ming Lei <ming.lei@canonical.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry-picked from commit 06f0e9e68c0d81c7d822a405f6e35686a711c1fe)
Orabug: 30264603
Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>
Reviewed-by: Joe Jin <joe.jin@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/block/loop.c