Skip to contentSkip to conversation

scsi: scsi_debug: Reduce DEF_ATOMIC_WR_MAX_LENGTH

PATCH Applied John Garry 3 participants 4 messages May 1, 2025 – May 6, 2025 SCSI

lore
Share & tools
lore

John Garry

author
#0 lore raw

PATCH 1/1 scsi: scsi_debug: Reduce DEF_ATOMIC_WR_MAX_LENGTH

The default atomic write max length in DEF_ATOMIC_WR_MAX_LENGTH is excessively large.

For 512B LBS, we would get a 4MB max, but due to block layer atomic write restrictions this is limited to 512KB.

Reduce DEF_ATOMIC_WR_MAX_LENGTH to a value which would be more realistic (for a real device supporting atomic writes), 64KB.

drivers/scsi/scsi_debug.c +1 -1
index 241a76761db8..160b7488baf1 100644
@@ -163,7 +163,7 @@ static const char *sdebug_version_date = "20210520";
 #define DEF_VPD_USE_HOSTNO 1
 #define DEF_WRITESAME_LENGTH 0xFFFF
 #define DEF_ATOMIC_WR 1
-#define DEF_ATOMIC_WR_MAX_LENGTH 8192
+#define DEF_ATOMIC_WR_MAX_LENGTH 128
 #define DEF_ATOMIC_WR_ALIGN 2
 #define DEF_ATOMIC_WR_GRAN 2
 #define DEF_ATOMIC_WR_MAX_LENGTH_BNDRY (DEF_ATOMIC_WR_MAX_LENGTH)
Signature · 1 line
2.31.1
#1 lore raw

drivers/scsi/scsi_debug.c static const char *sdebug_version_date = "20210520"; · line 166

Quoted 2 lines · John Garry
drivers/scsi/scsi_debug.c +1 -1
-#define DEF_ATOMIC_WR_MAX_LENGTH 8192
+#define DEF_ATOMIC_WR_MAX_LENGTH 128

Shouldn't a comment be added next to this constant that mentions the unit of this constant?

Bart.

author
#2 lore raw
Quoted 7 lines · Bart Van Assche

drivers/scsi/scsi_debug.c static const char *sdebug_version_date = "20210520"; · line 166

Quoted 2 lines · John Garry
drivers/scsi/scsi_debug.c +1 -1
-#define DEF_ATOMIC_WR_MAX_LENGTH 8192
+#define DEF_ATOMIC_WR_MAX_LENGTH 128

Shouldn't a comment be added next to this constant that mentions the unit of this constant?

It is implied that all these values which correspond to VPD page parameters are in logical blocks.

#3 lore raw
In reply to John Garry

John,

Quoted 2 lines

The default atomic write max length in DEF_ATOMIC_WR_MAX_LENGTH is excessively large.

Applied to 6.16/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen