diff options
author | Andy Adamson <andros@netapp.com> | 2011-02-28 20:34:22 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2011-03-11 15:38:43 -0500 |
commit | 568e8c494ded95a28c5dd8b79b4d3ffb95b6d845 (patch) | |
tree | 00e71f79575635c0ddfcd1210e263088cc121da2 /fs/nfs/pnfs.c | |
parent | ea8eecdd11ee6becd09c095c8efa88aa7df95961 (diff) |
NFSv4.1: turn off pNFS on ds connection failure
If a data server is unavailable, go through MDS.
Mark the deviceid containing the data server as a negative cache entry.
Do not try to connect to any data server on a deviceid marked as a negative
cache entry. Mark any layout that tries to use the marked deviceid as failed.
Inodes with a layout marked as fails will not use the layout for I/O, and will
not perform any more layoutgets.
Inodes without a layout will still do layoutget, but the layout will get
marked immediately.
Signed-off-by: Andy Adamson <andros@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/pnfs.c')
-rw-r--r-- | fs/nfs/pnfs.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index 1f4c153441a1..3e545144a0b2 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c | |||
@@ -739,15 +739,16 @@ pnfs_update_layout(struct inode *ino, | |||
739 | dprintk("%s matches recall, use MDS\n", __func__); | 739 | dprintk("%s matches recall, use MDS\n", __func__); |
740 | goto out_unlock; | 740 | goto out_unlock; |
741 | } | 741 | } |
742 | /* Check to see if the layout for the given range already exists */ | ||
743 | lseg = pnfs_find_lseg(lo, iomode); | ||
744 | if (lseg) | ||
745 | goto out_unlock; | ||
746 | 742 | ||
747 | /* if LAYOUTGET already failed once we don't try again */ | 743 | /* if LAYOUTGET already failed once we don't try again */ |
748 | if (test_bit(lo_fail_bit(iomode), &nfsi->layout->plh_flags)) | 744 | if (test_bit(lo_fail_bit(iomode), &nfsi->layout->plh_flags)) |
749 | goto out_unlock; | 745 | goto out_unlock; |
750 | 746 | ||
747 | /* Check to see if the layout for the given range already exists */ | ||
748 | lseg = pnfs_find_lseg(lo, iomode); | ||
749 | if (lseg) | ||
750 | goto out_unlock; | ||
751 | |||
751 | if (pnfs_layoutgets_blocked(lo, NULL, 0)) | 752 | if (pnfs_layoutgets_blocked(lo, NULL, 0)) |
752 | goto out_unlock; | 753 | goto out_unlock; |
753 | atomic_inc(&lo->plh_outstanding); | 754 | atomic_inc(&lo->plh_outstanding); |