[PATCH 4.7 098/141] pNFS/flexfiles: Fix layoutcommit after a commit to DS

From: Greg Kroah-Hartman
Date: Thu Oct 06 2016 - 04:43:47 EST


4.7-stable review patch. If anyone has any objections, please let me know.

------------------

From: Trond Myklebust <trond.myklebust@xxxxxxxxxxxxxxx>

commit c001c87a63aa2f35358e33eb05e45e4cbcb34f54 upstream.

We should always do a layoutcommit after commit to DS, except if
the layout segment we're using has set FF_FLAGS_NO_LAYOUTCOMMIT.

Fixes: d67ae825a59d ("pnfs/flexfiles: Add the FlexFile Layout Driver")
Signed-off-by: Trond Myklebust <trond.myklebust@xxxxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
fs/nfs/flexfilelayout/flexfilelayout.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

--- a/fs/nfs/flexfilelayout/flexfilelayout.c
+++ b/fs/nfs/flexfilelayout/flexfilelayout.c
@@ -1529,8 +1529,7 @@ static int ff_layout_commit_done_cb(stru
return -EAGAIN;
}

- if (data->verf.committed == NFS_UNSTABLE
- && ff_layout_need_layoutcommit(data->lseg))
+ if (ff_layout_need_layoutcommit(data->lseg))
pnfs_set_layoutcommit(data->inode, data->lseg, data->lwb);

return 0;