projects
/
linux-2.6-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3dae8e5
)
block: Error an attempt to split an atomic write in bio_split()
for-6.13/block-atomic
author
John Garry
<john.g.garry@oracle.com>
Thu, 31 Oct 2024 09:59:14 +0000
(09:59 +0000)
committer
Jens Axboe
<axboe@kernel.dk>
Thu, 7 Nov 2024 18:25:28 +0000
(11:25 -0700)
This is disallowed.
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: John Garry <john.g.garry@oracle.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Link:
https://lore.kernel.org/r/20241031095918.99964-3-john.g.garry@oracle.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/bio.c
patch
|
blob
|
blame
|
history
diff --git
a/block/bio.c
b/block/bio.c
index 584cec38aacc4f1df9fe90adf27d258478dceee5..e41585d049a8f3241e5cc8f0288dd26db8cfc3cb 100644
(file)
--- a/
block/bio.c
+++ b/
block/bio.c
@@
-1737,6
+1737,10
@@
struct bio *bio_split(struct bio *bio, int sectors,
if (WARN_ON_ONCE(bio_op(bio) == REQ_OP_ZONE_APPEND))
return ERR_PTR(-EINVAL);
+ /* atomic writes cannot be split */
+ if (bio->bi_opf & REQ_ATOMIC)
+ return ERR_PTR(-EINVAL);
+
split = bio_alloc_clone(bio->bi_bdev, bio, gfp, bs);
if (!split)
return ERR_PTR(-ENOMEM);