Linux-SCSI Archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: sd: Only print updates to permanent stream count
@ 2024-04-12  9:44 John Garry
  2024-04-12 22:41 ` Bart Van Assche
  2024-04-25  1:56 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: John Garry @ 2024-04-12  9:44 UTC (permalink / raw
  To: jejb, martin.petersen; +Cc: bvanassche, linux-scsi, linux-kernel, John Garry

Just rescanning a partition causes a print similar to the following to
appear:
[    1.484964] sd 0:0:0:0: [sda] permanent stream count = 5

This is bothersome, so only print this message for an update.

Fixes: 4f53138fffc2b ("scsi: sd: Translate data lifetime information")
Signed-off-by: John Garry <john.g.garry@oracle.com>

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 58fdf679341d..65cdc8b77e35 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -3120,6 +3120,7 @@ static void sd_read_io_hints(struct scsi_disk *sdkp, unsigned char *buffer)
 {
 	struct scsi_device *sdp = sdkp->device;
 	const struct scsi_io_group_descriptor *desc, *start, *end;
+	u16 permanent_stream_count_old;
 	struct scsi_sense_hdr sshdr;
 	struct scsi_mode_data data;
 	int res;
@@ -3140,12 +3141,13 @@ static void sd_read_io_hints(struct scsi_disk *sdkp, unsigned char *buffer)
 	for (desc = start; desc < end; desc++)
 		if (!desc->st_enble || !sd_is_perm_stream(sdkp, desc - start))
 			break;
+	permanent_stream_count_old = sdkp->permanent_stream_count;
 	sdkp->permanent_stream_count = desc - start;
 	if (sdkp->rscs && sdkp->permanent_stream_count < 2)
 		sd_printk(KERN_INFO, sdkp,
 			  "Unexpected: RSCS has been set and the permanent stream count is %u\n",
 			  sdkp->permanent_stream_count);
-	else if (sdkp->permanent_stream_count)
+	else if (sdkp->permanent_stream_count != permanent_stream_count_old)
 		sd_printk(KERN_INFO, sdkp, "permanent stream count = %d\n",
 			  sdkp->permanent_stream_count);
 }
-- 
2.31.1


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

* Re: [PATCH] scsi: sd: Only print updates to permanent stream count
  2024-04-12  9:44 [PATCH] scsi: sd: Only print updates to permanent stream count John Garry
@ 2024-04-12 22:41 ` Bart Van Assche
  2024-04-25  1:56 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Bart Van Assche @ 2024-04-12 22:41 UTC (permalink / raw
  To: John Garry, jejb, martin.petersen; +Cc: linux-scsi, linux-kernel

On 4/12/24 2:44 AM, John Garry wrote:
> Just rescanning a partition causes a print similar to the following to
> appear:
> [    1.484964] sd 0:0:0:0: [sda] permanent stream count = 5
> 
> This is bothersome, so only print this message for an update.

Reviewed-by: Bart Van Assche <bvanassche@acm.org>

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

* Re: [PATCH] scsi: sd: Only print updates to permanent stream count
  2024-04-12  9:44 [PATCH] scsi: sd: Only print updates to permanent stream count John Garry
  2024-04-12 22:41 ` Bart Van Assche
@ 2024-04-25  1:56 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2024-04-25  1:56 UTC (permalink / raw
  To: jejb, John Garry
  Cc: Martin K . Petersen, bvanassche, linux-scsi, linux-kernel

On Fri, 12 Apr 2024 09:44:07 +0000, John Garry wrote:

> Just rescanning a partition causes a print similar to the following to
> appear:
> [    1.484964] sd 0:0:0:0: [sda] permanent stream count = 5
> 
> This is bothersome, so only print this message for an update.
> 
> 
> [...]

Applied to 6.9/scsi-fixes, thanks!

[1/1] scsi: sd: Only print updates to permanent stream count
      https://git.kernel.org/mkp/scsi/c/961990efc608

-- 
Martin K. Petersen	Oracle Linux Engineering

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

end of thread, other threads:[~2024-04-25  1:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-12  9:44 [PATCH] scsi: sd: Only print updates to permanent stream count John Garry
2024-04-12 22:41 ` Bart Van Assche
2024-04-25  1:56 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).