]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: don't use MS_MGC_VAL magic in mount(2) syscall
authorKarel Zak <kzak@redhat.com>
Fri, 1 Jun 2018 10:29:14 +0000 (12:29 +0200)
committerKarel Zak <kzak@redhat.com>
Fri, 1 Jun 2018 10:29:14 +0000 (12:29 +0200)
Specifying MS_MGC_VAL was required in kernel versions prior to 2.4,
but since Linux 2.4 is no longer required and is ignored if specified

The minimal kernel requirement for util-linux is Linux v2.6.

Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/context_mount.c
libmount/src/context_umount.c
libmount/src/libmount.h.in

index a8e84127cfe6352bc4f283394d6fa53137dc09e9..6207bd8148f1311337f3ff659d03f55f346d52bb 100644 (file)
@@ -764,8 +764,6 @@ static int do_mount(struct libmnt_context *cxt, const char *try_type)
        }
        type = try_type ? : mnt_fs_get_fstype(cxt->fs);
 
-       if (!(flags & MS_MGC_MSK))
-               flags |= MS_MGC_VAL;
        if (try_type)
                flags |= MS_SILENT;
 
index 240ec3be69db77e097872e4102f453ed39fcf4aa..81a650352c27608eef04d24e4b845e867427b763 100644 (file)
@@ -737,7 +737,7 @@ static int do_umount(struct libmnt_context *cxt)
                        -cxt->syscall_status));
 
                rc = mount(src, mnt_fs_get_target(cxt->fs), NULL,
-                           MS_MGC_VAL | MS_REMOUNT | MS_RDONLY, NULL);
+                           MS_REMOUNT | MS_RDONLY, NULL);
                if (rc < 0) {
                        cxt->syscall_status = -errno;
                        DBG(CXT, ul_debugobj(cxt,
index c61514b59110e7193c429159e85e088ad27ca72a..e12a90f079847d9c96110ce482180ceda149a9aa 100644 (file)
@@ -938,7 +938,8 @@ extern int mnt_context_set_syscall_status(struct libmnt_context *cxt, int status
 
 
 /*
- * Magic mount flag number. Had to be or-ed to the flag values.
+ * Magic mount flag number. Had to be or-ed to the flag values.  Deprecated and
+ * no more used since libmount v2.33; required for Linux <= 2.4.
  */
 #ifndef MS_MGC_VAL
 #define MS_MGC_VAL 0xC0ED0000  /* magic flag number to indicate "new" flags */