Skip to content

Commit

Permalink
nfs41: clear NFS_LAYOUT_RETURN if layoutreturn is sent or failed to send
Browse files Browse the repository at this point in the history
So that pnfs path is not disabled for ever.

Signed-off-by: Peng Tao <tao.peng@primarydata.com>
Signed-off-by: Tom Haynes <Thomas.Haynes@primarydata.com>
  • Loading branch information
Peng Tao authored and Tom Haynes committed Feb 3, 2015
1 parent aa1e0e3 commit e736a5b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions fs/nfs/nfs4proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -7796,6 +7796,7 @@ static void nfs4_layoutreturn_release(void *calldata)
spin_lock(&lo->plh_inode->i_lock);
if (lrp->res.lrs_present)
pnfs_set_layout_stateid(lo, &lrp->res.stateid, true);
clear_bit(NFS_LAYOUT_RETURN, &lo->plh_flags);
lo->plh_block_lgets--;
spin_unlock(&lo->plh_inode->i_lock);
pnfs_put_layout_hdr(lrp->args.layout);
Expand Down
5 changes: 5 additions & 0 deletions fs/nfs/pnfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,11 @@ pnfs_send_layoutreturn(struct pnfs_layout_hdr *lo, nfs4_stateid stateid,

status = nfs4_proc_layoutreturn(lrp);
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);
return status;
}
Expand Down

0 comments on commit e736a5b

Please sign in to comment.