OSDN Git Service

scsi: scsi_debug: Zero clear zones at reset write pointer
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Mon, 22 Nov 2021 06:12:23 +0000 (15:12 +0900)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 23 Nov 2021 03:27:51 +0000 (22:27 -0500)
commit2d62253eb1b60f4ce8b39125eee282739b519297
treebd399cdabc03d93179c6db9b85e1609af76440a5
parenteb97545d6264b341b06ba7603f52ff6c0b2af6ea
scsi: scsi_debug: Zero clear zones at reset write pointer

When a reset is requested the position of the write pointer is updated but
the data in the corresponding zone is not cleared. Instead scsi_debug
returns any data written before the write pointer was reset. This is an
error and prevents using scsi_debug for stale page cache testing of the
BLKRESETZONE ioctl.

Zero written data in the zone when resetting the write pointer.

Link: https://lore.kernel.org/r/20211122061223.298890-1-shinichiro.kawasaki@wdc.com
Fixes: f0d1cf9378bd ("scsi: scsi_debug: Add ZBC zone commands")
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Acked-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/scsi_debug.c