aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4filelayout.c
diff options
context:
space:
mode:
authorAndy Adamson <andros@netapp.com>2012-04-27 17:53:48 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-05-19 17:55:31 -0400
commit0ad2f378e1af7996d6f8355c02181ff3cc7ab260 (patch)
treed336b21a4dcb5d9681d8e298dc37c245b73ddc4e /fs/nfs/nfs4filelayout.c
parenta033a09189c0125d56f2ac17ffb4bec5a3d3323b (diff)
NFSv4.1 Check invalid deviceid upon slot table waitq wakeup
Tasks sleeping on the slot table waitq wake to the rpc_prepare_task state. Reset the task for io through the MDS if the deviceid is invalid. The reset functions put the io pages through the pageio layer which has the advantage of re-coalescing which allows for the MDS and DS having different r/wsizes. Exit the awakened task without executing the rpc_call_done routine. Signed-off-by: Andy Adamson <andros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4filelayout.c')
-rw-r--r--fs/nfs/nfs4filelayout.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c
index f503cbe5a21a..1b9bedb89620 100644
--- a/fs/nfs/nfs4filelayout.c
+++ b/fs/nfs/nfs4filelayout.c
@@ -252,7 +252,14 @@ filelayout_set_layoutcommit(struct nfs_write_data *wdata)
252static void filelayout_read_prepare(struct rpc_task *task, void *data) 252static void filelayout_read_prepare(struct rpc_task *task, void *data)
253{ 253{
254 struct nfs_read_data *rdata = data; 254 struct nfs_read_data *rdata = data;
255 struct pnfs_layout_segment *lseg = rdata->header->lseg;
255 256
257 if (filelayout_test_devid_invalid(FILELAYOUT_DEVID_NODE(lseg))) {
258 dprintk("%s task %u reset io to MDS\n", __func__, task->tk_pid);
259 filelayout_reset_read(rdata);
260 rpc_exit(task, 0);
261 return;
262 }
256 rdata->read_done_cb = filelayout_read_done_cb; 263 rdata->read_done_cb = filelayout_read_done_cb;
257 264
258 if (nfs41_setup_sequence(rdata->ds_clp->cl_session, 265 if (nfs41_setup_sequence(rdata->ds_clp->cl_session,
@@ -269,6 +276,9 @@ static void filelayout_read_call_done(struct rpc_task *task, void *data)
269 276
270 dprintk("--> %s task->tk_status %d\n", __func__, task->tk_status); 277 dprintk("--> %s task->tk_status %d\n", __func__, task->tk_status);
271 278
279 if (test_bit(NFS_IOHDR_REDO, &rdata->header->flags))
280 return;
281
272 /* Note this may cause RPC to be resent */ 282 /* Note this may cause RPC to be resent */
273 rdata->header->mds_ops->rpc_call_done(task, data); 283 rdata->header->mds_ops->rpc_call_done(task, data);
274} 284}
@@ -343,7 +353,14 @@ static int filelayout_commit_done_cb(struct rpc_task *task,
343static void filelayout_write_prepare(struct rpc_task *task, void *data) 353static void filelayout_write_prepare(struct rpc_task *task, void *data)
344{ 354{
345 struct nfs_write_data *wdata = data; 355 struct nfs_write_data *wdata = data;
356 struct pnfs_layout_segment *lseg = wdata->header->lseg;
346 357
358 if (filelayout_test_devid_invalid(FILELAYOUT_DEVID_NODE(lseg))) {
359 dprintk("%s task %u reset io to MDS\n", __func__, task->tk_pid);
360 filelayout_reset_write(wdata);
361 rpc_exit(task, 0);
362 return;
363 }
347 if (nfs41_setup_sequence(wdata->ds_clp->cl_session, 364 if (nfs41_setup_sequence(wdata->ds_clp->cl_session,
348 &wdata->args.seq_args, &wdata->res.seq_res, 365 &wdata->args.seq_args, &wdata->res.seq_res,
349 task)) 366 task))
@@ -356,6 +373,9 @@ static void filelayout_write_call_done(struct rpc_task *task, void *data)
356{ 373{
357 struct nfs_write_data *wdata = data; 374 struct nfs_write_data *wdata = data;
358 375
376 if (test_bit(NFS_IOHDR_REDO, &wdata->header->flags))
377 return;
378
359 /* Note this may cause RPC to be resent */ 379 /* Note this may cause RPC to be resent */
360 wdata->header->mds_ops->rpc_call_done(task, data); 380 wdata->header->mds_ops->rpc_call_done(task, data);
361} 381}