nfs41: clear NFS_LAYOUT_RETURN if layoutreturn is sent or failed to send
authorPeng Tao <tao.peng@primarydata.com>
Fri, 5 Sep 2014 16:53:26 +0000 (00:53 +0800)
committerTom Haynes <loghyr@primarydata.com>
Tue, 3 Feb 2015 19:06:42 +0000 (11:06 -0800)
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>
fs/nfs/nfs4proc.c
fs/nfs/pnfs.c

index 19432842b2dc7fc4df5a68cd4551650fe7983f55..e19b5dbe535abe0042d81d78d88d80904f32357b 100644 (file)
@@ -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);
index e9acfcfdc9a9837e044dddfc197040a2214dff15..63992c826faf0b4c7414b474d0b56297bcb05302 100644 (file)
@@ -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;
 }