Commit 86eadfc2 authored by Olga Kornievskaia's avatar Olga Kornievskaia Committed by Greg Kroah-Hartman

PNFS fix EACCESS on commit to DS handling

commit a0bc01e0 upstream.

Commit fabbbee0 "PNFS fix fallback to MDS if got error on
commit to DS" moved the pnfs_set_lo_fail() to unhandled errors
which was not correct and lead to a kernel oops on umount.

Instead, fix the original EACCESS on commit to DS error by
getting the new layout and re-doing the IO.

Fixes: fabbbee0 ("PNFS fix fallback to MDS if got error on commit to DS")
Signed-off-by: default avatarOlga Kornievskaia <kolga@netapp.com>
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent be7e79fe
...@@ -172,6 +172,7 @@ static int filelayout_async_handle_error(struct rpc_task *task, ...@@ -172,6 +172,7 @@ static int filelayout_async_handle_error(struct rpc_task *task,
case -NFS4ERR_RETRY_UNCACHED_REP: case -NFS4ERR_RETRY_UNCACHED_REP:
break; break;
/* Invalidate Layout errors */ /* Invalidate Layout errors */
case -NFS4ERR_ACCESS:
case -NFS4ERR_PNFS_NO_LAYOUT: case -NFS4ERR_PNFS_NO_LAYOUT:
case -ESTALE: /* mapped NFS4ERR_STALE */ case -ESTALE: /* mapped NFS4ERR_STALE */
case -EBADHANDLE: /* mapped NFS4ERR_BADHANDLE */ case -EBADHANDLE: /* mapped NFS4ERR_BADHANDLE */
...@@ -202,10 +203,10 @@ static int filelayout_async_handle_error(struct rpc_task *task, ...@@ -202,10 +203,10 @@ static int filelayout_async_handle_error(struct rpc_task *task,
task->tk_status); task->tk_status);
nfs4_mark_deviceid_unavailable(devid); nfs4_mark_deviceid_unavailable(devid);
pnfs_error_mark_layout_for_return(inode, lseg); pnfs_error_mark_layout_for_return(inode, lseg);
pnfs_set_lo_fail(lseg);
rpc_wake_up(&tbl->slot_tbl_waitq); rpc_wake_up(&tbl->slot_tbl_waitq);
/* fall through */ /* fall through */
default: default:
pnfs_set_lo_fail(lseg);
reset: reset:
dprintk("%s Retry through MDS. Error %d\n", __func__, dprintk("%s Retry through MDS. Error %d\n", __func__,
task->tk_status); task->tk_status);
......
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