aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4filelayout.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2012-09-18 19:51:12 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-09-28 16:03:09 -0400
commit1dfed2737d8cfe2f2378fddfb3bed126ff5474e7 (patch)
tree865edd1618f525a66a30eac1e017a896b4f2bb8c /fs/nfs/nfs4filelayout.c
parent25c7533357a4c4a9311d40cc92e9648c8a7e763e (diff)
NFSv4.1: pNFS data servers may be temporarily offline
In cases where the pNFS data server is just temporarily out of service, we want to mark it as such, and then try again later. Typically that will be in cases of network connection errors etc. This patch allows us to mark the devices as being "unavailable" for such transient errors, and will make them available for retries after a 2 minute timeout period. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4filelayout.c')
-rw-r--r--fs/nfs/nfs4filelayout.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c
index af6ee4ad3f1..dac2162c3ac 100644
--- a/fs/nfs/nfs4filelayout.c
+++ b/fs/nfs/nfs4filelayout.c
@@ -205,7 +205,7 @@ static int filelayout_async_handle_error(struct rpc_task *task,
205 case -EPIPE: 205 case -EPIPE:
206 dprintk("%s DS connection error %d\n", __func__, 206 dprintk("%s DS connection error %d\n", __func__,
207 task->tk_status); 207 task->tk_status);
208 filelayout_mark_devid_invalid(devid); 208 nfs4_mark_deviceid_unavailable(devid);
209 clear_bit(NFS_INO_LAYOUTCOMMIT, &NFS_I(inode)->flags); 209 clear_bit(NFS_INO_LAYOUTCOMMIT, &NFS_I(inode)->flags);
210 _pnfs_return_layout(inode); 210 _pnfs_return_layout(inode);
211 rpc_wake_up(&tbl->slot_tbl_waitq); 211 rpc_wake_up(&tbl->slot_tbl_waitq);
@@ -269,6 +269,22 @@ filelayout_set_layoutcommit(struct nfs_write_data *wdata)
269 (unsigned long) NFS_I(hdr->inode)->layout->plh_lwb); 269 (unsigned long) NFS_I(hdr->inode)->layout->plh_lwb);
270} 270}
271 271
272bool
273filelayout_test_devid_unavailable(struct nfs4_deviceid_node *node)
274{
275 return filelayout_test_devid_invalid(node) ||
276 nfs4_test_deviceid_unavailable(node);
277}
278
279static bool
280filelayout_reset_to_mds(struct pnfs_layout_segment *lseg)
281{
282 struct nfs4_deviceid_node *node = FILELAYOUT_DEVID_NODE(lseg);
283
284 return filelayout_test_layout_invalid(lseg->pls_layout) ||
285 filelayout_test_devid_unavailable(node);
286}
287
272/* 288/*
273 * Call ops for the async read/write cases 289 * Call ops for the async read/write cases
274 * In the case of dense layouts, the offset needs to be reset to its 290 * In the case of dense layouts, the offset needs to be reset to its
@@ -613,8 +629,8 @@ filelayout_check_layout(struct pnfs_layout_hdr *lo,
613 goto out; 629 goto out;
614 } else 630 } else
615 dsaddr = container_of(d, struct nfs4_file_layout_dsaddr, id_node); 631 dsaddr = container_of(d, struct nfs4_file_layout_dsaddr, id_node);
616 /* Found deviceid is being reaped */ 632 /* Found deviceid is unavailable */
617 if (test_bit(NFS_DEVICEID_INVALID, &dsaddr->id_node.flags)) 633 if (filelayout_test_devid_unavailable(&dsaddr->id_node))
618 goto out_put; 634 goto out_put;
619 635
620 fl->dsaddr = dsaddr; 636 fl->dsaddr = dsaddr;