[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241204154344.3034362-2-john.g.garry@oracle.com>
Date: Wed, 4 Dec 2024 15:43:41 +0000
From: John Garry <john.g.garry@...cle.com>
To: brauner@...nel.org, djwong@...nel.org, cem@...nel.org, dchinner@...hat.com,
hch@....de, ritesh.list@...il.com
Cc: linux-xfs@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org, martin.petersen@...cle.com,
John Garry <john.g.garry@...cle.com>
Subject: [PATCH 1/4] iomap: Lift blocksize restriction on atomic writes
From: "Ritesh Harjani (IBM)" <ritesh.list@...il.com>
Filesystems like ext4 can submit writes in multiples of blocksizes.
But we still can't allow the writes to be split into multiple BIOs. Hence
let's check if the iomap_length() is same as iter->len or not.
It is the responsibility of userspace to ensure that a write does not span
mixed unwritten and mapped extents (which would lead to multiple BIOs).
Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@...il.com>
jpg: tweak commit message
Signed-off-by: John Garry <john.g.garry@...cle.com>
---
fs/iomap/direct-io.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/iomap/direct-io.c b/fs/iomap/direct-io.c
index b521eb15759e..3dd883dd77d2 100644
--- a/fs/iomap/direct-io.c
+++ b/fs/iomap/direct-io.c
@@ -306,7 +306,7 @@ static loff_t iomap_dio_bio_iter(const struct iomap_iter *iter,
size_t copied = 0;
size_t orig_count;
- if (atomic && length != fs_block_size)
+ if (atomic && length != iter->len)
return -EINVAL;
if ((pos | length) & (bdev_logical_block_size(iomap->bdev) - 1) ||
--
2.31.1
Powered by blists - more mailing lists