Skip to content
Commit 428913bc authored by Yu Kuai's avatar Yu Kuai Committed by Jens Axboe
Browse files

block: fix wrong mode for blkdev_put() from disk_scan_partitions()



If disk_scan_partitions() is called with 'FMODE_EXCL',
blkdev_get_by_dev() will be called without 'FMODE_EXCL', however, follow
blkdev_put() is still called with 'FMODE_EXCL', which will cause
'bd_holders' counter to leak.

Fix the problem by using the right mode for blkdev_put().

Reported-by: default avatar <syzbot+2bcc0d79e548c4f62a59@syzkaller.appspotmail.com>
Link: https://lore.kernel.org/lkml/f9649d501bc8c3444769418f6c26263555d9d3be.camel@linux.ibm.com/T/


Tested-by: default avatarJulian Ruess <julianr@linux.ibm.com>
Fixes: e5cfefa9

 ("block: fix scan partition for exclusively open device again")
Signed-off-by: default avatarYu Kuai <yukuai3@huawei.com>
Reviewed-by: default avatarJan Kara <jack@suse.cz>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent fe15c26e
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment