Skip to content

Commit

Permalink
NFS: Do not report flush errors in nfs_write_end()
Browse files Browse the repository at this point in the history
[ Upstream commit d95b266 ]

If we do flush cached writebacks in nfs_write_end() due to the imminent
expiration of an RPCSEC_GSS session, then we should defer reporting any
resulting errors until the calls to file_check_and_advance_wb_err() in
nfs_file_write() and nfs_file_fsync().

Fixes: 6fbda89 ("NFS: Replace custom error reporting mechanism with generic one")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Trond Myklebust authored and gregkh committed Jun 9, 2022
1 parent c5a0e59 commit 0402423
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions fs/nfs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,11 +390,8 @@ static int nfs_write_end(struct file *file, struct address_space *mapping,
return status;
NFS_I(mapping->host)->write_io += copied;

if (nfs_ctx_key_to_expire(ctx, mapping->host)) {
status = nfs_wb_all(mapping->host);
if (status < 0)
return status;
}
if (nfs_ctx_key_to_expire(ctx, mapping->host))
nfs_wb_all(mapping->host);

return copied;
}
Expand Down

0 comments on commit 0402423

Please sign in to comment.