aboutsummaryrefslogtreecommitdiffstats
path: root/fs/9p
diff options
context:
space:
mode:
Diffstat (limited to 'fs/9p')
-rw-r--r--fs/9p/vfs_inode.c4
-rw-r--r--fs/9p/vfs_inode_dotl.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index 2555776920ad..8a2c232f708a 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -999,6 +999,10 @@ static int v9fs_vfs_setattr(struct dentry *dentry, struct iattr *iattr)
999 if (retval) 999 if (retval)
1000 return retval; 1000 return retval;
1001 } 1001 }
1002 /* Write all dirty data */
1003 if (S_ISREG(dentry->d_inode->i_mode))
1004 filemap_write_and_wait(dentry->d_inode->i_mapping);
1005
1002 retval = p9_client_wstat(fid, &wstat); 1006 retval = p9_client_wstat(fid, &wstat);
1003 if (retval < 0) 1007 if (retval < 0)
1004 return retval; 1008 return retval;
diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c
index bcd0ee2e549a..67c138e94feb 100644
--- a/fs/9p/vfs_inode_dotl.c
+++ b/fs/9p/vfs_inode_dotl.c
@@ -459,6 +459,10 @@ int v9fs_vfs_setattr_dotl(struct dentry *dentry, struct iattr *iattr)
459 if (retval) 459 if (retval)
460 return retval; 460 return retval;
461 } 461 }
462 /* Write all dirty data */
463 if (S_ISREG(dentry->d_inode->i_mode))
464 filemap_write_and_wait(dentry->d_inode->i_mapping);
465
462 retval = p9_client_setattr(fid, &p9attr); 466 retval = p9_client_setattr(fid, &p9attr);
463 if (retval < 0) 467 if (retval < 0)
464 return retval; 468 return retval;