mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
pNFS: Files and flexfiles always need to commit before layoutcommit
So ensure that we mark the layout for commit once the write is done, and then ensure that the commit to ds is finished before sending layoutcommit. Note that by doing this, we're able to optimise away the commit for the case of servers that don't need layoutcommit in order to return updated attributes. Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
This commit is contained in:
parent
bc28e1c2e3
commit
2e18d4d822
5 changed files with 30 additions and 9 deletions
|
@ -932,6 +932,13 @@ EXPORT_SYMBOL_GPL(pnfs_layout_mark_request_commit);
|
|||
int
|
||||
pnfs_nfs_generic_sync(struct inode *inode, bool datasync)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (!pnfs_layoutcommit_outstanding(inode))
|
||||
return 0;
|
||||
ret = nfs_commit_inode(inode, FLUSH_SYNC);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
if (datasync)
|
||||
return 0;
|
||||
return pnfs_layoutcommit_inode(inode, true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue