From: Trond Myklebust Date: Sat, 14 May 2022 14:27:03 +0000 (-0400) Subject: NFS: Do not report flush errors in nfs_write_end() X-Git-Tag: v5.17.14~191 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=82e42d81c3aff77b60a97074b7d39b4a75b290a6;p=thirdparty%2Fkernel%2Fstable.git NFS: Do not report flush errors in nfs_write_end() [ Upstream commit d95b26650e86175e4a97698d89bc1626cd1df0c6 ] 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: 6fbda89b257f ("NFS: Replace custom error reporting mechanism with generic one") Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker Signed-off-by: Sasha Levin --- diff --git a/fs/nfs/file.c b/fs/nfs/file.c index 7e0ce50e04f66..832a97ed2165a 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c @@ -391,11 +391,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; }