Once f2fs_stop_checkpoint makes f2fs as readonly, only /proc/mounts shows RDONLY whereas /etc/mtab does not.
Signed-off-by: Jaegeuk Kim <[email protected]> --- lib/libf2fs.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/libf2fs.c b/lib/libf2fs.c index d61eb85..5eb5c33 100644 --- a/lib/libf2fs.c +++ b/lib/libf2fs.c @@ -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; -- 2.6.3 ------------------------------------------------------------------------------ Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
