scsi: scsi_debug: Make the READ CAPACITY response compliant with ZBC
[sfrench/cifs-2.6.git] / drivers / scsi / scsi_debug.c
index 697fc57bc711fb0e8492234c5cf65ac90d80b9c9..629853662b820f6e271e435517bde3f908dbf715 100644 (file)
@@ -1899,6 +1899,13 @@ static int resp_readcap16(struct scsi_cmnd *scp,
                        arr[14] |= 0x40;
        }
 
+       /*
+        * Since the scsi_debug READ CAPACITY implementation always reports the
+        * total disk capacity, set RC BASIS = 1 for host-managed ZBC devices.
+        */
+       if (devip->zmodel == BLK_ZONED_HM)
+               arr[12] |= 1 << 4;
+
        arr[15] = sdebug_lowest_aligned & 0xff;
 
        if (have_dif_prot) {