diff options
| author | Mike Snitzer <[email protected]> | 2025-11-06 03:03:04 +0000 |
|---|---|---|
| committer | Anna Schumaker <[email protected]> | 2025-11-10 18:28:45 +0000 |
| commit | 6a218b9c3183ed19d5703130025282cf20463d87 (patch) | |
| tree | 194c6e73bbe6c316d918b98ed377c0df11a49f5a /lib/mpi/mpi-scan.c | |
| parent | nfs/localio: Ensure DIO WRITE's IO on stable storage upon completion (diff) | |
| download | kernel-6a218b9c3183ed19d5703130025282cf20463d87.tar.gz kernel-6a218b9c3183ed19d5703130025282cf20463d87.zip | |
nfs/localio: do not issue misaligned DIO out-of-order
From https://lore.kernel.org/linux-nfs/[email protected]/
On Wed, Oct 29, 2025 at 12:20:40AM -0700, Christoph Hellwig wrote:
> On Mon, Oct 27, 2025 at 12:18:30PM -0400, Mike Snitzer wrote:
> > LOCALIO's misaligned DIO will issue head/tail followed by O_DIRECT
> > middle (via AIO completion of that aligned middle). So out of order
> > relative to file offset.
>
> That's in general a really bad idea. It will obviously work, but
> both on SSDs and out of place write file systems it is a sure way
> to increase your garbage collection overhead a lot down the line.
Fix this by never issuing misaligned DIO out of order. This fix means
the DIO-aligned middle will only use AIO completion if there is no
misaligned end segment. Otherwise, all 3 segments of a misaligned DIO
will be issued without AIO completion to ensure file offset increases
properly for all partial READ or WRITE situations.
Factoring out nfs_local_iter_setup() helps standardize repetitive
nfs_local_iters_setup_dio() code and is inspired by cleanup work that
Chuck Lever did on the NFSD Direct code.
Fixes: c817248fc831 ("nfs/localio: add proper O_DIRECT support for READ and WRITE")
Reported-by: Christoph Hellwig <[email protected]>
Signed-off-by: Mike Snitzer <[email protected]>
Signed-off-by: Anna Schumaker <[email protected]>
Diffstat (limited to 'lib/mpi/mpi-scan.c')
0 files changed, 0 insertions, 0 deletions
