Commit 8f70f53a authored by Trond Myklebust's avatar Trond Myklebust

NFSv4.1/pnfs: Fix serialisation of layout return and layoutget

We should always test for outstanding layout returns, whether or not
pnfs_should_retry_layoutget() is true.
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
parent a4497a58
...@@ -1436,6 +1436,8 @@ static int pnfs_layoutget_retry_bit_wait(struct wait_bit_key *key) ...@@ -1436,6 +1436,8 @@ static int pnfs_layoutget_retry_bit_wait(struct wait_bit_key *key)
static bool pnfs_prepare_to_retry_layoutget(struct pnfs_layout_hdr *lo) static bool pnfs_prepare_to_retry_layoutget(struct pnfs_layout_hdr *lo)
{ {
if (!pnfs_should_retry_layoutget(lo))
return false;
/* /*
* send layoutcommit as it can hold up layoutreturn due to lseg * send layoutcommit as it can hold up layoutreturn due to lseg
* reference * reference
...@@ -1531,8 +1533,7 @@ pnfs_update_layout(struct inode *ino, ...@@ -1531,8 +1533,7 @@ pnfs_update_layout(struct inode *ino,
* Because we free lsegs before sending LAYOUTRETURN, we need to wait * Because we free lsegs before sending LAYOUTRETURN, we need to wait
* for LAYOUTRETURN even if first is true. * for LAYOUTRETURN even if first is true.
*/ */
if (!lseg && pnfs_should_retry_layoutget(lo) && if (test_bit(NFS_LAYOUT_RETURN, &lo->plh_flags)) {
test_bit(NFS_LAYOUT_RETURN, &lo->plh_flags)) {
spin_unlock(&ino->i_lock); spin_unlock(&ino->i_lock);
dprintk("%s wait for layoutreturn\n", __func__); dprintk("%s wait for layoutreturn\n", __func__);
if (pnfs_prepare_to_retry_layoutget(lo)) { if (pnfs_prepare_to_retry_layoutget(lo)) {
......
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