diff mbox

[4/5] sd: Limit messages for ZBC disks capacity change

Message ID 1468934710-93876-5-git-send-email-hare@suse.de (mailing list archive)
State RFC
Headers show

Commit Message

Hannes Reinecke July 19, 2016, 1:25 p.m. UTC
From: Damien Le Moal <damien.lemoal@hgst.com>

For ZBC disks with RC_BASIS=0, limit the message indicating
the capacity adjustment to the disk first scan.

Signed-off-by: Damien Le Moal <damien.lemoal@hgst.com>
---
 drivers/scsi/sd.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index f7b6132..3a9d96e 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -2128,9 +2128,10 @@  static void sd_read_zones(struct scsi_disk *sdkp, unsigned char *buffer)
 		/* The max_lba field is the capacity of a zoned device */
 		lba = get_unaligned_be64(&buffer[8]);
 		if (lba + 1 > sdkp->capacity) {
-			sd_printk(KERN_WARNING, sdkp,
-				  "Max LBA %zu (capacity %zu)\n",
-				  (sector_t) lba + 1, sdkp->capacity);
+			if (sdkp->first_scan)
+				sd_printk(KERN_WARNING, sdkp,
+					  "Changing capacity from %zu to Max LBA+1 %zu\n",
+					  sdkp->capacity, (sector_t) lba + 1);
 			sdkp->capacity = lba + 1;
 		}
 	}