]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
behavior as file systems that use the monolithic /sbin/mount command.
authorChuck Lever <chuck.lever@oracle.com>
Wed, 13 Oct 2010 17:57:52 +0000 (13:57 -0400)
committerSteve Dickson <steved@redhat.com>
Thu, 14 Oct 2010 14:27:00 +0000 (10:27 -0400)
See the MS_NOMTAB macro in utils-linux-ng/mount/mount.c.

Note that mount(8) has MS_USERS and MS_USER in the "nomtab" category
as well, but mount.nfs needs to record those values so that unmounting
a user-mounted NFS file system can work.

While we're here, fix some white space damage in fix_opts_string().

This is a partial fix for:

  https://bugzilla.linux-nfs.org/show_bug.cgi?id=188

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
utils/mount/mount.c
utils/mount/mount_constants.h

index 2909595b5926d63501c5dbf970e7372d19ace231..b4da21faa74508160ffde358ed96dd40074f3de6 100644 (file)
@@ -209,7 +209,7 @@ static char *fix_opts_string(int flags, const char *extra_opts)
        }
        if (flags & MS_USERS)
                new_opts = xstrconcat3(new_opts, ",users", "");
        }
        if (flags & MS_USERS)
                new_opts = xstrconcat3(new_opts, ",users", "");
-       
+
        for (om = opt_map; om->opt != NULL; om++) {
                if (om->skip)
                        continue;
        for (om = opt_map; om->opt != NULL; om++) {
                if (om->skip)
                        continue;
@@ -281,7 +281,7 @@ static int add_mtab(char *spec, char *mount_point, char *fstype,
        ment.mnt_fsname = spec;
        ment.mnt_dir = mount_point;
        ment.mnt_type = fstype;
        ment.mnt_fsname = spec;
        ment.mnt_dir = mount_point;
        ment.mnt_type = fstype;
-       ment.mnt_opts = fix_opts_string(flags, opts);
+       ment.mnt_opts = fix_opts_string(flags & ~MS_NOMTAB, opts);
        ment.mnt_freq = freq;
        ment.mnt_passno = pass;
 
        ment.mnt_freq = freq;
        ment.mnt_passno = pass;
 
index cbfb099df99a0458fcd12ff0d180573a78814bdf..4d050d8819e4953a8f79c69c2a3a245ce70c2b5f 100644 (file)
@@ -64,4 +64,8 @@ if we have a stack or plain mount - mount atop of it, forming a stack. */
 #define MS_MGC_MSK 0xffff0000  /* magic flag number mask */
 #endif
 
 #define MS_MGC_MSK 0xffff0000  /* magic flag number mask */
 #endif
 
+/* Generic options that are prevented from appearing
+ * in the options field in /etc/mtab. */
+#define MS_NOMTAB      (MS_REMOUNT)
+
 #endif /* _NFS_UTILS_MOUNT_CONSTANTS_H */
 #endif /* _NFS_UTILS_MOUNT_CONSTANTS_H */