From 76c6690522bb3e335ce1e201360df8776cab4d2c Mon Sep 17 00:00:00 2001 From: Trond Myklebust Date: Thu, 14 Feb 2019 17:32:40 -0500 Subject: 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 --- fs/nfs/pnfs_dev.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'fs/nfs/pnfs_dev.c') 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 @@ -283,6 +283,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) { -- cgit v1.2.3