]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
PNFS fix EACCESS on commit to DS handling
authorOlga Kornievskaia <kolga@netapp.com>
Fri, 23 Jun 2017 14:26:58 +0000 (10:26 -0400)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Thu, 13 Jul 2017 19:59:57 +0000 (15:59 -0400)
Commit fabbbee0eb0f "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: fabbbee0eb0f ("PNFS fix fallback to MDS if got error on commit to DS")
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Cc: stable@vger.kernel.org # v4.12
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
fs/nfs/filelayout/filelayout.c

index 1cf85d65b7489bd56c69447d618360263febc52c..3e486cd01cafd95ddacbe210966a38de63bf5c81 100644 (file)
@@ -172,6 +172,7 @@ static int filelayout_async_handle_error(struct rpc_task *task,
        case -NFS4ERR_RETRY_UNCACHED_REP:
                break;
        /* Invalidate Layout errors */
+       case -NFS4ERR_ACCESS:
        case -NFS4ERR_PNFS_NO_LAYOUT:
        case -ESTALE:           /* mapped NFS4ERR_STALE */
        case -EBADHANDLE:       /* mapped NFS4ERR_BADHANDLE */
@@ -202,10 +203,10 @@ static int filelayout_async_handle_error(struct rpc_task *task,
                        task->tk_status);
                nfs4_mark_deviceid_unavailable(devid);
                pnfs_error_mark_layout_for_return(inode, lseg);
+               pnfs_set_lo_fail(lseg);
                rpc_wake_up(&tbl->slot_tbl_waitq);
                /* fall through */
        default:
-               pnfs_set_lo_fail(lseg);
 reset:
                dprintk("%s Retry through MDS. Error %d\n", __func__,
                        task->tk_status);