Bug#317062: umount -a hangs in strcmp with 2.6.11/12

2005-12-12 Thread Colin Watson
tags 317062 patch
thanks

On Fri, Dec 09, 2005 at 11:18:43AM +, Colin Watson wrote:
> On Wed, Jul 06, 2005 at 01:37:58AM +0300, Joey Hess wrote:
> > On 2.6.11 or 2.6.12 on i386, in d-i, but ONLY if the d-i image is built
> > to use initramfs, and not it if uses a regular initrd, when /proc,
> > /dev/pts and /dev are mounted, umount -a hangs. strace shows it has
> > called umount syscall on each of these; /dev and /dev/pts are busy and
> > fail. ltrace shows it spinning in a strcmp loop. gdb shows it hanging in
> > mtab_getinfo, looks like the linked list has a loop in it.
> 
> I finally got fed up of the workarounds and decided to track this down.
> In fact it doesn't look like the linked list has a loop, but rather that
> mtab_getinfo just forgets to step its cur pointer if it encounters a
> rootfs. Patch follows (untested as yet, but I'm in the process of
> testing it now):

This patch works. Please apply it.

Cheers,

-- 
Colin Watson   [EMAIL PROTECTED]


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#317062: umount -a hangs in strcmp with 2.6.11/12

2005-12-09 Thread Colin Watson
On Wed, Jul 06, 2005 at 01:37:58AM +0300, Joey Hess wrote:
> Package: busybox-udeb
> Version: 1:1.00-3
> Severity: important
> Tags: d-i
> 
> On 2.6.11 or 2.6.12 on i386, in d-i, but ONLY if the d-i image is built
> to use initramfs, and not it if uses a regular initrd, when /proc,
> /dev/pts and /dev are mounted, umount -a hangs. strace shows it has
> called umount syscall on each of these; /dev and /dev/pts are busy and
> fail. ltrace shows it spinning in a strcmp loop. gdb shows it hanging in
> mtab_getinfo, looks like the linked list has a loop in it.

I finally got fed up of the workarounds and decided to track this down.
In fact it doesn't look like the linked list has a loop, but rather that
mtab_getinfo just forgets to step its cur pointer if it encounters a
rootfs. Patch follows (untested as yet, but I'm in the process of
testing it now):

diff -u busybox-1.01/debian/changelog busybox-1.01/debian/changelog
--- busybox-1.01/debian/changelog
+++ busybox-1.01/debian/changelog
@@ -1,3 +1,9 @@
+busybox (1:1.01-3.1) UNRELEASED; urgency=low
+
+  * Fix infinite loop in umount -a when encountering a rootfs mount point.
+
+ -- Colin Watson <[EMAIL PROTECTED]>  Fri,  9 Dec 2005 11:14:08 +
+
 busybox (1:1.01-3) unstable; urgency=low
 
   * debian/config-deb:
diff -u busybox-1.01/util-linux/umount.c busybox-1.01/util-linux/umount.c
--- busybox-1.01/util-linux/umount.c
+++ busybox-1.01/util-linux/umount.c
@@ -111,6 +111,7 @@
} else {
 #if !defined CONFIG_FEATURE_MTAB_SUPPORT
if (strcmp(cur->device, "rootfs") == 0) {
+   cur = cur->next;
continue;
} else if (strcmp(cur->device, "/dev/root") == 
0) {
/* Adjusts device to be the real root 
device,

Cheers,

-- 
Colin Watson   [EMAIL PROTECTED]


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#317062: umount -a hangs in strcmp with 2.6.11/12

2005-07-05 Thread Joey Hess
Package: busybox-udeb
Version: 1:1.00-3
Severity: important
Tags: d-i

On 2.6.11 or 2.6.12 on i386, in d-i, but ONLY if the d-i image is built
to use initramfs, and not it if uses a regular initrd, when /proc,
/dev/pts and /dev are mounted, umount -a hangs. strace shows it has
called umount syscall on each of these; /dev and /dev/pts are busy and
fail. ltrace shows it spinning in a strcmp loop. gdb shows it hanging in
mtab_getinfo, looks like the linked list has a loop in it.

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.4.27
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)

-- 
see shy jo


signature.asc
Description: Digital signature