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 2/2] block: Don't check REQ_ATOMIC for reads
Date: Mon, 5 Aug 2024 11:33:15 +0000 [thread overview]
Message-ID: <20240805113315.1048591-3-john.g.garry@oracle.com> (raw)
In-Reply-To: <20240805113315.1048591-1-john.g.garry@oracle.com>
We check in submit_bio_noacct() if flag REQ_ATOMIC is set for both read and
write operations, and then validate the atomic operation if set. Flag
REQ_ATOMIC can only be set for writes, so don't bother checking for reads.
Fixes: 9da3d1e912f3 ("block: Add core atomic write support")
Signed-off-by: John Garry <john.g.garry@oracle.com>
---
block/blk-core.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/block/blk-core.c b/block/blk-core.c
index 1217c2cd66dd..bc5e8c5eaac9 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -799,6 +799,7 @@ void submit_bio_noacct(struct bio *bio)
switch (bio_op(bio)) {
case REQ_OP_READ:
+ break;
case REQ_OP_WRITE:
if (bio->bi_opf & REQ_ATOMIC) {
status = blk_validate_atomic_write_op_size(q, bio);
--
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 ` [PATCH 1/2] scsi: sd: Don't check if a write for REQ_ATOMIC John Garry
2024-08-06 12:12 ` Kanchan Joshi
2024-08-05 11:33 ` John Garry [this message]
2024-08-06 12:10 ` [PATCH 2/2] block: Don't check REQ_ATOMIC for reads 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-3-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®