Commit b9fc773e authored by Trond Myklebust's avatar Trond Myklebust

pNFS/flexfiles: Don't mark the entire layout as failed, when returning it

In pNFS/flexfiles, we want to return the layout without necessarily marking
it as having completely failed. We therefore move the call to
pnfs_layout_io_set_failed() out of pnfs_error_mark_layout_for_return(),
and then ensura that pNFS/files layout calls it separately.
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
parent 2e5b29f0
...@@ -202,6 +202,7 @@ static int filelayout_async_handle_error(struct rpc_task *task, ...@@ -202,6 +202,7 @@ static int filelayout_async_handle_error(struct rpc_task *task,
task->tk_status); task->tk_status);
nfs4_mark_deviceid_unavailable(devid); nfs4_mark_deviceid_unavailable(devid);
pnfs_error_mark_layout_for_return(inode, lseg); pnfs_error_mark_layout_for_return(inode, lseg);
pnfs_set_lo_fail(lseg);
rpc_wake_up(&tbl->slot_tbl_waitq); rpc_wake_up(&tbl->slot_tbl_waitq);
/* fall through */ /* fall through */
default: default:
......
...@@ -1763,7 +1763,6 @@ void pnfs_error_mark_layout_for_return(struct inode *inode, ...@@ -1763,7 +1763,6 @@ void pnfs_error_mark_layout_for_return(struct inode *inode,
struct pnfs_layout_segment *lseg) struct pnfs_layout_segment *lseg)
{ {
struct pnfs_layout_hdr *lo = NFS_I(inode)->layout; struct pnfs_layout_hdr *lo = NFS_I(inode)->layout;
int iomode = pnfs_iomode_to_fail_bit(lseg->pls_range.iomode);
struct pnfs_layout_range range = { struct pnfs_layout_range range = {
.iomode = lseg->pls_range.iomode, .iomode = lseg->pls_range.iomode,
.offset = 0, .offset = 0,
...@@ -1772,8 +1771,6 @@ void pnfs_error_mark_layout_for_return(struct inode *inode, ...@@ -1772,8 +1771,6 @@ void pnfs_error_mark_layout_for_return(struct inode *inode,
LIST_HEAD(free_me); LIST_HEAD(free_me);
spin_lock(&inode->i_lock); spin_lock(&inode->i_lock);
/* set failure bit so that pnfs path will be retried later */
pnfs_layout_set_fail_bit(lo, iomode);
if (lo->plh_return_iomode == 0) if (lo->plh_return_iomode == 0)
lo->plh_return_iomode = range.iomode; lo->plh_return_iomode = range.iomode;
else if (lo->plh_return_iomode != range.iomode) else if (lo->plh_return_iomode != range.iomode)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment