This is a note to let you know that I've just added the patch titled scsi: sd: Don't check if a write for REQ_ATOMIC to the 6.11-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: scsi-sd-don-t-check-if-a-write-for-req_atomic.patch and it can be found in the queue-6.11 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit e44db0030bab4096ae518492c528f229bdc546c1 Author: John Garry <john.g.garry@xxxxxxxxxx> Date: Mon Aug 5 11:33:14 2024 +0000 scsi: sd: Don't check if a write for REQ_ATOMIC [ Upstream commit 0c150b30d3d51a8c2e09fadd004a640fa12985c6 ] 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: bf4ae8f2e640 ("scsi: sd: Atomic write support") Signed-off-by: John Garry <john.g.garry@xxxxxxxxxx> Link: https://lore.kernel.org/r/20240805113315.1048591-2-john.g.garry@xxxxxxxxxx Reviewed-by: Kanchan Joshi <joshi.k@xxxxxxxxxxx> Signed-off-by: Martin K. Petersen <martin.petersen@xxxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 9db86943d04cf..76f488ef6a7ee 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -1382,7 +1382,7 @@ static blk_status_t sd_setup_read_write_cmnd(struct scsi_cmnd *cmd) if (protect && sdkp->protection_type == T10_PI_TYPE2_PROTECTION) { ret = sd_setup_rw32_cmnd(cmd, write, lba, nr_blocks, protect | fua, dld); - } else if (rq->cmd_flags & REQ_ATOMIC && write) { + } else if (rq->cmd_flags & REQ_ATOMIC) { ret = sd_setup_atomic_cmnd(cmd, lba, nr_blocks, sdkp->use_atomic_write_boundary, protect | fua);