All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nvme: add device name to warning in uuid_show()
@ 2022-06-07 15:55 Thomas Weißschuh
  2022-06-07 16:11 ` Keith Busch
  2022-06-13 17:58 ` Christoph Hellwig
  0 siblings, 2 replies; 4+ messages in thread
From: Thomas Weißschuh @ 2022-06-07 15:55 UTC (permalink / raw)
  To: Keith Busch, Jens Axboe, Christoph Hellwig, Sagi Grimberg
  Cc: linux-nvme, linux-kernel, Thomas Weißschuh

This provides more context to users.

Old message:

[   00.000000] No UUID available providing old NGUID

New message:

[   00.000000] block nvme0n1: No UUID available providing old NGUID

Fixes: d934f9848a77 ("nvme: provide UUID value to userspace")
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
 drivers/nvme/host/core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 24165daee3c8..189bbd6c0c29 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -3285,8 +3285,7 @@ static ssize_t uuid_show(struct device *dev, struct device_attribute *attr,
 	 * we have no UUID set
 	 */
 	if (uuid_is_null(&ids->uuid)) {
-		printk_ratelimited(KERN_WARNING
-				   "No UUID available providing old NGUID\n");
+		dev_warn_ratelimited(dev, "No UUID available providing old NGUID\n");
 		return sysfs_emit(buf, "%pU\n", ids->nguid);
 	}
 	return sysfs_emit(buf, "%pU\n", &ids->uuid);

base-commit: e71e60cd74df9386c3f684c54888f2367050b831
-- 
2.36.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] nvme: add device name to warning in uuid_show()
  2022-06-07 15:55 [PATCH] nvme: add device name to warning in uuid_show() Thomas Weißschuh
@ 2022-06-07 16:11 ` Keith Busch
  2022-06-07 22:55   ` Thomas Weißschuh
  2022-06-13 17:58 ` Christoph Hellwig
  1 sibling, 1 reply; 4+ messages in thread
From: Keith Busch @ 2022-06-07 16:11 UTC (permalink / raw)
  To: Thomas Weißschuh
  Cc: Jens Axboe, Christoph Hellwig, Sagi Grimberg, linux-nvme, linux-kernel

On Tue, Jun 07, 2022 at 05:55:55PM +0200, Thomas Weißschuh wrote:
>  	if (uuid_is_null(&ids->uuid)) {
> -		printk_ratelimited(KERN_WARNING
> -				   "No UUID available providing old NGUID\n");
> +		dev_warn_ratelimited(dev, "No UUID available providing old NGUID\n");
>  		return sysfs_emit(buf, "%pU\n", ids->nguid);

The line split was correct to prevent this overly long line. But otherwise,
this looks good, though I'm wondering why this needs to be printed every time
someone reads the attribute.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] nvme: add device name to warning in uuid_show()
  2022-06-07 16:11 ` Keith Busch
@ 2022-06-07 22:55   ` Thomas Weißschuh
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Weißschuh @ 2022-06-07 22:55 UTC (permalink / raw)
  To: Keith Busch
  Cc: Jens Axboe, Christoph Hellwig, Sagi Grimberg, linux-nvme, linux-kernel

On 2022-06-07 10:11-0600, Keith Busch wrote:
> On Tue, Jun 07, 2022 at 05:55:55PM +0200, Thomas Weißschuh wrote:
> >  	if (uuid_is_null(&ids->uuid)) {
> > -		printk_ratelimited(KERN_WARNING
> > -				   "No UUID available providing old NGUID\n");
> > +		dev_warn_ratelimited(dev, "No UUID available providing old NGUID\n");
> >  		return sysfs_emit(buf, "%pU\n", ids->nguid);
> 
> The line split was correct to prevent this overly long line. But otherwise,
> this looks good, though I'm wondering why this needs to be printed every time
> someone reads the attribute.

Sorry about the long line, thought it looks nicer on one line and other
(similar) lines in the file are also using up to 100 characters per line.
Do you want me to resend it?

No idea why has to be printed every time. A dev_warn_once() would be less
spammy.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] nvme: add device name to warning in uuid_show()
  2022-06-07 15:55 [PATCH] nvme: add device name to warning in uuid_show() Thomas Weißschuh
  2022-06-07 16:11 ` Keith Busch
@ 2022-06-13 17:58 ` Christoph Hellwig
  1 sibling, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2022-06-13 17:58 UTC (permalink / raw)
  To: Thomas Weißschuh
  Cc: Keith Busch, Jens Axboe, Christoph Hellwig, Sagi Grimberg,
	linux-nvme, linux-kernel

Thanks,

applied to nvme-5.19 with the small whitespace fixup.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-06-13 19:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-07 15:55 [PATCH] nvme: add device name to warning in uuid_show() Thomas Weißschuh
2022-06-07 16:11 ` Keith Busch
2022-06-07 22:55   ` Thomas Weißschuh
2022-06-13 17:58 ` Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.