NFS: Protect against 'eof page pollution'
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Thu, 4 Sep 2025 22:46:16 +0000 (18:46 -0400)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Sat, 6 Sep 2025 20:51:25 +0000 (16:51 -0400)
commitb1817b18ff20e69f5accdccefaf78bf5454bede2
treee8c069713274b6a181e5377e77563b0481d12054
parent5a46d2339a5ae268ede53a221f20433d8ea4f2f9
NFS: Protect against 'eof page pollution'

This commit fixes the failing xfstest 'generic/363'.

When the user mmaps() an area that extends beyond the end of file, and
proceeds to write data into the folio that straddles that eof, we're
required to discard that folio data if the user calls some function that
extends the file length.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/file.c
fs/nfs/inode.c
fs/nfs/internal.h
fs/nfs/nfs42proc.c
fs/nfs/nfstrace.h