Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mtdblock: make warning messages ratelimited

When exercising various dev interfaces with stress-ng the mtdblock drivers
can be (ab)used to generate a lot of warning messages. Make these rate
limited to reduce the kernel log from being spammed with the same messages.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20230719103354.2829366-1-colin.i.king@gmail.com

authored by

Colin Ian King and committed by
Miquel Raynal
d2236f62 c2fc6b69

+2 -2
+1 -1
drivers/mtd/mtdblock.c
··· 262 262 } 263 263 264 264 if (mtd_type_is_nand(mbd->mtd)) 265 - pr_warn("%s: MTD device '%s' is NAND, please consider using UBI block devices instead.\n", 265 + pr_warn_ratelimited("%s: MTD device '%s' is NAND, please consider using UBI block devices instead.\n", 266 266 mbd->tr->name, mbd->mtd->name); 267 267 268 268 /* OK, it's not open. Create cache info for it */
+1 -1
drivers/mtd/mtdblock_ro.c
··· 49 49 dev->readonly = 1; 50 50 51 51 if (mtd_type_is_nand(mtd)) 52 - pr_warn("%s: MTD device '%s' is NAND, please consider using UBI block devices instead.\n", 52 + pr_warn_ratelimited("%s: MTD device '%s' is NAND, please consider using UBI block devices instead.\n", 53 53 tr->name, mtd->name); 54 54 55 55 if (add_mtd_blktrans_dev(dev))