diff options
-rw-r--r-- | fs/f2fs/super.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 2936bc870f5c..8fd23caa1ed9 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -2923,15 +2923,26 @@ static int f2fs_quota_on(struct super_block *sb, int type, int format_id, return -EBUSY; } + if (path->dentry->d_sb != sb) + return -EXDEV; + err = f2fs_quota_sync(sb, type); if (err) return err; - err = dquot_quota_on(sb, type, format_id, path); + inode = d_inode(path->dentry); + + err = filemap_fdatawrite(inode->i_mapping); if (err) return err; - inode = d_inode(path->dentry); + err = filemap_fdatawait(inode->i_mapping); + if (err) + return err; + + err = dquot_quota_on(sb, type, format_id, path); + if (err) + return err; inode_lock(inode); F2FS_I(inode)->i_flags |= F2FS_NOATIME_FL | F2FS_IMMUTABLE_FL; |