Commit 98f62c2f authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Yongqiang Liu
Browse files

block: return -EBUSY when there are open partitions in blkdev_reread_part

mainline inclusion
from mainline-v5.12~10
commit 68e6582e
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7F3M1
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v6.4-rc7&id=68e6582e8f2dc32fd2458b9926564faa1fb4560e



----------------------------------------------

The switch to go through blkdev_get_by_dev means we now ignore the
return value from bdev_disk_changed in __blkdev_get.  Add a manual
check to restore the old semantics.

Fixes: 4601b4b1 ("block: reopen the device in blkdev_reread_part")
Reported-by: default avatarKarel Zak <kzak@redhat.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20210421160502.447418-1-hch@lst.de


Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>

Conflicts:
  block/ioctl.c
Signed-off-by: default avatarLi Lingfeng <lilingfeng3@huawei.com>
Reviewed-by: default avatarYu Kuai <yukuai3@huawei.com>
Signed-off-by: default avatarYongqiang Liu <liuyongqiang13@huawei.com>
parent 8c91fb1a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment