diff mbox series

scsi: sd: Only print updates to permanent stream count

Message ID 20240412094407.496251-1-john.g.garry@oracle.com
State New
Headers show
Series scsi: sd: Only print updates to permanent stream count | expand

Commit Message

John Garry April 12, 2024, 9:44 a.m. UTC
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>

Comments

Martin K. Petersen April 25, 2024, 1:56 a.m. UTC | #1
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
diff mbox series

Patch

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);
 }