Skip to contentSkip to conversation

block: print error via printk_ratelimited in blk_partition_remap()

PATCH New Ming Lei 1 participant 1 message Dec 6, 2017 Block layer

lore
Share & tools
lore

Ming Lei

author
#0 lore raw

PATCH 1/1 block: print error via printk_ratelimited in blk_partition_remap()

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 <[email protected]>
---
 block/blk-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
block/blk-core.c +1 -1
index b8881750a3ac..32878c2ccece 100644
@@ -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();
Signature · 1 line
2.9.5