If there are IOs running on one partition during remove disk, 
blk_partition_remap()
complains the partition is missed because it is removed by del_gendisk(),
and causes flood of this error messge, so this patch uses printk_ratelimited()
to avoid the issue.

Cc: Christoph Hellwig <h...@lst.de>
Signed-off-by: Ming Lei <ming....@redhat.com>
---
 block/blk-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/blk-core.c b/block/blk-core.c
index b8881750a3ac..32878c2ccece 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -2074,7 +2074,7 @@ static inline int blk_partition_remap(struct bio *bio)
                trace_block_bio_remap(bio->bi_disk->queue, bio, part_devt(p),
                                bio->bi_iter.bi_sector - p->start_sect);
        } else {
-               printk("%s: fail for partition %d\n", __func__, bio->bi_partno);
+               printk_ratelimited("%s: fail for partition %d\n", __func__, 
bio->bi_partno);
                ret = -EIO;
        }
        rcu_read_unlock();
-- 
2.9.5

Reply via email to