Commit 961990ef authored by John Garry's avatar John Garry Committed by Martin K. Petersen

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: 4f53138f ("scsi: sd: Translate data lifetime information")
Signed-off-by: default avatarJohn Garry <john.g.garry@oracle.com>
Link: https://lore.kernel.org/r/20240412094407.496251-1-john.g.garry@oracle.comReviewed-by: default avatarBart Van Assche <bvanassche@acm.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent ca91259b
...@@ -3120,6 +3120,7 @@ static void sd_read_io_hints(struct scsi_disk *sdkp, unsigned char *buffer) ...@@ -3120,6 +3120,7 @@ static void sd_read_io_hints(struct scsi_disk *sdkp, unsigned char *buffer)
{ {
struct scsi_device *sdp = sdkp->device; struct scsi_device *sdp = sdkp->device;
const struct scsi_io_group_descriptor *desc, *start, *end; const struct scsi_io_group_descriptor *desc, *start, *end;
u16 permanent_stream_count_old;
struct scsi_sense_hdr sshdr; struct scsi_sense_hdr sshdr;
struct scsi_mode_data data; struct scsi_mode_data data;
int res; int res;
...@@ -3140,12 +3141,13 @@ static void sd_read_io_hints(struct scsi_disk *sdkp, unsigned char *buffer) ...@@ -3140,12 +3141,13 @@ static void sd_read_io_hints(struct scsi_disk *sdkp, unsigned char *buffer)
for (desc = start; desc < end; desc++) for (desc = start; desc < end; desc++)
if (!desc->st_enble || !sd_is_perm_stream(sdkp, desc - start)) if (!desc->st_enble || !sd_is_perm_stream(sdkp, desc - start))
break; break;
permanent_stream_count_old = sdkp->permanent_stream_count;
sdkp->permanent_stream_count = desc - start; sdkp->permanent_stream_count = desc - start;
if (sdkp->rscs && sdkp->permanent_stream_count < 2) if (sdkp->rscs && sdkp->permanent_stream_count < 2)
sd_printk(KERN_INFO, sdkp, sd_printk(KERN_INFO, sdkp,
"Unexpected: RSCS has been set and the permanent stream count is %u\n", "Unexpected: RSCS has been set and the permanent stream count is %u\n",
sdkp->permanent_stream_count); 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", sd_printk(KERN_INFO, sdkp, "permanent stream count = %d\n",
sdkp->permanent_stream_count); sdkp->permanent_stream_count);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment