nvme: warn only once for legacy uuid attribute
authorKeith Busch <kbusch@kernel.org>
Wed, 12 Jul 2023 14:54:59 +0000 (07:54 -0700)
committerKeith Busch <kbusch@kernel.org>
Wed, 12 Jul 2023 15:48:19 +0000 (08:48 -0700)
Report the legacy fallback behavior for uuid attributes just once
instead of logging repeated warnings for the same condition every time
the attribute is read. The old behavior is too spamy on the kernel logs.

Cc: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reported-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
drivers/nvme/host/sysfs.c

index 45e91811f905cba8b725536c836c76f3f2de9c51..212e1b05d2984f7a9d571612cec4e0f3d3f9f834 100644 (file)
@@ -92,7 +92,7 @@ static ssize_t uuid_show(struct device *dev, struct device_attribute *attr,
         * we have no UUID set
         */
        if (uuid_is_null(&ids->uuid)) {
-               dev_warn_ratelimited(dev,
+               dev_warn_once(dev,
                        "No UUID available providing old NGUID\n");
                return sysfs_emit(buf, "%pU\n", ids->nguid);
        }