Re: [PATCH v2 02/11] nfsd: take freeze protection before updating delegation timestamps
From: Chuck Lever
Date: Mon Nov 23 2026 - 12:46:46 EST
On Mon, Nov 23, 2026, Jeff Layton wrote:
> + /*
> + * This function also runs from the laundromat and from NFSD
> + * shutdown. Neither path may wait for a frozen filesystem to
> + * thaw, so leave the times alone while the filesystem is frozen.
> + */
> + if (!file_start_write_trylock(f)) {
> + nfsd_cmtime_notice(file_inode(f), -EBUSY);
> + return;
> + }
DELEGRETURN reaches this trylock too, through destroy_delegation().
FMODE_NOCMTIME is already clear by then, so nothing sets mtime and
ctime afterward. A client that writes under a WRITE_ATTRS_DELEG and
returns it without a SETATTR of the delegated times, while the
filesystem is frozen, leaves the file with its pre-delegation times
after the thaw.
The laundromat and shutdown can't wait, but DELEGRETURN runs in an
nfsd thread, and the WRITEs that dirtied the file already block in
file_start_write(). Can DELEGRETURN wait for the thaw as well, or
might it be OK to return NFS4ERR_DELAY in this case?
--
Chuck Lever