diff options
author | Chuck Lever | 2023-03-06 10:43:47 -0500 |
---|---|---|
committer | Greg Kroah-Hartman | 2023-03-17 08:50:27 +0100 |
commit | ad7760898469e0301ad98c22140cb637cb6a929b (patch) | |
tree | 66c1a1a1c5044d39b04e8fd215f47d0945b83919 /fs/nfsd | |
parent | e5febcfbae9396fb3f064a2a14368c3d77d73ad4 (diff) |
NFSD: Protect against filesystem freezing
[ Upstream commit fd9a2e1d513823e840960cb3bc26d8b7749d4ac2 ]
Flole observes this WARNING on occasion:
[1210423.486503] WARNING: CPU: 8 PID: 1524732 at fs/ext4/ext4_jbd2.c:75 ext4_journal_check_start+0x68/0xb0
Reported-by: <flole@flole.de>
Suggested-by: Jan Kara <jack@suse.cz>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=217123
Fixes: 73da852e3831 ("nfsd: use vfs_iter_read/write")
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/vfs.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index 0d49c6bb22eb..59f9a8cee012 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c @@ -1037,7 +1037,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); |