]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - fs/nfs/nfs4proc.c
nfs41: wait for LAYOUTRETURN before retrying LAYOUTGET
[mirror_ubuntu-bionic-kernel.git] / fs / nfs / nfs4proc.c
index 7e1a97a54f99df89e955e1db2937b42d1d68070c..44c600aac90752fe9867b3671ef00f07997a00be 100644 (file)
@@ -7796,7 +7796,9 @@ 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);
+       clear_bit_unlock(NFS_LAYOUT_RETURN, &lo->plh_flags);
+       smp_mb__after_atomic();
+       wake_up_bit(&lo->plh_flags, NFS_LAYOUT_RETURN);
        clear_bit(NFS_LAYOUT_RETURN_BEFORE_CLOSE, &lo->plh_flags);
        rpc_wake_up(&NFS_SERVER(lo->plh_inode)->roc_rpcwaitq);
        lo->plh_block_lgets--;