Commit 41b0a87b authored by Olga Kornievskaia's avatar Olga Kornievskaia Committed by Chuck Lever
Browse files

NFSD: fix setting FMODE_NOCMTIME in nfs4_open_delegation



fstests generic/215 and generic/407 were failing because the server
wasn't updating mtime properly. When deleg attribute support is not
compiled in and thus no attribute delegation was given, the server
was skipping updating mtime and ctime because FMODE_NOCMTIME was
uncoditionally set for the write delegation.

Fixes: e5e9b24a ("nfsd: freeze c/mtime updates with outstanding WRITE_ATTRS delegation")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarOlga Kornievskaia <okorniev@redhat.com>
Reviewed-by: default avatarJeff Layton <jlayton@kernel.org>
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
parent ae78eb49
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -6353,6 +6353,7 @@ nfs4_open_delegation(struct svc_rqst *rqstp, struct nfsd4_open *open,
		dp->dl_ctime = stat.ctime;
		dp->dl_mtime = stat.mtime;
		spin_lock(&f->f_lock);
		if (deleg_ts)
			f->f_mode |= FMODE_NOCMTIME;
		spin_unlock(&f->f_lock);
		trace_nfsd_deleg_write(&dp->dl_stid.sc_stateid);