Commit 27b26f09 authored by John Garry's avatar John Garry Committed by Jens Axboe
Browse files

block: Error an attempt to split an atomic write in bio_split()

parent e546fe1d
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1674,6 +1674,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);