diff options
author | Trond Myklebust <trondmy@gmail.com> | 2019-04-07 13:59:08 -0400 |
---|---|---|
committer | Anna Schumaker <Anna.Schumaker@Netapp.com> | 2019-04-25 14:18:14 -0400 |
commit | 33344e0f7eaa2efbf9fcc55557d02e8603aa7012 (patch) | |
tree | d4d349e0fd2dfca232c8fc02b6d47ca1ac626caf /fs/nfs/direct.c | |
parent | 28b1d3f5a772b705ca76df620eb9f686aa2d0b4c (diff) |
pNFS: Add tracking to limit the number of pNFS retries
When the client is reading or writing using pNFS, and hits an error
on the DS, then it typically sends a LAYOUTERROR and/or LAYOUTRETURN
to the MDS, before redirtying the failed pages, and going for a new
round of reads/writebacks. The problem is that if the server has no
way to fix the DS, then we may need a way to interrupt this loop
after a set number of attempts have been made.
This patch adds an optional module parameter that allows the admin
to specify how many times to retry the read/writeback process before
failing with a fatal error.
The default behaviour is to retry forever.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'fs/nfs/direct.c')
-rw-r--r-- | fs/nfs/direct.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index 2d301a1a73e2..2436bd92bc00 100644 --- a/fs/nfs/direct.c +++ b/fs/nfs/direct.c | |||
@@ -663,6 +663,8 @@ static void nfs_direct_write_reschedule(struct nfs_direct_req *dreq) | |||
663 | } | 663 | } |
664 | 664 | ||
665 | list_for_each_entry_safe(req, tmp, &reqs, wb_list) { | 665 | list_for_each_entry_safe(req, tmp, &reqs, wb_list) { |
666 | /* Bump the transmission count */ | ||
667 | req->wb_nio++; | ||
666 | if (!nfs_pageio_add_request(&desc, req)) { | 668 | if (!nfs_pageio_add_request(&desc, req)) { |
667 | nfs_list_move_request(req, &failed); | 669 | nfs_list_move_request(req, &failed); |
668 | spin_lock(&cinfo.inode->i_lock); | 670 | spin_lock(&cinfo.inode->i_lock); |
@@ -703,6 +705,11 @@ static void nfs_direct_commit_complete(struct nfs_commit_data *data) | |||
703 | req = nfs_list_entry(data->pages.next); | 705 | req = nfs_list_entry(data->pages.next); |
704 | nfs_list_remove_request(req); | 706 | nfs_list_remove_request(req); |
705 | if (dreq->flags == NFS_ODIRECT_RESCHED_WRITES) { | 707 | if (dreq->flags == NFS_ODIRECT_RESCHED_WRITES) { |
708 | /* | ||
709 | * Despite the reboot, the write was successful, | ||
710 | * so reset wb_nio. | ||
711 | */ | ||
712 | req->wb_nio = 0; | ||
706 | /* Note the rewrite will go through mds */ | 713 | /* Note the rewrite will go through mds */ |
707 | nfs_mark_request_commit(req, NULL, &cinfo, 0); | 714 | nfs_mark_request_commit(req, NULL, &cinfo, 0); |
708 | } else | 715 | } else |