Skip to content

Commit 0c150b3

Browse files
johnpgarrymartinkpetersen
authored andcommitted
scsi: sd: Don't check if a write for REQ_ATOMIC
Flag REQ_ATOMIC can only be set for writes, so don't check if the operation is also a write in sd_setup_read_write_cmnd(). Fixes: bf4ae8f ("scsi: sd: Atomic write support") Signed-off-by: John Garry <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Kanchan Joshi <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 5f36bd8 commit 0c150b3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/scsi/sd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1382,7 +1382,7 @@ static blk_status_t sd_setup_read_write_cmnd(struct scsi_cmnd *cmd)
13821382
if (protect && sdkp->protection_type == T10_PI_TYPE2_PROTECTION) {
13831383
ret = sd_setup_rw32_cmnd(cmd, write, lba, nr_blocks,
13841384
protect | fua, dld);
1385-
} else if (rq->cmd_flags & REQ_ATOMIC && write) {
1385+
} else if (rq->cmd_flags & REQ_ATOMIC) {
13861386
ret = sd_setup_atomic_cmnd(cmd, lba, nr_blocks,
13871387
sdkp->use_atomic_write_boundary,
13881388
protect | fua);

0 commit comments

Comments
 (0)