From: John Garry <john.g.garry@oracle.com>
To: axboe@kernel.dk, James.Bottomley@HansenPartnership.com,
martin.petersen@oracle.com
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-scsi@vger.kernel.org, John Garry <john.g.garry@oracle.com>
Subject: [PATCH 1/2] scsi: sd: Don't check if a write for REQ_ATOMIC
Date: Mon, 5 Aug 2024 11:33:14 +0000 [thread overview]
Message-ID: <20240805113315.1048591-2-john.g.garry@oracle.com> (raw)
In-Reply-To: <20240805113315.1048591-1-john.g.garry@oracle.com>
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@oracle.com>
---
drivers/scsi/sd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 8bb3a3611851..2ab47fb50c75 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);
--
2.31.1
next prev parent reply other threads:[~2024-08-05 11:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-05 11:33 [PATCH 0/2] block atomic writes tidy-ups/fix John Garry
2024-08-05 11:33 ` John Garry [this message]
2024-08-06 12:12 ` [PATCH 1/2] scsi: sd: Don't check if a write for REQ_ATOMIC Kanchan Joshi
2024-08-05 11:33 ` [PATCH 2/2] block: Don't check REQ_ATOMIC for reads John Garry
2024-08-06 12:10 ` Kanchan Joshi
2024-08-12 22:03 ` [PATCH 0/2] block atomic writes tidy-ups/fix Martin K. Petersen
2024-08-17 1:35 ` Martin K. Petersen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240805113315.1048591-2-john.g.garry@oracle.com \
--to=john.g.garry@oracle.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®