Skip to content

Commit

Permalink
lib: scsi: do not set IMMED bit of SYNCHRONIZE CACHE command
Browse files Browse the repository at this point in the history
Current scsi backend implementation sets IMMED bit of SYNCHRONIZE CACHE
command. Then zbc_flush() call does not wait for cache synchronization
completion on drives and has risk of data loss. To avoid the risk, do
not set the bit. This change also avoids failure which happens when the
drives do not support the bit.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
  • Loading branch information
kawasaki authored and Damien Le Moal committed Nov 7, 2022
1 parent 23cb37b commit 6de6869
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/zbc_scsi.c
Expand Up @@ -991,9 +991,8 @@ int zbc_scsi_flush(struct zbc_device *dev)
if (ret != 0)
return ret;

/* Fill command CDB (immediate flush) */
/* Fill command CDB */
cmd.cdb[0] = ZBC_SG_SYNC_CACHE_CDB_OPCODE;
cmd.cdb[1] = 0x02;
zbc_sg_set_int64(&cmd.cdb[2], 0);
zbc_sg_set_int32(&cmd.cdb[10], 0);

Expand Down

0 comments on commit 6de6869

Please sign in to comment.