[PATCH Version 2 08/12] NFSv4.1 wake up all tasks on un-connected DS slot table waitq

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Andy Adamson <andros@xxxxxxxxxx>

The DS has a connection error (invalid deviceid). Drain the fore channel
slot table waitq.

Signed-off-by: Andy Adamson <andros@xxxxxxxxxx>
---
 fs/nfs/nfs4filelayout.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c
index b73818f..ccbafdd 100644
--- a/fs/nfs/nfs4filelayout.c
+++ b/fs/nfs/nfs4filelayout.c
@@ -193,6 +193,7 @@ static int filelayout_read_done_cb(struct rpc_task *task,
 				struct nfs_read_data *data)
 {
 	struct nfs4_deviceid_node *devid = FILELAYOUT_DEVID_NODE(data->lseg);
+	struct nfs4_slot_table *tbl = &data->ds_clp->cl_session->fc_slot_table;
 	unsigned long reset = 0;
 
 	dprintk("%s DS read\n", __func__);
@@ -205,8 +206,10 @@ static int filelayout_read_done_cb(struct rpc_task *task,
 
 		if (test_bit(NFS4_RESET_TO_MDS, &reset)) {
 			filelayout_reset_read(task, data);
-			if (test_bit(NFS4_RESET_DEVICEID, &reset))
+			if (test_bit(NFS4_RESET_DEVICEID, &reset)) {
 				filelayout_mark_devid_invalid(devid);
+				rpc_wake_up(&tbl->slot_tbl_waitq);
+			}
 		}
 		rpc_restart_call_prepare(task);
 		return -EAGAIN;
@@ -286,6 +289,7 @@ static int filelayout_write_done_cb(struct rpc_task *task,
 				struct nfs_write_data *data)
 {
 	struct nfs4_deviceid_node *devid = FILELAYOUT_DEVID_NODE(data->lseg);
+	struct nfs4_slot_table *tbl = &data->ds_clp->cl_session->fc_slot_table;
 	unsigned long reset = 0;
 
 	if (filelayout_async_handle_error(task, data->args.context->state,
@@ -296,8 +300,10 @@ static int filelayout_write_done_cb(struct rpc_task *task,
 
 		if (test_bit(NFS4_RESET_TO_MDS, &reset)) {
 			filelayout_reset_write(task, data);
-			if (test_bit(NFS4_RESET_DEVICEID, &reset))
+			if (test_bit(NFS4_RESET_DEVICEID, &reset)) {
 				filelayout_mark_devid_invalid(devid);
+				rpc_wake_up(&tbl->slot_tbl_waitq);
+			}
 		}
 		rpc_restart_call_prepare(task);
 		return -EAGAIN;
@@ -322,6 +328,7 @@ static int filelayout_commit_done_cb(struct rpc_task *task,
 				     struct nfs_write_data *data)
 {
 	struct nfs4_deviceid_node *devid = FILELAYOUT_DEVID_NODE(data->lseg);
+	struct nfs4_slot_table *tbl = &data->ds_clp->cl_session->fc_slot_table;
 	unsigned long reset = 0;
 
 	if (filelayout_async_handle_error(task, data->args.context->state,
@@ -332,8 +339,10 @@ static int filelayout_commit_done_cb(struct rpc_task *task,
 
 		if (test_bit(NFS4_RESET_TO_MDS, &reset)) {
 			prepare_to_resend_writes(data);
-			if (test_bit(NFS4_RESET_DEVICEID, &reset))
+			if (test_bit(NFS4_RESET_DEVICEID, &reset)) {
 				filelayout_mark_devid_invalid(devid);
+				rpc_wake_up(&tbl->slot_tbl_waitq);
+			}
 		} else {
 			rpc_restart_call_prepare(task);
 		}
-- 
1.7.6.4

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux