From 46b55e83c562a472d2de5ba03a879e478859dcd5 Mon Sep 17 00:00:00 2001 From: Luis Hector Chavez Date: Sat, 21 Jul 2018 22:49:14 -0700 Subject: [PATCH] adb: Fix `adb remount` This change makes `adb remount` work again in some devices. Bug: None Test: `adb remount` in taimen Change-Id: I04ec043fdb868f18a53a012c82e239c862ae7eff --- adb/daemon/remount_service.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/adb/daemon/remount_service.cpp b/adb/daemon/remount_service.cpp index dfdc365e3..1bb2fbb3a 100644 --- a/adb/daemon/remount_service.cpp +++ b/adb/daemon/remount_service.cpp @@ -178,10 +178,6 @@ static bool remount_partition(int fd, const char* dir) { } unsigned long remount_flags = get_mount_flags(fd, dir); - if ((remount_flags & MS_RDONLY) == 0) { - // Mount is already writable. - return true; - } remount_flags &= ~MS_RDONLY; remount_flags |= MS_REMOUNT; @@ -192,7 +188,7 @@ static bool remount_partition(int fd, const char* dir) { WriteFdFmt(fd, "remount of the %s mount failed: %s.\n", dir, strerror(errno)); return false; } - if (mount(dev.c_str(), dir, "none", remount_flags, nullptr) == -1) { + if (mount(dev.c_str(), dir, "none", MS_REMOUNT, nullptr) == -1) { WriteFdFmt(fd, "remount of the %s superblock failed: %s\n", dir, strerror(errno)); return false; }