Patch "blk-core: use pr_warn_ratelimited() in bio_check_ro()" has been added to the 6.6-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    blk-core: use pr_warn_ratelimited() in bio_check_ro()

to the 6.6-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     blk-core-use-pr_warn_ratelimited-in-bio_check_ro.patch
and it can be found in the queue-6.6 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 922a2607ee9d6b5c609ab4010c0ae404591731aa
Author: Yu Kuai <yukuai3@xxxxxxxxxx>
Date:   Tue Nov 7 19:12:47 2023 +0800

    blk-core: use pr_warn_ratelimited() in bio_check_ro()
    
    [ Upstream commit 1b0a151c10a6d823f033023b9fdd9af72a89591b ]
    
    If one of the underlying disks of raid or dm is set to read-only, then
    each io will generate new log, which will cause message storm. This
    environment is indeed problematic, however we can't make sure our
    naive custormer won't do this, hence use pr_warn_ratelimited() to
    prevent message storm in this case.
    
    Signed-off-by: Yu Kuai <yukuai3@xxxxxxxxxx>
    Fixes: 57e95e4670d1 ("block: fix and cleanup bio_check_ro")
    Signed-off-by: Ye Bin <yebin10@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20231107111247.2157820-1-yukuai1@xxxxxxxxxxxxxxx
    Signed-off-by: Jens Axboe <axboe@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/block/blk-core.c b/block/blk-core.c
index 9d51e9894ece7..fdf25b8d6e784 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -501,8 +501,8 @@ static inline void bio_check_ro(struct bio *bio)
 	if (op_is_write(bio_op(bio)) && bdev_read_only(bio->bi_bdev)) {
 		if (op_is_flush(bio->bi_opf) && !bio_sectors(bio))
 			return;
-		pr_warn("Trying to write to read-only block-device %pg\n",
-			bio->bi_bdev);
+		pr_warn_ratelimited("Trying to write to read-only block-device %pg\n",
+				    bio->bi_bdev);
 		/* Older lvm-tools actually trigger this */
 	}
 }



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux