]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
nfs/localio: Ensure DIO WRITE's IO on stable storage upon completion
authorMike Snitzer <snitzer@kernel.org>
Mon, 27 Oct 2025 17:52:28 +0000 (13:52 -0400)
committerAnna Schumaker <anna.schumaker@oracle.com>
Mon, 10 Nov 2025 15:32:28 +0000 (10:32 -0500)
commitd32ddfeb559342e89a4d06b1df4e7e5e96df3762
treea1f979266c353804369af142b818445fe193c669
parentd0497dd27452c79a48414df813a16cd12d274b3b
nfs/localio: Ensure DIO WRITE's IO on stable storage upon completion

LOCALIO's misaligned DIO WRITE support requires synchronous IO for any
misaligned head and/or tail that are issued using buffered IO.  In
addition, it is important that the O_DIRECT middle be on stable
storage upon its completion via AIO.

Otherwise, a misaligned DIO WRITE could mix buffered IO for the
head/tail and direct IO for the DIO-aligned middle -- which could lead
to problems associated with deferred writes to stable storage (such as
out of order partial completions causing incorrect advancement of the
file's offset, etc).

Fixes: c817248fc831 ("nfs/localio: add proper O_DIRECT support for READ and WRITE")
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
fs/nfs/localio.c