2024-04-12 09:44:48

by John Garry

[permalink] [raw]
Subject: [PATCH] scsi: sd: Only print updates to permanent stream count

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 <[email protected]>

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



2024-04-12 22:41:56

by Bart Van Assche

[permalink] [raw]
Subject: Re: [PATCH] scsi: sd: Only print updates to permanent stream count

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 <[email protected]>

2024-04-25 01:59:25

by Martin K. Petersen

[permalink] [raw]
Subject: Re: [PATCH] scsi: sd: Only print updates to permanent stream count

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