diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2015-09-02 18:22:48 -0400 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2015-09-02 18:24:54 -0400 |
commit | 7cc8c5cde0a5872f5d013f82978b73c011d8f8f1 (patch) | |
tree | c5e23356d6399138d0c53cc69e895fa015e389b6 | |
parent | f95c03b2d5fb6d56c0d7ec21970329b49b657fed (diff) |
NFSv4.1/flexfiles: Clean up ff_layout_write_done_cb/ff_layout_commit_done_cb
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
-rw-r--r-- | fs/nfs/flexfilelayout/flexfilelayout.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c index 3f073a7de870..fbc5a56de875 100644 --- a/fs/nfs/flexfilelayout/flexfilelayout.c +++ b/fs/nfs/flexfilelayout/flexfilelayout.c | |||
@@ -1342,14 +1342,12 @@ static int ff_layout_write_done_cb(struct rpc_task *task, | |||
1342 | 1342 | ||
1343 | switch (err) { | 1343 | switch (err) { |
1344 | case -NFS4ERR_RESET_TO_PNFS: | 1344 | case -NFS4ERR_RESET_TO_PNFS: |
1345 | pnfs_set_retry_layoutget(hdr->lseg->pls_layout); | ||
1346 | ff_layout_reset_write(hdr, true); | ||
1347 | return task->tk_status; | ||
1345 | case -NFS4ERR_RESET_TO_MDS: | 1348 | case -NFS4ERR_RESET_TO_MDS: |
1346 | if (err == -NFS4ERR_RESET_TO_PNFS) { | 1349 | pnfs_clear_retry_layoutget(hdr->lseg->pls_layout); |
1347 | pnfs_set_retry_layoutget(hdr->lseg->pls_layout); | 1350 | ff_layout_reset_write(hdr, false); |
1348 | ff_layout_reset_write(hdr, true); | ||
1349 | } else { | ||
1350 | pnfs_clear_retry_layoutget(hdr->lseg->pls_layout); | ||
1351 | ff_layout_reset_write(hdr, false); | ||
1352 | } | ||
1353 | return task->tk_status; | 1351 | return task->tk_status; |
1354 | case -EAGAIN: | 1352 | case -EAGAIN: |
1355 | rpc_restart_call_prepare(task); | 1353 | rpc_restart_call_prepare(task); |
@@ -1384,11 +1382,11 @@ static int ff_layout_commit_done_cb(struct rpc_task *task, | |||
1384 | 1382 | ||
1385 | switch (err) { | 1383 | switch (err) { |
1386 | case -NFS4ERR_RESET_TO_PNFS: | 1384 | case -NFS4ERR_RESET_TO_PNFS: |
1385 | pnfs_set_retry_layoutget(data->lseg->pls_layout); | ||
1386 | pnfs_generic_prepare_to_resend_writes(data); | ||
1387 | return -EAGAIN; | ||
1387 | case -NFS4ERR_RESET_TO_MDS: | 1388 | case -NFS4ERR_RESET_TO_MDS: |
1388 | if (err == -NFS4ERR_RESET_TO_PNFS) | 1389 | pnfs_clear_retry_layoutget(data->lseg->pls_layout); |
1389 | pnfs_set_retry_layoutget(data->lseg->pls_layout); | ||
1390 | else | ||
1391 | pnfs_clear_retry_layoutget(data->lseg->pls_layout); | ||
1392 | pnfs_generic_prepare_to_resend_writes(data); | 1390 | pnfs_generic_prepare_to_resend_writes(data); |
1393 | return -EAGAIN; | 1391 | return -EAGAIN; |
1394 | case -EAGAIN: | 1392 | case -EAGAIN: |