]> git.baikalelectronics.ru Git - kernel.git/commitdiff
nfsd: Update the boot verifier on stable writes too.
authorTrond Myklebust <trondmy@gmail.com>
Mon, 6 Jan 2020 18:40:31 +0000 (13:40 -0500)
committerJ. Bruce Fields <bfields@redhat.com>
Wed, 22 Jan 2020 21:25:40 +0000 (16:25 -0500)
We don't know if the error returned by the fsync() call is
exclusive to the data written by the stable write, so play it
safe.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/vfs.c

index 4652854f3dd575bb628f080a86c459bd71ad209a..0a048dfb68ec19e8249349852935f715915e6761 100644 (file)
@@ -994,8 +994,11 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct nfsd_file *nf,
                host_err = vfs_iter_write(file, &iter, &pos, flags);
                up_read(&nf->nf_rwsem);
        }
-       if (host_err < 0)
+       if (host_err < 0) {
+               nfsd_reset_boot_verifier(net_generic(SVC_NET(rqstp),
+                                        nfsd_net_id));
                goto out_nfserr;
+       }
        *cnt = host_err;
        nfsdstats.io_write += *cnt;
        fsnotify_modify(file);