diff options
author | Christoph Hellwig <hch@lst.de> | 2014-08-21 12:09:21 -0400 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2014-09-10 15:47:01 -0400 |
commit | defb8460881cbf0a5890bc7a63b42c0cfbed721d (patch) | |
tree | 4cb3d9ddae0a6b0c53e97e1380543dc9926e6106 | |
parent | 362f74745c15fb9acad577ab8e1342ee5313a2a5 (diff) |
pnfs: retry after a bad stateid error from layoutget
Currently we fall through to nfs4_async_handle_error when we get
a bad stateid error back from layoutget. nfs4_async_handle_error
with a NULL state argument will never retry the operations but return
the error to higher layer, causing an avoiable fallback to MDS I/O.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
-rw-r--r-- | fs/nfs/nfs4proc.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 18eb31c1ea0b..47fa67a3a8cf 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -7577,11 +7577,16 @@ static void nfs4_layoutget_done(struct rpc_task *task, void *calldata) | |||
7577 | } else { | 7577 | } else { |
7578 | LIST_HEAD(head); | 7578 | LIST_HEAD(head); |
7579 | 7579 | ||
7580 | /* | ||
7581 | * Mark the bad layout state as invalid, then retry | ||
7582 | * with the current stateid. | ||
7583 | */ | ||
7580 | pnfs_mark_matching_lsegs_invalid(lo, &head, NULL); | 7584 | pnfs_mark_matching_lsegs_invalid(lo, &head, NULL); |
7581 | spin_unlock(&inode->i_lock); | 7585 | spin_unlock(&inode->i_lock); |
7582 | /* Mark the bad layout state as invalid, then | ||
7583 | * retry using the open stateid. */ | ||
7584 | pnfs_free_lseg_list(&head); | 7586 | pnfs_free_lseg_list(&head); |
7587 | |||
7588 | task->tk_status = 0; | ||
7589 | rpc_restart_call_prepare(task); | ||
7585 | } | 7590 | } |
7586 | } | 7591 | } |
7587 | if (nfs4_async_handle_error(task, server, state) == -EAGAIN) | 7592 | if (nfs4_async_handle_error(task, server, state) == -EAGAIN) |