It does not look right to clear out basic nfs RPC resources before calling layout_return. Also, for me a layout is an inner resource to delegation, the delegation is acquired during open, a layout later. So it's proper to return the layout before the delegation Signed-off-by: Boaz Harrosh <bharrosh@xxxxxxxxxxx> --- fs/nfs/inode.c | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 7989dea..916d6d0 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c @@ -1351,13 +1351,12 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) */ void nfs4_clear_inode(struct inode *inode) { - /* If we are holding a delegation, return it! */ - nfs_inode_return_delegation_noreclaim(inode); - /* First call standard NFS clear_inode() code */ - nfs_clear_inode(inode); #ifdef CONFIG_NFS_V4_1 pnfs_return_layout(inode, NULL, NULL, RETURN_FILE, true); #endif /* CONFIG_NFS_V4_1 */ + /* If we are holding a delegation, return it! */ + nfs_inode_return_delegation_noreclaim(inode); + nfs_clear_inode(inode); } #endif -- 1.6.6.1 -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html