Commit b8946d7b authored by Trond Myklebust's avatar Trond Myklebust Committed by Anna Schumaker

NFS: Revalidate the file mapping on all fatal writeback errors

If a write or commit failed, and the mapping sees a fatal error, we
need to revalidate the contents of that mapping.

Fixes: 06c9fdf3 ("NFS: On fatal writeback errors, we need to call nfs_inode_remove_request()")
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
parent 0df68ced
...@@ -256,8 +256,11 @@ static void nfs_set_pageerror(struct address_space *mapping) ...@@ -256,8 +256,11 @@ static void nfs_set_pageerror(struct address_space *mapping)
static void nfs_mapping_set_error(struct page *page, int error) static void nfs_mapping_set_error(struct page *page, int error)
{ {
struct address_space *mapping = page_file_mapping(page);
SetPageError(page); SetPageError(page);
mapping_set_error(page_file_mapping(page), error); mapping_set_error(mapping, error);
nfs_set_pageerror(mapping);
} }
/* /*
...@@ -600,7 +603,6 @@ nfs_lock_and_join_requests(struct page *page) ...@@ -600,7 +603,6 @@ nfs_lock_and_join_requests(struct page *page)
static void nfs_write_error(struct nfs_page *req, int error) static void nfs_write_error(struct nfs_page *req, int error)
{ {
nfs_set_pageerror(page_file_mapping(req->wb_page));
trace_nfs_write_error(req, error); trace_nfs_write_error(req, error);
nfs_mapping_set_error(req->wb_page, error); nfs_mapping_set_error(req->wb_page, error);
nfs_inode_remove_request(req); nfs_inode_remove_request(req);
...@@ -1007,7 +1009,6 @@ static void nfs_write_completion(struct nfs_pgio_header *hdr) ...@@ -1007,7 +1009,6 @@ static void nfs_write_completion(struct nfs_pgio_header *hdr)
nfs_list_remove_request(req); nfs_list_remove_request(req);
if (test_bit(NFS_IOHDR_ERROR, &hdr->flags) && if (test_bit(NFS_IOHDR_ERROR, &hdr->flags) &&
(hdr->good_bytes < bytes)) { (hdr->good_bytes < bytes)) {
nfs_set_pageerror(page_file_mapping(req->wb_page));
trace_nfs_comp_error(req, hdr->error); trace_nfs_comp_error(req, hdr->error);
nfs_mapping_set_error(req->wb_page, hdr->error); nfs_mapping_set_error(req->wb_page, hdr->error);
goto remove_req; goto remove_req;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment