diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2017-02-17 19:49:09 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-03-12 00:41:51 -0500 |
commit | c65db336d6c6f82e30e0bdb771517297db8e880e (patch) | |
tree | 0f47da63f8f515c5c2353b0ea14e57159471276e | |
parent | 77bbc0c7712a43442e2637247eaa4f01f73f0eb8 (diff) |
pNFS/flexfiles: If the layout is invalid, it must be updated before retrying
commit df3ab232e462bce20710596d697ade6b72497694 upstream.
If we see that our pNFS READ/WRITE/COMMIT operation failed, but we
also see that our layout segment is no longer valid, then we need to
get a new layout segment before retrying.
Fixes: 90816d1ddacf ("NFSv4.1/flexfiles: Don't mark the entire deviceid...")
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | fs/nfs/flexfilelayout/flexfilelayout.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c index a5c38889e7ae..13abd608af0f 100644 --- a/fs/nfs/flexfilelayout/flexfilelayout.c +++ b/fs/nfs/flexfilelayout/flexfilelayout.c | |||
@@ -1073,9 +1073,6 @@ static int ff_layout_async_handle_error_v4(struct rpc_task *task, | |||
1073 | struct nfs_client *mds_client = mds_server->nfs_client; | 1073 | struct nfs_client *mds_client = mds_server->nfs_client; |
1074 | struct nfs4_slot_table *tbl = &clp->cl_session->fc_slot_table; | 1074 | struct nfs4_slot_table *tbl = &clp->cl_session->fc_slot_table; |
1075 | 1075 | ||
1076 | if (task->tk_status >= 0) | ||
1077 | return 0; | ||
1078 | |||
1079 | switch (task->tk_status) { | 1076 | switch (task->tk_status) { |
1080 | /* MDS state errors */ | 1077 | /* MDS state errors */ |
1081 | case -NFS4ERR_DELEG_REVOKED: | 1078 | case -NFS4ERR_DELEG_REVOKED: |
@@ -1176,9 +1173,6 @@ static int ff_layout_async_handle_error_v3(struct rpc_task *task, | |||
1176 | { | 1173 | { |
1177 | struct nfs4_deviceid_node *devid = FF_LAYOUT_DEVID_NODE(lseg, idx); | 1174 | struct nfs4_deviceid_node *devid = FF_LAYOUT_DEVID_NODE(lseg, idx); |
1178 | 1175 | ||
1179 | if (task->tk_status >= 0) | ||
1180 | return 0; | ||
1181 | |||
1182 | switch (task->tk_status) { | 1176 | switch (task->tk_status) { |
1183 | /* File access problems. Don't mark the device as unavailable */ | 1177 | /* File access problems. Don't mark the device as unavailable */ |
1184 | case -EACCES: | 1178 | case -EACCES: |
@@ -1213,6 +1207,13 @@ static int ff_layout_async_handle_error(struct rpc_task *task, | |||
1213 | { | 1207 | { |
1214 | int vers = clp->cl_nfs_mod->rpc_vers->number; | 1208 | int vers = clp->cl_nfs_mod->rpc_vers->number; |
1215 | 1209 | ||
1210 | if (task->tk_status >= 0) | ||
1211 | return 0; | ||
1212 | |||
1213 | /* Handle the case of an invalid layout segment */ | ||
1214 | if (!pnfs_is_valid_lseg(lseg)) | ||
1215 | return -NFS4ERR_RESET_TO_PNFS; | ||
1216 | |||
1216 | switch (vers) { | 1217 | switch (vers) { |
1217 | case 3: | 1218 | case 3: |
1218 | return ff_layout_async_handle_error_v3(task, lseg, idx); | 1219 | return ff_layout_async_handle_error_v3(task, lseg, idx); |