]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
scsi: block: Don't check REQ_ATOMIC for reads
authorJohn Garry <john.g.garry@oracle.com>
Mon, 5 Aug 2024 11:33:15 +0000 (11:33 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 4 Oct 2024 14:37:44 +0000 (16:37 +0200)
[ Upstream commit ea6787c695ab7595d851c3506f67c157f3b593c0 ]

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>
Link: https://lore.kernel.org/r/20240805113315.1048591-3-john.g.garry@oracle.com
Reviewed-by: Kanchan Joshi <joshi.k@samsung.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
block/blk-core.c

index 1217c2cd66dd88fc5cf53556835a9d9c5a619947..bc5e8c5eaac9ffc2ebcab5ea0f08fd9a28e6facb 100644 (file)
@@ -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);