aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4filelayout.h
diff options
context:
space:
mode:
authorAndy Adamson <andros@netapp.com>2012-04-27 17:53:53 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-05-19 17:55:33 -0400
commit041245c88a29273788e8eff1353bc6e1f56c61df (patch)
tree0810bad95fe40c6fbf1a1dc13cb3ba0305ba30d3 /fs/nfs/nfs4filelayout.h
parentb4a2967e52523dbf0281b52c042f9042c6082f99 (diff)
NFSv4.1 resend LAYOUTGET on data server invalid layout errors
The "invalid layout" class of errors is handled by destroying the layout and getting a new layout from the server. Currently, the layout must be destroyed before a new layout can be obtained. This means that all references (e.g.lsegs) to the "to be destroyed" layout header must be dropped before it can be destroyed. This in turn means waiting for all in flight RPC's using the old layout as well as draining the data server session slot table wait queue. Set the NFS_LAYOUT_INVALID flag to redirect I/O to the MDS while waiting for the old layout to be destroyed. Signed-off-by: Andy Adamson <andros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4filelayout.h')
-rw-r--r--fs/nfs/nfs4filelayout.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/fs/nfs/nfs4filelayout.h b/fs/nfs/nfs4filelayout.h
index 95562ad43e12..43fe802dd678 100644
--- a/fs/nfs/nfs4filelayout.h
+++ b/fs/nfs/nfs4filelayout.h
@@ -129,11 +129,24 @@ filelayout_mark_devid_invalid(struct nfs4_deviceid_node *node)
129} 129}
130 130
131static inline bool 131static inline bool
132filelayout_test_layout_invalid(struct pnfs_layout_hdr *lo)
133{
134 return test_bit(NFS_LAYOUT_INVALID, &lo->plh_flags);
135}
136
137static inline bool
132filelayout_test_devid_invalid(struct nfs4_deviceid_node *node) 138filelayout_test_devid_invalid(struct nfs4_deviceid_node *node)
133{ 139{
134 return test_bit(NFS_DEVICEID_INVALID, &node->flags); 140 return test_bit(NFS_DEVICEID_INVALID, &node->flags);
135} 141}
136 142
143static inline bool
144filelayout_reset_to_mds(struct pnfs_layout_segment *lseg)
145{
146 return filelayout_test_devid_invalid(FILELAYOUT_DEVID_NODE(lseg)) ||
147 filelayout_test_layout_invalid(lseg->pls_layout);
148}
149
137extern struct nfs_fh * 150extern struct nfs_fh *
138nfs4_fl_select_ds_fh(struct pnfs_layout_segment *lseg, u32 j); 151nfs4_fl_select_ds_fh(struct pnfs_layout_segment *lseg, u32 j);
139 152