From: Matthias Koenig Date: Fri, 24 Aug 2007 11:05:27 +0000 (+0200) Subject: mount: avoid duplicates for root fs in mtab X-Git-Tag: v2.13~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=309fd2e79370be77c192ec272657aef9a5320ffb;p=thirdparty%2Futil-linux.git mount: avoid duplicates for root fs in mtab If the root fs is defined with LABEL or UUID in fstab, avoid a duplicate entry in mtab when calling mount without existing mtab. A mount -f / creates two entries, one for LABEL and another for the devicename, because canonicalize does not expand the LABEL or UUID tags. Signed-off-by: Matthias Koenig --- diff --git a/mount/mount.c b/mount/mount.c index 83d55e0c68..40699f33d1 100644 --- a/mount/mount.c +++ b/mount/mount.c @@ -541,7 +541,7 @@ create_mtab (void) { char *extra_opts; parse_opts (fstab->m.mnt_opts, &flags, &extra_opts); mnt.mnt_dir = "/"; - mnt.mnt_fsname = canonicalize (fstab->m.mnt_fsname); + mnt.mnt_fsname = fsprobe_get_devname(fstab->m.mnt_fsname); mnt.mnt_type = fstab->m.mnt_type; mnt.mnt_opts = fix_opts_string (flags, extra_opts, NULL); mnt.mnt_freq = mnt.mnt_passno = 0;