Skip to content

Commit 786e308

Browse files
riteshharjanibrauner
authored andcommitted
iomap: Lift blocksize restriction on atomic writes
Filesystems like ext4 can submit writes in multiples of blocksizes. But we still can't allow the writes to be split. Hence let's check if the iomap_length() is same as iter->len or not. It is the role of the FS to ensure that a single mapping may be created for an atomic write. The FS will also continue to check size and alignment legality. Signed-off-by: "Ritesh Harjani (IBM)" <ritesh.list@gmail.com> jpg: Tweak commit message Reviewed-by: "Darrick J. Wong" <djwong@kernel.org> Signed-off-by: John Garry <john.g.garry@oracle.com> Link: https://lore.kernel.org/r/20250303171120.2837067-7-john.g.garry@oracle.com Signed-off-by: Christian Brauner <brauner@kernel.org>
1 parent 794ca29 commit 786e308

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/iomap/direct-io.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ static int iomap_dio_bio_iter(struct iomap_iter *iter, struct iomap_dio *dio)
351351
u64 copied = 0;
352352
size_t orig_count;
353353

354-
if (atomic_hw && length != fs_block_size)
354+
if (atomic_hw && length != iter->len)
355355
return -EINVAL;
356356

357357
if ((pos | length) & (bdev_logical_block_size(iomap->bdev) - 1) ||

0 commit comments

Comments
 (0)