summaryrefslogtreecommitdiffstats
path: root/fs/nfs/pnfs_dev.c
diff options
context:
space:
mode:
authorTrond Myklebust2019-02-14 23:32:40 +0100
committerTrond Myklebust2019-03-02 04:37:38 +0100
commit76c6690522bb3e335ce1e201360df8776cab4d2c (patch)
treeade5acb43b8b1a85e6c85f032e0c1632b1bf6eee /fs/nfs/pnfs_dev.c
parentNFS/flexfiles: Don't invalidate DS deviceids for being unresponsive (diff)
downloadkernel-qcow2-linux-76c6690522bb3e335ce1e201360df8776cab4d2c.tar.gz
kernel-qcow2-linux-76c6690522bb3e335ce1e201360df8776cab4d2c.tar.xz
kernel-qcow2-linux-76c6690522bb3e335ce1e201360df8776cab4d2c.zip
NFS/flexfiles: Speed up read failover when DSes are down
If we notice that a DS may be down, we should attempt to read from the other mirrors first before we go back to retry the dead DS. Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to 'fs/nfs/pnfs_dev.c')
-rw-r--r--fs/nfs/pnfs_dev.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/nfs/pnfs_dev.c b/fs/nfs/pnfs_dev.c
index ec6b607ff1d7..537b80d693f1 100644
--- a/fs/nfs/pnfs_dev.c
+++ b/fs/nfs/pnfs_dev.c
@@ -284,6 +284,16 @@ nfs4_put_deviceid_node(struct nfs4_deviceid_node *d)
EXPORT_SYMBOL_GPL(nfs4_put_deviceid_node);
void
+nfs4_mark_deviceid_available(struct nfs4_deviceid_node *node)
+{
+ if (test_bit(NFS_DEVICEID_UNAVAILABLE, &node->flags)) {
+ clear_bit(NFS_DEVICEID_UNAVAILABLE, &node->flags);
+ smp_mb__after_atomic();
+ }
+}
+EXPORT_SYMBOL_GPL(nfs4_mark_deviceid_available);
+
+void
nfs4_mark_deviceid_unavailable(struct nfs4_deviceid_node *node)
{
node->timestamp_unavailable = jiffies;