Skip to content

Commit

Permalink
NFSD: Protect against filesystem freezing
Browse files Browse the repository at this point in the history
[ Upstream commit fd9a2e1 ]

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: <[email protected]>
Suggested-by: Jan Kara <[email protected]>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=217123
Fixes: 73da852 ("nfsd: use vfs_iter_read/write")
Reviewed-by: Jeff Layton <[email protected]>
Reviewed-by: Jan Kara <[email protected]>
Signed-off-by: Chuck Lever <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
chucklever authored and gregkh committed Jun 21, 2024
1 parent 37cd49f commit b0f3373
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/nfsd/vfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1117,7 +1117,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);
Expand Down

0 comments on commit b0f3373

Please sign in to comment.