]> git.ipfire.org Git - thirdparty/linux.git/blobdiff - fs/nfsd/vfs.c
NFSD: Protect against filesystem freezing
[thirdparty/linux.git] / fs / nfsd / vfs.c
index 21d5209f6e041b7c1a53c776c7662c853bb54396..ba34a31a7c7027f640949294f1a405a9f765ba45 100644 (file)
@@ -1104,7 +1104,9 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct nfsd_file *nf,
        since = READ_ONCE(file->f_wb_err);
        if (verf)
                nfsd_copy_write_verifier(verf, nn);
+       file_start_write(file);
        host_err = vfs_iter_write(file, &iter, &pos, flags);
+       file_end_write(file);
        if (host_err < 0) {
                nfsd_reset_write_verifier(nn);
                trace_nfsd_writeverf_reset(nn, rqstp, host_err);