Skip to content

nfs/localio: fixes for recent misaligned DIO changes

Mike Snitzer linux-nfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3nfs/localio: remove unecessary ENOTBLK handling in DIO WRITE supportfs/nfs/localio.c+3 -100 replies
2/3nfs/localio: add refcounting for each iocb IO associated with NFS pgio headerfs/nfs/localio.c+69 -453 replies
3/3nfs/localio: backfill missing partial read support for misaligned DIOfs/nfs/localio.c+20 -40 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [v6.18-rcX PATCH 0/3] nfs/localio: fixes for recent misaligned DIO changes

Hi,

These changes are needed to fix v6.18-rc1 commit c817248fc831 ("nfs/localio: add proper O_DIRECT support for READ and WRITE").

This patchset fixes the KASAN use-after-free bug that was reported here:
https://lore.kernel.org/linux-nfs/[email protected]/

I still contend there wasn't an actual problem but these changes bring more control to the misaligned DIO IO completion by marshalling it through the use of a refcount.

With the additional minimal memory barriers associated with atomic_t methods the KASAN splat no longer occurs.

Also, removed "dead code" to handle ENOTBLK that shouldn't ever be seen by NFS, and backfill misaligned DIO short read support.

Thanks,
Mike

Mike Snitzer (3):
nfs/localio: remove unecessary ENOTBLK handling in DIO WRITE support nfs/localio: add refcounting for each iocb IO associated with NFS pgio header nfs/localio: backfill missing partial read support for misaligned DIO

 fs/nfs/localio.c | 149 +++++++++++++++++++++++++++++------------------
 1 file changed, 91 insertions(+), 58 deletions(-)
Signature · 1 line
2.44.0