Fixes a problem when you define a device via a persistent
udev device name in /etc/fstab but use the real block device
name on mount invocation.
Signed-off-by: Karel Zak <kzak@redhat.com>
struct mntentchn *mc, *mc0;
mc0 = fstab_head();
+
+ /* canonical devname in fstab */
for (mc = mc0->nxt; mc && mc != mc0; mc = mc->nxt)
if (streq(mc->m.mnt_fsname, devname))
return mc;
+
+ /* noncanonical devname in fstab */
+ for (mc = mc0->nxt; mc && mc != mc0; mc = mc->nxt) {
+ char *fs = canonicalize(mc->m.mnt_fsname);
+ if (streq(fs, devname)) {
+ free(fs);
+ return mc;
+ }
+ free(fs);
+ }
+
return NULL;
}