From 1321ab06c2447dbdf28ed7e8bb82f6bcb1b951b3 Mon Sep 17 00:00:00 2001 From: paul-1 <6473457+paul-1@users.noreply.github.com> Date: Sat, 26 Feb 2022 13:28:26 -0500 Subject: [PATCH] block: Prevent size changes of loop device creation from making excess noise in demsg. --- block/genhd.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/block/genhd.c b/block/genhd.c index bd3a6841e5b5..74faeb15d6a4 100644 --- a/block/genhd.c +++ b/block/genhd.c @@ -90,8 +90,11 @@ bool set_capacity_and_notify(struct gendisk *disk, sector_t size) (disk->flags & GENHD_FL_HIDDEN)) return false; - pr_info_ratelimited("%s: detected capacity change from %lld to %lld\n", - disk->disk_name, capacity, size); + //Prevent loop device creation noise in dmesg. + if (disk->major != 7 || + capacity != 0) + pr_info_ratelimited("%s: detected capacity change from %lld to %lld\n", + disk->disk_name, capacity, size); /* * Historically we did not send a uevent for changes to/from an empty