]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: fix utab entry on remount
authorKarel Zak <kzak@redhat.com>
Wed, 19 Nov 2014 10:10:55 +0000 (11:10 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 19 Nov 2014 10:10:55 +0000 (11:10 +0100)
mount(8) command does not set ROOT= field to utab entry on remount,
for example:

mount -oremount,_netdev /mnt

Reported-by: Chris Leech <cleech@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/context.c

index 1620e9c8e954c8e10dd8bd97185e20f1a948aee2..a320b3e6b67d103466668540650d7e0bd3ff2165 100644 (file)
@@ -1993,6 +1993,9 @@ static int apply_table(struct libmnt_context *cxt, struct libmnt_table *tb,
        if (!rc && !mnt_fs_get_fstype(cxt->fs))
                rc = mnt_fs_set_fstype(cxt->fs, mnt_fs_get_fstype(fs));
 
+       if (!rc && !mnt_fs_get_root(cxt->fs) && mnt_fs_get_root(fs))
+               rc = mnt_fs_set_root(cxt->fs, mnt_fs_get_root(fs));
+
        if (rc)
                return rc;