Commit e736a5b9 authored by Peng Tao's avatar Peng Tao Committed by Tom Haynes

nfs41: clear NFS_LAYOUT_RETURN if layoutreturn is sent or failed to send

So that pnfs path is not disabled for ever.
Signed-off-by: default avatarPeng Tao <tao.peng@primarydata.com>
Signed-off-by: default avatarTom Haynes <Thomas.Haynes@primarydata.com>
parent aa1e0e3a
...@@ -7796,6 +7796,7 @@ static void nfs4_layoutreturn_release(void *calldata) ...@@ -7796,6 +7796,7 @@ static void nfs4_layoutreturn_release(void *calldata)
spin_lock(&lo->plh_inode->i_lock); spin_lock(&lo->plh_inode->i_lock);
if (lrp->res.lrs_present) if (lrp->res.lrs_present)
pnfs_set_layout_stateid(lo, &lrp->res.stateid, true); pnfs_set_layout_stateid(lo, &lrp->res.stateid, true);
clear_bit(NFS_LAYOUT_RETURN, &lo->plh_flags);
lo->plh_block_lgets--; lo->plh_block_lgets--;
spin_unlock(&lo->plh_inode->i_lock); spin_unlock(&lo->plh_inode->i_lock);
pnfs_put_layout_hdr(lrp->args.layout); pnfs_put_layout_hdr(lrp->args.layout);
......
...@@ -921,6 +921,11 @@ pnfs_send_layoutreturn(struct pnfs_layout_hdr *lo, nfs4_stateid stateid, ...@@ -921,6 +921,11 @@ pnfs_send_layoutreturn(struct pnfs_layout_hdr *lo, nfs4_stateid stateid,
status = nfs4_proc_layoutreturn(lrp); status = nfs4_proc_layoutreturn(lrp);
out: out:
if (status) {
spin_lock(&ino->i_lock);
clear_bit(NFS_LAYOUT_RETURN, &lo->plh_flags);
spin_unlock(&ino->i_lock);
}
dprintk("<-- %s status: %d\n", __func__, status); dprintk("<-- %s status: %d\n", __func__, status);
return status; return status;
} }
......
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