Skip to content

Commit 961990e

Browse files
johnpgarrymartinkpetersen
authored andcommitted
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: 4f53138 ("scsi: sd: Translate data lifetime information") Signed-off-by: John Garry <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent ca91259 commit 961990e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/scsi/sd.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3120,6 +3120,7 @@ static void sd_read_io_hints(struct scsi_disk *sdkp, unsigned char *buffer)
31203120
{
31213121
struct scsi_device *sdp = sdkp->device;
31223122
const struct scsi_io_group_descriptor *desc, *start, *end;
3123+
u16 permanent_stream_count_old;
31233124
struct scsi_sense_hdr sshdr;
31243125
struct scsi_mode_data data;
31253126
int res;
@@ -3140,12 +3141,13 @@ static void sd_read_io_hints(struct scsi_disk *sdkp, unsigned char *buffer)
31403141
for (desc = start; desc < end; desc++)
31413142
if (!desc->st_enble || !sd_is_perm_stream(sdkp, desc - start))
31423143
break;
3144+
permanent_stream_count_old = sdkp->permanent_stream_count;
31433145
sdkp->permanent_stream_count = desc - start;
31443146
if (sdkp->rscs && sdkp->permanent_stream_count < 2)
31453147
sd_printk(KERN_INFO, sdkp,
31463148
"Unexpected: RSCS has been set and the permanent stream count is %u\n",
31473149
sdkp->permanent_stream_count);
3148-
else if (sdkp->permanent_stream_count)
3150+
else if (sdkp->permanent_stream_count != permanent_stream_count_old)
31493151
sd_printk(KERN_INFO, sdkp, "permanent stream count = %d\n",
31503152
sdkp->permanent_stream_count);
31513153
}

0 commit comments

Comments
 (0)