]> git.baikalelectronics.ru Git - kernel.git/commitdiff
pNFS/flexfiles: Report DELAY and GRACE errors from the DS to the server
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 10 Feb 2020 19:45:34 +0000 (14:45 -0500)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 16 Mar 2020 12:34:29 +0000 (08:34 -0400)
Ensure that if the DS is returning too many DELAY and GRACE errors, we
also report that to the MDS through the layouterror mechanism.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/flexfilelayout/flexfilelayout.c

index bb9148b8316631f32f8771b6cb6c3897534027df..8b8171b488938a503dcb5abfbc6f51a07da8f805 100644 (file)
@@ -1297,21 +1297,23 @@ static void ff_layout_io_track_ds_error(struct pnfs_layout_segment *lseg,
                }
        }
 
+       mirror = FF_LAYOUT_COMP(lseg, idx);
+       err = ff_layout_track_ds_error(FF_LAYOUT_FROM_HDR(lseg->pls_layout),
+                                      mirror, offset, length, status, opnum,
+                                      GFP_NOIO);
+
        switch (status) {
        case NFS4ERR_DELAY:
        case NFS4ERR_GRACE:
-               return;
-       default:
                break;
+       case NFS4ERR_NXIO:
+               ff_layout_mark_ds_unreachable(lseg, idx);
+               /* Fallthrough */
+       default:
+               pnfs_error_mark_layout_for_return(lseg->pls_layout->plh_inode,
+                                                 lseg);
        }
 
-       mirror = FF_LAYOUT_COMP(lseg, idx);
-       err = ff_layout_track_ds_error(FF_LAYOUT_FROM_HDR(lseg->pls_layout),
-                                      mirror, offset, length, status, opnum,
-                                      GFP_NOIO);
-       if (status == NFS4ERR_NXIO)
-               ff_layout_mark_ds_unreachable(lseg, idx);
-       pnfs_error_mark_layout_for_return(lseg->pls_layout->plh_inode, lseg);
        dprintk("%s: err %d op %d status %u\n", __func__, err, opnum, status);
 }