Summary: | sys-apps/util-linux-2.12q-r1 - mount does not add an entry for / to /etc/mtab | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Friedrich Oslage (RETIRED) <bluebird> |
Component: | [OLD] Core system | Assignee: | Gentoo's Team for Core System packages <base-system> |
Status: | RESOLVED FIXED | ||
Severity: | minor | CC: | chainsaw, patrick |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | x86 | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | util-linux-2.12q-update_mtab-fixes.patch |
Description
Friedrich Oslage (RETIRED)
2005-09-11 16:11:00 UTC
it looks like mount/fstab.c:update_mtab() doesnt properly insert the absent entry into the double linked list when using remount Borked patch, fixed in -r2. i dont think so ... the borked patch you mention is not borked read the linked list code in fstab.c and you'll see that it is what is triggering this bug err, nm, i was confusing -n with -f ... that first hunk is wrong as you changed however, the bug i mentioned still exists with the double linked list not being updated properly Created attachment 68434 [details, diff] util-linux-2.12q-update_mtab-fixes.patch Ugh, update_mtab() is one buggy wart. This fixes a few issues with update_mtab(): - If it is a remount, and only mnt_opts needs updating, mc->m.mnt_opts is set to point to instead->mnt_opts, rather than allocating a new string, which would cause a double free if the caller actually freed the passed mnt_opts, as we free mc->m.mnt_opts before returning to the caller. - Mostly the same issue as above. If mtab does not contain the new entry, then absent->m is set to point to instead, which would have cause a double free if absent was inserted properly into the linked list, since we free all elements of absent before returning to the caller. - If mtab does not contain the new entry, then only mc0->prev is updated to point to absent, but not the old mc0->prev's nxt pointer. Because we then use the nxt pointers to write the new mtab, absent is not added to the new mtab. - If mtab is empty, absent->prev should be set to mc0, and not mc0->prev, as it will be NULL. I added it to util-linux-2.12q-r2, and did not rev bump, as you said in bug #105805 that you will do it after you checked the other patches. Also, it seems that 'mount -f -o remount' works as expected without that other patch we talked about: ----- lycan ~ # awk '$2 == "/" { print }' /etc/mtab lycan ~ # mount -f / lycan ~ # awk '$2 == "/" { print }' /etc/mtab /dev/mapper/nsw1p2 / ext3 rw,noatime 0 0 lycan ~ # rm -f /etc/mtab lycan ~ # awk '$2 == "/" { print }' /etc/mtab awk: cmd. line:1: fatal: cannot open file `/etc/mtab' for reading (No such file or directory) lycan ~ # mount -f -o remount / lycan ~ # awk '$2 == "/" { print }' /etc/mtab /dev/mapper/nsw1p2 / ext3 rw,noatime 0 0 lycan ~ # all should be resolved with 2.12q-r3 |