mirror of
https://gitee.com/openharmony/third_party_f2fs-tools
synced 2025-02-17 01:19:53 +00:00
fsck.f2fs: check /proc/mounts first to detect readonly
Once f2fs_stop_checkpoint makes f2fs as readonly, only /proc/mounts shows RDONLY whereas /etc/mtab does not. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
f8bc97b333
commit
50aa77b1d3
@ -530,17 +530,17 @@ int f2fs_dev_is_umounted(struct f2fs_configuration *c)
|
||||
struct stat st_buf;
|
||||
int ret = 0;
|
||||
|
||||
ret = is_mounted(MOUNTED, c->device_name);
|
||||
/*
|
||||
* try with /proc/mounts fist to detect RDONLY.
|
||||
* f2fs_stop_checkpoint makes RO in /proc/mounts while RW in /etc/mtab.
|
||||
*/
|
||||
ret = is_mounted("/proc/mounts", c->device_name);
|
||||
if (ret) {
|
||||
MSG(0, "Info: Mounted device!\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* if failed due to /etc/mtab file not present
|
||||
* try with /proc/mounts.
|
||||
*/
|
||||
ret = is_mounted("/proc/mounts", c->device_name);
|
||||
ret = is_mounted(MOUNTED, c->device_name);
|
||||
if (ret) {
|
||||
MSG(0, "Info: Mounted device!\n");
|
||||
return -1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user