[Pkg-sysvinit-devel] Bug#529805: Bug#529805: initscripts: umountfs: pioodl() is not the function you want

Tim Phipps tim at phipps-hutton.freeserve.co.uk
Wed Jun 3 13:25:18 UTC 2009


Here's a patch, I've tested it on my system and tried a few contrived mount
scenarios and it works better than pioodl(). Here's a way to break
pioodl():

mkdir -p /tmp/1/2/3
mount LABEL=disk3 /tmp/1/2/3
mount LABEL=disk2 /tmp/1/2
mount LABEL=disk1 /tmp/1

You get a /proc/mounts that looks like this:

/dev/md3 /dev/shm/tmp/1/2/3 ext3 rw,errors=panic,data=ordered 0 0
/dev/md6 /dev/shm/tmp/1/2 ext3 rw,errors=panic,data=ordered 0 0
/dev/md7 /dev/shm/tmp/1 ext3 rw,errors=panic,data=ordered 0 0

pioodl() tries to

umount /tmp/1/2/3 /tmp/1/2 /tmp/1

and fails. With this patch the script tries to

umount /tmp/1 /tmp/1/2 /tmp/1/2/3

and succeeds.

/etc/init.d/umountnfs.sh does it this way too and looking at the source
/bin/umount takes the mountpoint and examines /etc/mtab backwards which
sort of ties in with my thinking.

Cheers,
Tim.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: umountfs.patch
URL: <http://lists.alioth.debian.org/pipermail/pkg-sysvinit-devel/attachments/20090603/c0bcaee7/attachment.txt>


More information about the Pkg-sysvinit-devel mailing list