author: Gulam Mohamed <gulam.mohamed@oracle.com> 2021-05-14 15:18:42 +0200
committer: Jens Axboe <axboe@kernel.dk> 2021-05-20 07:59:35 -0600
commit: bc6a385132601c29a6da1dbf8148c0d3c9ad36dc
parent: 6c60ff048ca1e0739f39aa25996543c6e662a46c
Commit Summary:
Diffstat:
1 file changed, 3 insertions, 0 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 580bae995b87..4494411fa4d3 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -1244,6 +1244,9 @@ int bdev_disk_changed(struct block_device *bdev, bool invalidate)
lockdep_assert_held(&bdev->bd_mutex);
+ if (!(disk->flags & GENHD_FL_UP))
+ return -ENXIO;
+
rescan:
if (bdev->bd_part_count)
return -EBUSY;