summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@hammerspace.com>2019-08-14 15:42:43 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-09-21 07:18:31 +0200
commitb8438c08476c2cecde71c4501cb3ad01801f9e22 (patch)
tree015f5a3c6410a248187fdb7684ad76609ea38b64 /fs
parent518c9d0158e06324f51845faccf58073f79be926 (diff)
downloadlinux-stable-b8438c08476c2cecde71c4501cb3ad01801f9e22.tar.gz
linux-stable-b8438c08476c2cecde71c4501cb3ad01801f9e22.tar.bz2
linux-stable-b8438c08476c2cecde71c4501cb3ad01801f9e22.zip
NFS: On fatal writeback errors, we need to call nfs_inode_remove_request()
[ Upstream commit 06c9fdf3b9f1acc6e53753c99c54c39764cc979f ] If the writeback error is fatal, we need to remove the tracking structures (i.e. the nfs_page) from the inode. Fixes: 6fbda89b257f ("NFS: Replace custom error reporting mechanism...") Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/write.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 059a7c38bc4f..bf3a3f5e1884 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -57,6 +57,7 @@ static const struct rpc_call_ops nfs_commit_ops;
static const struct nfs_pgio_completion_ops nfs_async_write_completion_ops;
static const struct nfs_commit_completion_ops nfs_commit_completion_ops;
static const struct nfs_rw_ops nfs_rw_write_ops;
+static void nfs_inode_remove_request(struct nfs_page *req);
static void nfs_clear_request_commit(struct nfs_page *req);
static void nfs_init_cinfo_from_inode(struct nfs_commit_info *cinfo,
struct inode *inode);
@@ -591,7 +592,9 @@ release_request:
static void nfs_write_error(struct nfs_page *req, int error)
{
+ nfs_set_pageerror(page_file_mapping(req->wb_page));
nfs_mapping_set_error(req->wb_page, error);
+ nfs_inode_remove_request(req);
nfs_end_page_writeback(req);
nfs_release_request(req);
}