diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2015-08-30 12:53:06 -0400 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2015-08-30 16:10:27 -0400 |
commit | 90816d1ddacfb5a8b783f67e2c1a1bc77dc50ff4 (patch) | |
tree | 6cd06c7a8c549baa0f7b7e7451046c0f6a7c3980 | |
parent | 099392048cd443349c50310f7fdc96070e40f4e7 (diff) |
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: Trond Myklebust <trond.myklebust@primarydata.com>
-rw-r--r-- | fs/nfs/flexfilelayout/flexfilelayout.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c index 4ec624cfcf8b..61ccf1122494 100644 --- a/fs/nfs/flexfilelayout/flexfilelayout.c +++ b/fs/nfs/flexfilelayout/flexfilelayout.c | |||
@@ -1075,18 +1075,26 @@ static int ff_layout_async_handle_error_v3(struct rpc_task *task, | |||
1075 | if (task->tk_status >= 0) | 1075 | if (task->tk_status >= 0) |
1076 | return 0; | 1076 | return 0; |
1077 | 1077 | ||
1078 | if (task->tk_status != -EJUKEBOX) { | 1078 | switch (task->tk_status) { |
1079 | /* File access problems. Don't mark the device as unavailable */ | ||
1080 | case -EACCES: | ||
1081 | case -ESTALE: | ||
1082 | case -EISDIR: | ||
1083 | case -EBADHANDLE: | ||
1084 | case -ELOOP: | ||
1085 | case -ENOSPC: | ||
1086 | break; | ||
1087 | case -EJUKEBOX: | ||
1088 | nfs_inc_stats(lseg->pls_layout->plh_inode, NFSIOS_DELAY); | ||
1089 | goto out_retry; | ||
1090 | default: | ||
1079 | dprintk("%s DS connection error %d\n", __func__, | 1091 | dprintk("%s DS connection error %d\n", __func__, |
1080 | task->tk_status); | 1092 | task->tk_status); |
1081 | nfs4_mark_deviceid_unavailable(devid); | 1093 | nfs4_mark_deviceid_unavailable(devid); |
1082 | if (ff_layout_has_available_ds(lseg)) | ||
1083 | return -NFS4ERR_RESET_TO_PNFS; | ||
1084 | else | ||
1085 | return -NFS4ERR_RESET_TO_MDS; | ||
1086 | } | 1094 | } |
1087 | 1095 | /* FIXME: Need to prevent infinite looping here. */ | |
1088 | if (task->tk_status == -EJUKEBOX) | 1096 | return -NFS4ERR_RESET_TO_PNFS; |
1089 | nfs_inc_stats(lseg->pls_layout->plh_inode, NFSIOS_DELAY); | 1097 | out_retry: |
1090 | task->tk_status = 0; | 1098 | task->tk_status = 0; |
1091 | rpc_restart_call(task); | 1099 | rpc_restart_call(task); |
1092 | rpc_delay(task, NFS_JUKEBOX_RETRY_TIME); | 1100 | rpc_delay(task, NFS_JUKEBOX_RETRY_TIME); |