summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@hammerspace.com>2019-02-26 13:52:50 -0500
committerTrond Myklebust <trond.myklebust@hammerspace.com>2019-03-01 22:37:38 -0500
commit17aaec816751d77e443dee66d11d9e6ac00ac95c (patch)
treec3f9779e3ff652c1cbe0e9ec4cd046a607106a88
parentd082d4b5a0ddf56d9a63eae66119f2ef53783d5f (diff)
NFS/flexfiles: Don't invalidate DS deviceids for being unresponsive
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>
-rw-r--r--fs/nfs/flexfilelayout/flexfilelayout.h18
-rw-r--r--fs/nfs/flexfilelayout/flexfilelayoutdev.c6
2 files changed, 3 insertions, 21 deletions
diff --git a/fs/nfs/flexfilelayout/flexfilelayout.h b/fs/nfs/flexfilelayout/flexfilelayout.h
index 93508112486a..2e3c606625ef 100644
--- a/fs/nfs/flexfilelayout/flexfilelayout.h
+++ b/fs/nfs/flexfilelayout/flexfilelayout.h
@@ -180,24 +180,6 @@ ff_layout_no_read_on_rw(struct pnfs_layout_segment *lseg)
180 return FF_LAYOUT_LSEG(lseg)->flags & FF_FLAGS_NO_READ_IO; 180 return FF_LAYOUT_LSEG(lseg)->flags & FF_FLAGS_NO_READ_IO;
181} 181}
182 182
183static inline bool
184ff_layout_test_devid_unavailable(struct nfs4_deviceid_node *node)
185{
186 /*
187 * Flexfiles should never mark a DS unavailable, but if it does
188 * print a (ratelimited) warning as this can affect performance.
189 */
190 if (nfs4_test_deviceid_unavailable(node)) {
191 u32 *p = (u32 *)node->deviceid.data;
192
193 pr_warn_ratelimited("NFS: flexfiles layout referencing an "
194 "unavailable device [%x%x%x%x]\n",
195 p[0], p[1], p[2], p[3]);
196 return true;
197 }
198 return false;
199}
200
201static inline int 183static inline int
202nfs4_ff_layout_ds_version(struct pnfs_layout_segment *lseg, u32 ds_idx) 184nfs4_ff_layout_ds_version(struct pnfs_layout_segment *lseg, u32 ds_idx)
203{ 185{
diff --git a/fs/nfs/flexfilelayout/flexfilelayoutdev.c b/fs/nfs/flexfilelayout/flexfilelayoutdev.c
index 92efb5692eb3..7fd92226e4b9 100644
--- a/fs/nfs/flexfilelayout/flexfilelayoutdev.c
+++ b/fs/nfs/flexfilelayout/flexfilelayoutdev.c
@@ -186,7 +186,7 @@ out_err:
186static void ff_layout_mark_devid_invalid(struct pnfs_layout_segment *lseg, 186static void ff_layout_mark_devid_invalid(struct pnfs_layout_segment *lseg,
187 struct nfs4_deviceid_node *devid) 187 struct nfs4_deviceid_node *devid)
188{ 188{
189 nfs4_delete_deviceid(devid->ld, devid->nfs_client, &devid->deviceid); 189 nfs4_mark_deviceid_unavailable(devid);
190 if (!ff_layout_has_available_ds(lseg)) 190 if (!ff_layout_has_available_ds(lseg))
191 pnfs_error_mark_layout_for_return(lseg->pls_layout->plh_inode, 191 pnfs_error_mark_layout_for_return(lseg->pls_layout->plh_inode,
192 lseg); 192 lseg);
@@ -605,7 +605,7 @@ static bool ff_read_layout_has_available_ds(struct pnfs_layout_segment *lseg)
605 if (IS_ERR(mirror->mirror_ds)) 605 if (IS_ERR(mirror->mirror_ds))
606 continue; 606 continue;
607 devid = &mirror->mirror_ds->id_node; 607 devid = &mirror->mirror_ds->id_node;
608 if (!ff_layout_test_devid_unavailable(devid)) 608 if (!nfs4_test_deviceid_unavailable(devid))
609 return true; 609 return true;
610 } 610 }
611 } 611 }
@@ -626,7 +626,7 @@ static bool ff_rw_layout_has_available_ds(struct pnfs_layout_segment *lseg)
626 if (!mirror->mirror_ds) 626 if (!mirror->mirror_ds)
627 continue; 627 continue;
628 devid = &mirror->mirror_ds->id_node; 628 devid = &mirror->mirror_ds->id_node;
629 if (ff_layout_test_devid_unavailable(devid)) 629 if (nfs4_test_deviceid_unavailable(devid))
630 return false; 630 return false;
631 } 631 }
632 632