@@ -242,6 +242,10 @@ __blkdev_direct_IO_simple(struct kiocb *iocb, struct iov_iter *iter,
task_io_account_write(ret);
}
+ /* don't merge atomic requests to avoid going over the limit */
+ if (iocb->ki_filp->f_flags & O_ATOMIC)
+ bio.bi_opf |= REQ_NOMERGE;
+
qc = submit_bio(&bio);
for (;;) {
set_current_state(TASK_UNINTERRUPTIBLE);
@@ -377,6 +381,10 @@ __blkdev_direct_IO(struct kiocb *iocb, struct iov_iter *iter, int nr_pages)
task_io_account_write(bio->bi_iter.bi_size);
}
+ /* don't merge atomic requests to avoid going over the limit */
+ if (iocb->ki_filp->f_flags & O_ATOMIC)
+ bio->bi_opf |= REQ_NOMERGE;
+
dio->size += bio->bi_iter.bi_size;
pos += bio->bi_iter.bi_size;
Signed-off-by: Christoph Hellwig <hch@lst.de> --- fs/block_dev.c | 8 ++++++++ 1 file changed, 8 insertions(+)