NFS/flexfiles: Don't invalidate DS deviceids for being unresponsive
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Tue, 26 Feb 2019 18:52:50 +0000 (13:52 -0500)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Sat, 2 Mar 2019 03:37:38 +0000 (22:37 -0500)
If the DS is unresponsive, we want to just mark it as such, while
reporting the errors. If the server later returns the same deviceid
in a new layout, then we don't want to have to look it up again.

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

index 93508112486a7b80e7fc31e8e41e9db3993973cc..2e3c606625efbb6eb24512d4c614b7c579942f77 100644 (file)
@@ -180,24 +180,6 @@ ff_layout_no_read_on_rw(struct pnfs_layout_segment *lseg)
        return FF_LAYOUT_LSEG(lseg)->flags & FF_FLAGS_NO_READ_IO;
 }
 
-static inline bool
-ff_layout_test_devid_unavailable(struct nfs4_deviceid_node *node)
-{
-       /*
-        * Flexfiles should never mark a DS unavailable, but if it does
-        * print a (ratelimited) warning as this can affect performance.
-        */
-       if (nfs4_test_deviceid_unavailable(node)) {
-               u32 *p = (u32 *)node->deviceid.data;
-
-               pr_warn_ratelimited("NFS: flexfiles layout referencing an "
-                               "unavailable device [%x%x%x%x]\n",
-                               p[0], p[1], p[2], p[3]);
-               return true;
-       }
-       return false;
-}
-
 static inline int
 nfs4_ff_layout_ds_version(struct pnfs_layout_segment *lseg, u32 ds_idx)
 {
index 92efb5692eb3add5e72649262c58f4959e1457a3..7fd92226e4b9dbbd79b5d578771faf3edadaf6e4 100644 (file)
@@ -186,7 +186,7 @@ out_err:
 static void ff_layout_mark_devid_invalid(struct pnfs_layout_segment *lseg,
                struct nfs4_deviceid_node *devid)
 {
-       nfs4_delete_deviceid(devid->ld, devid->nfs_client, &devid->deviceid);
+       nfs4_mark_deviceid_unavailable(devid);
        if (!ff_layout_has_available_ds(lseg))
                pnfs_error_mark_layout_for_return(lseg->pls_layout->plh_inode,
                                lseg);
@@ -605,7 +605,7 @@ static bool ff_read_layout_has_available_ds(struct pnfs_layout_segment *lseg)
                        if (IS_ERR(mirror->mirror_ds))
                                continue;
                        devid = &mirror->mirror_ds->id_node;
-                       if (!ff_layout_test_devid_unavailable(devid))
+                       if (!nfs4_test_deviceid_unavailable(devid))
                                return true;
                }
        }
@@ -626,7 +626,7 @@ static bool ff_rw_layout_has_available_ds(struct pnfs_layout_segment *lseg)
                if (!mirror->mirror_ds)
                        continue;
                devid = &mirror->mirror_ds->id_node;
-               if (ff_layout_test_devid_unavailable(devid))
+               if (nfs4_test_deviceid_unavailable(devid))
                        return false;
        }