From 36755637ca8e9ff0c6e83b42a710f4c2855a3fc3 Mon Sep 17 00:00:00 2001 From: Jaegeuk Kim Date: Mon, 19 Sep 2022 18:37:34 -0700 Subject: [PATCH] fs_mgr: remove atgc mount option for zoned device F2FS gives EINVAL when trying to mount zoned device with atgc. This patch allows to keep the single fstab to support legacy and zoned devices at the same time. Signed-off-by: Jaegeuk Kim Change-Id: I47a667443e7e60cb6729553b2ca24026e21fd90d --- fs_mgr/fs_mgr_fstab.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fs_mgr/fs_mgr_fstab.cpp b/fs_mgr/fs_mgr_fstab.cpp index 43961da12..76ef9e4b9 100644 --- a/fs_mgr/fs_mgr_fstab.cpp +++ b/fs_mgr/fs_mgr_fstab.cpp @@ -309,6 +309,12 @@ bool ParseFsMgrFlags(const std::string& flags, FstabEntry* entry) { if (ReadFileToString("/sys/class/block/" + arg + "/queue/zoned", &zoned) && android::base::StartsWith(zoned, "host-managed")) { entry->zoned_device = "/dev/block/" + arg; + + // atgc in f2fs does not support a zoned device + auto options = Split(entry->fs_options, ","); + options.erase(std::remove(options.begin(), options.end(), "atgc"), options.end()); + entry->fs_options = android::base::Join(options, ","); + LINFO << "Removed ATGC in fs_options as " << entry->fs_options; } else { LWARNING << "Warning: cannot find the zoned device: " << arg; }