After commit 7f7b227f8a8eda5603b58899597c2fdee2a73ab7 "libmount: don't
base GC startup on no-mtab context" was applied, behavior of the new
mount.nilfs2 (libmount based implementation) was slightly changed.  It
now invokes cleanerd even when no-mtab option "-n" is specified.

This patch makes a similiar change to the legacy mount.nilfs2, and
updates the manpage of mount.nilfs2 to reflect the change.

Signed-off-by: Ryusuke Konishi <[email protected]>
---
 man/mount.nilfs2.8        |    5 +----
 sbin/mount/mount.nilfs2.c |    9 +++------
 2 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/man/mount.nilfs2.8 b/man/mount.nilfs2.8
index 8f0115e..5f3c464 100644
--- a/man/mount.nilfs2.8
+++ b/man/mount.nilfs2.8
@@ -64,10 +64,7 @@ and handling of pseudo mount options.
 .TP
 .B \-n
 Mount without writing in \fI/etc/mtab\fP.  This is necessary for
-example when \fI/etc\fP is on a read-only file system.  With this
-option, invocation of \fBnilfs_cleanerd\fP(8) is skipped.
-To add entries to mtab and invoke the garbage collector later, the
-\fB-f\fP option is available.
+example when \fI/etc\fP is on a read-only file system.
 .TP
 .B \-r
 Mount the file system read-only.  A synonym is \fB"\-o ro"\fP.
diff --git a/sbin/mount/mount.nilfs2.c b/sbin/mount/mount.nilfs2.c
index 72aa07a..e9cb25e 100644
--- a/sbin/mount/mount.nilfs2.c
+++ b/sbin/mount/mount.nilfs2.c
@@ -528,12 +528,6 @@ static void update_mount_state(struct nilfs_mount_info *mi,
 
        rungc = (find_opt(mo->extra_opts, nogc_opt_fmt, NULL) < 0) && 
!(mo->flags & MS_RDONLY) && !(mo->flags & MS_BIND);
 
-       if (!check_mtab()) {
-               if (rungc)
-                       printf(_("%s not started\n"), NILFS_CLEANERD_NAME);
-               return;
-       }
-
        if (rungc) {
                if (find_opt(mo->extra_opts, pp_opt_fmt, &pp) < 0)
                        pp = mi->protperiod;
@@ -545,6 +539,9 @@ static void update_mount_state(struct nilfs_mount_info *mi,
                               NILFS_CLEANERD_NAME);
        }
 
+       if (!check_mtab())
+               return;
+
        my_free(mi->optstr);
        exopts = fix_extra_opts_string(mo->extra_opts, pid, pp);
        mi->optstr = fix_opts_string(((mo->flags & ~MS_NOMTAB) | MS_NETDEV),
-- 
1.7.9.4

--
To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to