]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: check VFS mount options in mnt_diff_tables()
authorKarel Zak <kzak@redhat.com>
Wed, 18 Jul 2012 20:09:24 +0000 (22:09 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 18 Jul 2012 20:09:24 +0000 (22:09 +0200)
after "-o remount,ro" in unshared namespace is the original VFS entry
still read-write:

original:
42 21 8:2 / /boot rw,relatime - ext4 /dev/sda2 ro,user_xattr,acl,barrier=1,data=ordered

unshared + ro remount:
78 51 8:2 / /boot ro,relatime - ext4 /dev/sda2 ro,user_xattr,acl,barrier=1,data=ordered

Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/tab_diff.c

index c94bcfaa00cf7ac8e19364ed5568165a6efe6715..f01f889f804b7aa0934d8b64d1cad7f542ccc87b 100644 (file)
@@ -259,10 +259,12 @@ int mnt_diff_tables(struct libmnt_tabdiff *df, struct libmnt_table *old_tab,
                        tabdiff_add_entry(df, NULL, fs, MNT_TABDIFF_MOUNT);
                else {
                        /* is modified? */
-                       const char *o1 = mnt_fs_get_options(o_fs),
-                                  *o2 = mnt_fs_get_options(fs);
+                       const char *v1 = mnt_fs_get_vfs_options(o_fs),
+                                  *v2 = mnt_fs_get_vfs_options(fs),
+                                  *f1 = mnt_fs_get_fs_options(o_fs),
+                                  *f2 = mnt_fs_get_fs_options(fs);
 
-                       if (o1 && o2 && strcmp(o1, o2))
+                       if ((v1 && v2 && strcmp(v1, v2)) || (f1 && f2 && strcmp(f1, f2)))
                                tabdiff_add_entry(df, o_fs, fs, MNT_TABDIFF_REMOUNT);
                }
        }