diff options
author | Peng Tao <tao.peng@primarydata.com> | 2014-09-05 12:53:26 -0400 |
---|---|---|
committer | Tom Haynes <loghyr@primarydata.com> | 2015-02-03 14:06:42 -0500 |
commit | e736a5b98c7aa98fe572990caf5fed9593c72a67 (patch) | |
tree | 211cb03b020a4f83005e8facd97fdd39429f7525 /fs/nfs | |
parent | aa1e0e3a8e3f16ff50a72a8c623d7e1c467383bc (diff) |
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: Peng Tao <tao.peng@primarydata.com>
Signed-off-by: Tom Haynes <Thomas.Haynes@primarydata.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/nfs4proc.c | 1 | ||||
-rw-r--r-- | fs/nfs/pnfs.c | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 19432842b2dc..e19b5dbe535a 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -7796,6 +7796,7 @@ static void nfs4_layoutreturn_release(void *calldata) | |||
7796 | spin_lock(&lo->plh_inode->i_lock); | 7796 | spin_lock(&lo->plh_inode->i_lock); |
7797 | if (lrp->res.lrs_present) | 7797 | if (lrp->res.lrs_present) |
7798 | pnfs_set_layout_stateid(lo, &lrp->res.stateid, true); | 7798 | pnfs_set_layout_stateid(lo, &lrp->res.stateid, true); |
7799 | clear_bit(NFS_LAYOUT_RETURN, &lo->plh_flags); | ||
7799 | lo->plh_block_lgets--; | 7800 | lo->plh_block_lgets--; |
7800 | spin_unlock(&lo->plh_inode->i_lock); | 7801 | spin_unlock(&lo->plh_inode->i_lock); |
7801 | pnfs_put_layout_hdr(lrp->args.layout); | 7802 | pnfs_put_layout_hdr(lrp->args.layout); |
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index e9acfcfdc9a9..63992c826faf 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c | |||
@@ -921,6 +921,11 @@ pnfs_send_layoutreturn(struct pnfs_layout_hdr *lo, nfs4_stateid stateid, | |||
921 | 921 | ||
922 | status = nfs4_proc_layoutreturn(lrp); | 922 | status = nfs4_proc_layoutreturn(lrp); |
923 | out: | 923 | out: |
924 | if (status) { | ||
925 | spin_lock(&ino->i_lock); | ||
926 | clear_bit(NFS_LAYOUT_RETURN, &lo->plh_flags); | ||
927 | spin_unlock(&ino->i_lock); | ||
928 | } | ||
924 | dprintk("<-- %s status: %d\n", __func__, status); | 929 | dprintk("<-- %s status: %d\n", __func__, status); |
925 | return status; | 930 | return status; |
926 | } | 931 | } |