Skip to contentSkip to conversation

PNFS fix fallback to MDS if got error on commit to DS

PATCH In review Olga Kornievskaia 3 participants 5 messages Mar 15, 2017 – Mar 30, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PNFS fix fallback to MDS if got error on commit to DS

Upon receiving an error on commit to the DS, the code doesn't fallback to MDS and instead retried to the same DS again.

---
 fs/nfs/filelayout/filelayout.c | 1 +
 1 file changed, 1 insertion(+)
fs/nfs/filelayout/filelayout.c +1 -0
index e1d9bea..948cb70 100644
@@ -382,6 +382,7 @@ static int filelayout_commit_done_cb(struct rpc_task *task,
 	switch (err) {
 	case -NFS4ERR_RESET_TO_MDS:
 		pnfs_generic_prepare_to_resend_writes(data);
+		pnfs_set_lo_fail(data->lseg);
 		return -EAGAIN;
 	case -EAGAIN:
 		rpc_restart_call_prepare(task);
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 21 lines · Olga Kornievskaia

Upon receiving an error on commit to the DS, the code doesn't fallback to MDS and instead retried to the same DS again.

---
 fs/nfs/filelayout/filelayout.c | 1 +
 1 file changed, 1 insertion(+)
fs/nfs/filelayout/filelayout.c +1 -1
index e1d9bea..948cb70 100644
@@ -382,6 +382,7 @@ static int filelayout_commit_done_cb(struct rpc_task *task,
        switch (err) {
        case -NFS4ERR_RESET_TO_MDS:
                pnfs_generic_prepare_to_resend_writes(data);
+               pnfs_set_lo_fail(data->lseg);
                return -EAGAIN;
        case -EAGAIN:
                rpc_restart_call_prepare(task);
--
Quoted 2 lines

1.8.3.1

Anna, Trond,

Any comments?

#2 lore raw

PATCH 1/1 PNFS fix fallback to MDS if got error on commit to DS

Upong receiving some errors (EACCES) on commit to the DS the code doesn't fallback to MDS and intead retrieds to the same DS again.

---
 fs/nfs/filelayout/filelayout.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfs/filelayout/filelayout.c +1 -1
index a3fc48b..59e1efa 100644
@@ -202,10 +202,10 @@ static int filelayout_async_handle_error(struct rpc_task *task,
 			task->tk_status);
 		nfs4_mark_deviceid_unavailable(devid);
 		pnfs_error_mark_layout_for_return(inode, lseg);
-		pnfs_set_lo_fail(lseg);
 		rpc_wake_up(&tbl->slot_tbl_waitq);
 		/* fall through */
 	default:
+		pnfs_set_lo_fail(lseg);
 reset:
 		dprintk("%s Retry through MDS. Error %d\n", __func__,
 			task->tk_status);
Signature · 1 line
1.8.3.1
#3 lore raw

Hi Olga,

Quoted 2 lines · Olga Kornievskaia

Upong receiving some errors (EACCES) on commit to the DS the code doesn't fallback to MDS and intead retrieds to the same DS again.

Just so I know what's going on: do you want this patch instead of the first one in the thread?

Thanks,
Anna

Quoted 23 lines
---
 fs/nfs/filelayout/filelayout.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfs/filelayout/filelayout.c +1 -1
index a3fc48b..59e1efa 100644
@@ -202,10 +202,10 @@ static int filelayout_async_handle_error(struct rpc_task *task,
 			task->tk_status);
 		nfs4_mark_deviceid_unavailable(devid);
 		pnfs_error_mark_layout_for_return(inode, lseg);
-		pnfs_set_lo_fail(lseg);
 		rpc_wake_up(&tbl->slot_tbl_waitq);
 		/* fall through */
 	default:
+		pnfs_set_lo_fail(lseg);
 reset:
 		dprintk("%s Retry through MDS. Error %d\n", __func__,
 			task->tk_status);
#4 lore raw
Quoted 7 lines · Anna Schumaker

Hi Olga,

Quoted 2 lines · Olga Kornievskaia

Upong receiving some errors (EACCES) on commit to the DS the code doesn't fallback to MDS and intead retrieds to the same DS again.

Just so I know what's going on: do you want this patch instead of the first one in the thread?

Yes I do. I think this might be more correct. The previous patch would call pnfs_set_lo_fail() twice for the "rpc connection errors from ds" in file layout_async_handle_error() function. Also I think other callers of filelayout_async_handle_error() (like read and write) when they get these unhandled errors (like EACCES) would also benefit from it caz otherwise they would also resend to the DS instead of MDS (but I have not tested this case with EACCES and IO).

But what I would have liked a comment on is whether or not pnfs_error_mark_layout_for_return() needs to be moved lower to?

Quoted 30 lines

Thanks,
Anna

Quoted 13 lines
---
 fs/nfs/filelayout/filelayout.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfs/filelayout/filelayout.c +0 -0
index a3fc48b..59e1efa 100644
@@ -202,10 +202,10 @@ static int filelayout_async_handle_error(struct rpc_task *task,
                      task->tk_status);

fs/nfs/filelayout/filelayout.c static int filelayout_async_handle_error(struct rpc_task *task, · line 211

Quoted 10 lines
fs/nfs/filelayout/filelayout.c +1 -1
              nfs4_mark_deviceid_unavailable(devid);
              pnfs_error_mark_layout_for_return(inode, lseg);
-             pnfs_set_lo_fail(lseg);
              rpc_wake_up(&tbl->slot_tbl_waitq);
              /* fall through */
      default:
+             pnfs_set_lo_fail(lseg);
 reset:
              dprintk("%s Retry through MDS. Error %d\n", __func__,
                      task->tk_status);

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