]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
NFSD: Write verifier might go backwards
authorChuck Lever <chuck.lever@oracle.com>
Thu, 30 Dec 2021 15:26:18 +0000 (10:26 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Apr 2024 14:18:59 +0000 (16:18 +0200)
[ Upstream commit cdc556600c0133575487cc69fb3128440b3c3e92 ]

When vfs_iter_write() starts to fail because a file system is full,
a bunch of writes can fail at once with ENOSPC. These writes
repeatedly invoke nfsd_reset_boot_verifier() in quick succession.

Ensure that the time it grabs doesn't go backwards due to an ntp
adjustment going on at the same time.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/nfssvc.c

index 8554bc7ff4322cd810ec8bb0d96538b53afc0bd7..4d1d8aa6d7f9dc44f7df0727f69749ca25b48350 100644 (file)
@@ -363,7 +363,7 @@ void nfsd_copy_boot_verifier(__be32 verf[2], struct nfsd_net *nn)
 
 static void nfsd_reset_boot_verifier_locked(struct nfsd_net *nn)
 {
-       ktime_get_real_ts64(&nn->nfssvc_boot);
+       ktime_get_raw_ts64(&nn->nfssvc_boot);
 }
 
 void nfsd_reset_boot_verifier(struct nfsd_net *nn)