[PATCH 0/2] NFSv4/pNFS: don't trust inode size from MDS while LAYOUTCOMMIT is outstanding
From: Lucheng Bao
Date: Thu Oct 08 2026 - 18:29:15 EST
When a layout requires LAYOUTCOMMIT, the size reported by the MDS may stay
stale until the commit is processed. The client already keeps i_size
from shrinking while writes are outstanding. This series extends that
protection to an outstanding LAYOUTCOMMIT.
Patch 1 rejects smaller sizes while a LAYOUTCOMMIT is pending or in
flight.
Patch 2 defers a LAYOUTRETURN whose OLD_STATEID refresh fails because a
newer segment is busy. Today that return is treated as complete and the
pending LAYOUTCOMMIT is discarded.
Without this series, a stale OPEN or CLOSE reply can lower i_size, and
the next O_APPEND write then lands at the old offset.
Lucheng Bao (2):
NFSv4/pNFS: prevent i_size regression while layoutcommit is outstanding
NFSv4/pNFS: defer LAYOUTRETURN after an unsuccessful OLD_STATEID refresh
fs/nfs/inode.c | 8 ++++++--
fs/nfs/nfs4proc.c | 3 ++-
2 files changed, 8 insertions(+), 3 deletions(-)
--
2.34.1