Quota files have a different write path and are incompatible with
inlined inodes (whether data or tail inlined). To simplify the process,
inlining is disabled for quota files here.
Signed-off-by: Wu Bo <bo.wu@vivo.com>
---
fs/f2fs/data.c | 9 +++++++++
fs/f2fs/super.c | 10 ++++++++++
2 files changed, 19 insertions(+)
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 275c5739993e..6d7b6074763f 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -3641,6 +3641,15 @@ static int f2fs_write_begin(struct file *file, struct address_space *mapping,
goto fail;
}
+ if (IS_NOQUOTA(inode)) {
+ err = f2fs_convert_inline_inode(inode);
+ if (err)
+ goto fail;
+ err = f2fs_convert_inline_tail(inode);
+ if (err)
+ goto fail;
+ }
+
#ifdef CONFIG_F2FS_FS_COMPRESSION
if (f2fs_compressed_file(inode)) {
int ret;
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index d4ec32ba6cad..0f54c055f053 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -2807,6 +2807,14 @@ static int f2fs_quota_enable(struct super_block *sb, int type, int format_id,
return PTR_ERR(qf_inode);
}
+ err = f2fs_convert_inline_inode(qf_inode);
+ if (err)
+ goto out;
+
+ err = f2fs_convert_inline_tail(qf_inode);
+ if (err)
+ goto out;
+
/* Don't account quota for quota files to avoid recursion */
inode_lock(qf_inode);
qf_inode->i_flags |= S_NOQUOTA;
@@ -2818,6 +2826,8 @@ static int f2fs_quota_enable(struct super_block *sb, int type, int format_id,
inode_unlock(qf_inode);
err = dquot_load_quota_inode(qf_inode, type, format_id, flags);
+
+out:
iput(qf_inode);
return err;
}
--
2.35.3