From: Trond Myklebust <trondmy@gmail.com>
To: linux-nfs@vger.kernel.org
Subject: [PATCH 2/8] NFS: On fatal writeback errors, we need to call nfs_inode_remove_request()
Date: Sat, 17 Aug 2019 17:22:11 -0400 [thread overview]
Message-ID: <20190817212217.22766-2-trond.myklebust@hammerspace.com> (raw)
In-Reply-To: <20190817212217.22766-1-trond.myklebust@hammerspace.com>
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>
---
fs/nfs/write.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 92d9cadc6102..3399149435ce 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 @@ nfs_lock_and_join_requests(struct page *page)
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);
}
--
2.21.0
next prev parent reply other threads:[~2019-08-17 21:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-17 21:22 [PATCH 1/8] NFS: Fix initialisation of I/O result struct in nfs_pgio_rpcsetup Trond Myklebust
2019-08-17 21:22 ` Trond Myklebust [this message]
2019-08-17 21:22 ` [PATCH 3/8] NFS: Fix spurious EIO read errors Trond Myklebust
2019-08-17 21:22 ` [PATCH 4/8] SUNRPC: Don't handle errors if the bind/connect succeeded Trond Myklebust
2019-08-17 21:22 ` [PATCH 5/8] pNFS/flexfiles: Turn off soft RPC calls Trond Myklebust
2019-08-17 21:22 ` [PATCH 6/8] SUNRPC: Handle EADDRINUSE and ENOBUFS correctly Trond Myklebust
2019-08-17 21:22 ` [PATCH 7/8] Revert "NFSv4/flexfiles: Abort I/O early if the layout segment was invalidated" Trond Myklebust
2019-08-17 21:22 ` [PATCH 8/8] SUNRPC: Handle connection breakages correctly in call_status() Trond Myklebust
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190817212217.22766-2-trond.myklebust@hammerspace.com \
--to=trondmy@gmail.com \
--cc=linux-nfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).