summaryrefslogtreecommitdiffstats
path: root/libmount/src/context.c
diff options
context:
space:
mode:
authorKarel Zak2014-11-19 11:10:55 +0100
committerKarel Zak2014-11-19 11:10:55 +0100
commitedda9f8a15d25a6c208a444c41e994421b73c0a3 (patch)
tree0cd942ec88d7a735d74a2befdb046f62189d3569 /libmount/src/context.c
parentlibmount: add private mnt_context_get_mtab_for_target() (diff)
downloadkernel-qcow2-util-linux-edda9f8a15d25a6c208a444c41e994421b73c0a3.tar.gz
kernel-qcow2-util-linux-edda9f8a15d25a6c208a444c41e994421b73c0a3.tar.xz
kernel-qcow2-util-linux-edda9f8a15d25a6c208a444c41e994421b73c0a3.zip
libmount: fix utab entry on remount
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>
Diffstat (limited to 'libmount/src/context.c')
-rw-r--r--libmount/src/context.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libmount/src/context.c b/libmount/src/context.c
index 1620e9c8e..a320b3e6b 100644
--- a/libmount/src/context.c
+++ b/libmount/src/context.c
@@ -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;