We don't need to enable all android features for RO.

Signed-off-by: Jaegeuk Kim <[email protected]>
---
 mkfs/f2fs_format_main.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/mkfs/f2fs_format_main.c b/mkfs/f2fs_format_main.c
index 03eb748170ad..031244d5d67a 100644
--- a/mkfs/f2fs_format_main.c
+++ b/mkfs/f2fs_format_main.c
@@ -110,11 +110,16 @@ static void add_default_options(void)
                /* -d1 -f -O encrypt -O quota -O verity -w 4096 -R 0:0 */
                c.dbg_lv = 1;
                force_overwrite = 1;
+               c.wanted_sector_size = 4096;
+               c.root_uid = c.root_gid = 0;
+
+               /* RO doesn't need any other features */
+               if (c.feature & cpu_to_le32(F2FS_FEATURE_RO))
+                       return;
+
                c.feature |= cpu_to_le32(F2FS_FEATURE_ENCRYPT);
                c.feature |= cpu_to_le32(F2FS_FEATURE_QUOTA_INO);
                c.feature |= cpu_to_le32(F2FS_FEATURE_VERITY);
-               c.wanted_sector_size = 4096;
-               c.root_uid = c.root_gid = 0;
                break;
        }
 #ifdef CONF_CASEFOLD
-- 
2.32.0.288.g62a8d224e6-goog



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to