summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2023-03-10 17:45:30 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2023-03-10 17:45:30 +0100
commit92cadfcffac3ff2dafc892b7725d1016c8a1b6ee (patch)
tree22e2a09ec7670ca6f365c4c2e6dd731a67a05392 /fs
parentMerge tag 'for-6.3-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/... (diff)
parentSUNRPC: Fix a server shutdown leak (diff)
downloadlinux-92cadfcffac3ff2dafc892b7725d1016c8a1b6ee.tar.xz
linux-92cadfcffac3ff2dafc892b7725d1016c8a1b6ee.zip
Merge tag 'nfsd-6.3-2' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux
Pull nfsd fixes from Chuck Lever: - Protect NFSD writes against filesystem freezing - Fix a potential memory leak during server shutdown * tag 'nfsd-6.3-2' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux: SUNRPC: Fix a server shutdown leak NFSD: Protect against filesystem freezing
Diffstat (limited to 'fs')
-rw-r--r--fs/nfsd/vfs.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index e7462b5e5f1e..502e1b7742db 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -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);