Jan Kara e91455bad5 bdev: Fixup error handling in blkdev_get()
Commit 89e524c04fa9 ("loop: Fix mount(2) failure due to race with
LOOP_SET_FD") converted blkdev_get() to use the new helpers for
finishing claiming of a block device. However the conversion botched the
error handling in blkdev_get() and thus the bdev has been marked as held
even in case __blkdev_get() returned error. This led to occasional
warnings with block/001 test from blktests like:

kernel: WARNING: CPU: 5 PID: 907 at fs/block_dev.c:1899 __blkdev_put+0x396/0x3a0

Correct the error handling.

CC: stable@vger.kernel.org
Fixes: 89e524c04fa9 ("loop: Fix mount(2) failure due to race with LOOP_SET_FD")
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-08-08 07:37:03 -06:00
..
2019-07-26 11:08:37 -07:00
2019-07-18 18:14:47 -05:00
2019-07-12 17:37:53 -07:00
2019-07-12 16:54:37 -07:00
2019-07-12 16:54:37 -07:00
2019-07-25 11:05:11 +02:00
2019-07-03 17:52:09 -04:00
2019-07-12 16:54:37 -07:00
2019-06-21 09:58:42 -07:00
\n
2019-07-10 20:27:07 -07:00
\n
2019-07-10 20:09:17 -07:00
\n
2019-07-10 20:27:07 -07:00
2019-07-18 11:18:00 -07:00
2019-07-15 21:20:52 -07:00
2019-05-21 08:23:41 +01:00
2019-07-19 11:38:12 -07:00
2019-04-08 18:21:02 -05:00
2019-03-08 14:48:40 -08:00
2019-07-12 16:54:37 -07:00
2019-07-10 21:22:43 -07:00
2019-02-07 16:38:35 +01:00
2019-07-04 22:01:58 -04:00