diff options
Diffstat (limited to 'fs/nfs/write.c')
-rw-r--r-- | fs/nfs/write.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c index e7aeda0663c5..a03c11f9081e 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c | |||
@@ -1562,7 +1562,20 @@ static int nfs_commit_unstable_pages(struct inode *inode, struct writeback_contr | |||
1562 | 1562 | ||
1563 | int nfs_write_inode(struct inode *inode, struct writeback_control *wbc) | 1563 | int nfs_write_inode(struct inode *inode, struct writeback_control *wbc) |
1564 | { | 1564 | { |
1565 | return nfs_commit_unstable_pages(inode, wbc); | 1565 | int ret; |
1566 | |||
1567 | ret = nfs_commit_unstable_pages(inode, wbc); | ||
1568 | if (ret >= 0 && test_bit(NFS_INO_LAYOUTCOMMIT, &NFS_I(inode)->flags)) { | ||
1569 | int status, sync = wbc->sync_mode; | ||
1570 | |||
1571 | if (wbc->nonblocking || wbc->for_background) | ||
1572 | sync = 0; | ||
1573 | |||
1574 | status = pnfs_layoutcommit_inode(inode, sync); | ||
1575 | if (status < 0) | ||
1576 | return status; | ||
1577 | } | ||
1578 | return ret; | ||
1566 | } | 1579 | } |
1567 | 1580 | ||
1568 | /* | 1581 | /* |