Commit 7140171e authored by Trond Myklebust's avatar Trond Myklebust

NFSv4.1/pnfs: Ensure we send layoutcommit before return-on-close

We must not send a close or delegreturn that would result in a
return-on-close of the layout without ensuring that we've also
sent the necessary layoutcommit.
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
parent a0815d55
...@@ -1090,6 +1090,7 @@ bool pnfs_roc(struct inode *ino) ...@@ -1090,6 +1090,7 @@ bool pnfs_roc(struct inode *ino)
pnfs_get_layout_hdr(lo); /* matched in pnfs_roc_release */ pnfs_get_layout_hdr(lo); /* matched in pnfs_roc_release */
spin_unlock(&ino->i_lock); spin_unlock(&ino->i_lock);
pnfs_free_lseg_list(&tmp_list); pnfs_free_lseg_list(&tmp_list);
pnfs_layoutcommit_inode(ino, true);
return true; return true;
out_noroc: out_noroc:
...@@ -1104,8 +1105,10 @@ bool pnfs_roc(struct inode *ino) ...@@ -1104,8 +1105,10 @@ bool pnfs_roc(struct inode *ino)
} }
} }
spin_unlock(&ino->i_lock); spin_unlock(&ino->i_lock);
if (layoutreturn) if (layoutreturn) {
pnfs_layoutcommit_inode(ino, true);
pnfs_send_layoutreturn(lo, stateid, IOMODE_ANY, true); pnfs_send_layoutreturn(lo, stateid, IOMODE_ANY, true);
}
return false; return false;
} }
......
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