From: Trond Myklebust Date: Wed, 25 Mar 2015 16:36:13 +0000 (-0400) Subject: NFSv4.1/pnfs: Ensure we send layoutcommit before return-on-close X-Git-Tag: v4.1-rc1~6^2~19 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7140171ea9be4143736c35acf6f31b6feb195ca0;p=platform%2Fkernel%2Flinux-exynos.git 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: Trond Myklebust --- diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index ea83f3c..c2ce2db 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c @@ -1090,6 +1090,7 @@ bool pnfs_roc(struct inode *ino) pnfs_get_layout_hdr(lo); /* matched in pnfs_roc_release */ spin_unlock(&ino->i_lock); pnfs_free_lseg_list(&tmp_list); + pnfs_layoutcommit_inode(ino, true); return true; out_noroc: @@ -1104,8 +1105,10 @@ out_noroc: } } spin_unlock(&ino->i_lock); - if (layoutreturn) + if (layoutreturn) { + pnfs_layoutcommit_inode(ino, true); pnfs_send_layoutreturn(lo, stateid, IOMODE_ANY, true); + } return false; }