Commit 90816d1d authored by Trond Myklebust's avatar Trond Myklebust

NFSv4.1/flexfiles: Don't mark the entire deviceid as bad for file errors

If the file was fenced and/or has been deleted on the DS, then we want
to retry pNFS after a layoutreturn with error report. If the server
cannot fix the problem, then we rely on it to tell us so in the
response to the LAYOUTGET.
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
parent 09939204
...@@ -1075,18 +1075,26 @@ static int ff_layout_async_handle_error_v3(struct rpc_task *task, ...@@ -1075,18 +1075,26 @@ static int ff_layout_async_handle_error_v3(struct rpc_task *task,
if (task->tk_status >= 0) if (task->tk_status >= 0)
return 0; return 0;
if (task->tk_status != -EJUKEBOX) { switch (task->tk_status) {
/* File access problems. Don't mark the device as unavailable */
case -EACCES:
case -ESTALE:
case -EISDIR:
case -EBADHANDLE:
case -ELOOP:
case -ENOSPC:
break;
case -EJUKEBOX:
nfs_inc_stats(lseg->pls_layout->plh_inode, NFSIOS_DELAY);
goto out_retry;
default:
dprintk("%s DS connection error %d\n", __func__, dprintk("%s DS connection error %d\n", __func__,
task->tk_status); task->tk_status);
nfs4_mark_deviceid_unavailable(devid); nfs4_mark_deviceid_unavailable(devid);
if (ff_layout_has_available_ds(lseg))
return -NFS4ERR_RESET_TO_PNFS;
else
return -NFS4ERR_RESET_TO_MDS;
} }
/* FIXME: Need to prevent infinite looping here. */
if (task->tk_status == -EJUKEBOX) return -NFS4ERR_RESET_TO_PNFS;
nfs_inc_stats(lseg->pls_layout->plh_inode, NFSIOS_DELAY); out_retry:
task->tk_status = 0; task->tk_status = 0;
rpc_restart_call(task); rpc_restart_call(task);
rpc_delay(task, NFS_JUKEBOX_RETRY_TIME); rpc_delay(task, NFS_JUKEBOX_RETRY_TIME);
......
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