diff options
| author | Ritesh Harjani (IBM) <[email protected]> | 2024-11-05 00:22:59 +0000 |
|---|---|---|
| committer | Darrick J. Wong <[email protected]> | 2024-11-06 00:20:40 +0000 |
| commit | 299537e9dfac2ecd08e7dae87a6437b92612568a (patch) | |
| tree | 9a561a97b42f4d6145037af0add3994fc45dae18 /fs/ext4/fast_commit.c | |
| parent | ext4: Support setting FMODE_CAN_ATOMIC_WRITE (diff) | |
| download | kernel-299537e9dfac2ecd08e7dae87a6437b92612568a.tar.gz kernel-299537e9dfac2ecd08e7dae87a6437b92612568a.zip | |
ext4: Do not fallback to buffered-io for DIO atomic write
atomic writes is currently only supported for single fsblock and only
for direct-io. We should not return -ENOTBLK for atomic writes since we
want the atomic write request to either complete fully or fail
otherwise. Hence, we should never fallback to buffered-io in case of
DIO atomic write requests.
Let's also catch if this ever happens by adding some WARN_ON_ONCE before
buffered-io handling for direct-io atomic writes. More details of the
discussion [1].
While at it let's add an inline helper ext4_want_directio_fallback() which
simplifies the logic checks and inherently fixes condition on when to return
-ENOTBLK which otherwise was always returning true for any write or directio in
ext4_iomap_end(). It was ok since ext4 only supports direct-io via iomap.
[1]: https://lore.kernel.org/linux-xfs/[email protected]/T/#m9dbecc11bed713ed0d7a486432c56b105b555f04
Suggested-by: Darrick J. Wong <[email protected]> # inline helper
Signed-off-by: Ritesh Harjani (IBM) <[email protected]>
Reviewed-by: Darrick J. Wong <[email protected]>
Signed-off-by: Darrick J. Wong <[email protected]>
Reviewed-by: Jan Kara <[email protected]>
Diffstat (limited to 'fs/ext4/fast_commit.c')
0 files changed, 0 insertions, 0 deletions
