]> git.baikalelectronics.ru Git - kernel.git/commit
block: fix a device invalidation regression
authorChristoph Hellwig <hch@lst.de>
Wed, 18 Mar 2020 08:12:06 +0000 (09:12 +0100)
committerJens Axboe <axboe@kernel.dk>
Wed, 18 Mar 2020 14:47:04 +0000 (08:47 -0600)
commitaa4a8213ff6be5150c977db3b05c9726a1dc3c1e
treef412dc2481160bd1d32ef573b7b6fd58dae1834e
parent0fd1f4c44c24b8cd44df747787fa82f91a0fca30
block: fix a device invalidation regression

Historically we only set the capacity to zero for devices that support
partitions (independ of actually having partitions created).  Doing that
is rather inconsistent, but changing it broke legacy udisks polling for
legacy ide-cdrom devices.  Use the crude a crude check for devices that
either are non-removable or partitionable to get the sane behavior for
most device while not breaking userspace for this particular setup.

Fixes: 78ef98e4e278 ("block: move rescan_partitions to fs/block_dev.c")
Reported-by: He Zhe <zhe.he@windriver.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Tested-by: He Zhe <zhe.he@windriver.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/block_dev.c