Bug 4796

Summary: 2.6.12-mm1 crashes on unmounting partition
Product: Other Reporter: Alexander Hunziker (alex.hunziker)
Component: OtherAssignee: Robert Love (rlove)
Status: CLOSED CODE_FIX    
Severity: high CC: aia21, bunk, rlove, ttb
Priority: P2    
Hardware: i386   
OS: Linux   
Kernel Version: 2.6.12-mm1 Subsystem:
Regression: --- Bisected commit-id:
Attachments: inotify for 2.6.12
Patch to fix the hangs on umount.

Description Alexander Hunziker 2005-06-24 14:49:37 UTC
Distribution: Arch Linux
Hardware Environment: 845 Chipset, HDD connected via ATA Port.
Software Environment: 
Problem Description: Upon shutdown, while trying to unmount the filesystems, my
system hangs. Message is (excerpt):

Soft lockup detected on CPU#0!
inotify_unmount_inodes+0x2d/0x110

Steps to reproduce:
Comment 1 Andrew Morton 2005-06-24 14:59:28 UTC
Was there no stack trace?
Comment 2 Robert Love 2005-06-24 15:05:59 UTC
What are the types of your filesystem(s) ?

And, echoing Andrew, can we get a full backtrace?
Comment 3 Alexander Hunziker 2005-06-24 15:39:03 UTC
Filesystems are ext3.

The complete text that was on the screen (is that a "trace"?)

[17205917.092000] BUG: Soft lockup detected on CPU#0!
[17205917.092000] Pid: 29301, comm: umount
[17205917.092000] EIP: 0060: [<c01974b7>] CPU:0
[17205917.092000] EIP is at inotify_unmount_inodex +0x27/0x110
[17205917.092000] EFLAGS: 00000202 Tainted: PF (2.6.12-mm1-ARCH)
[17205917.092000] EAX: caa228d4 EBX: c88f3f0c ECX: 00000001 EDX: caa228d4
[17205917.092000] ESI: caa22784 EDI: caa228c4 EBP: caa22784 DS: 007b ES: 007b
[17205917.092000] CR0: 8005003b CR2: b7f19000 CR3: 18ed9000 CR4: 000006d0
[17205917.092000] [<c0187e90>] invalidate_inodex+0x40/0x80
[17205917.092000] [<c0171ea0>] generic_shutdown_super+0x70/0x180
[17205917.092000] [<c0172b6e>] kill_block_super+0x2e/0x50
[17205917.092000] [<c0171d61>] deativate_super+0x61/0x80
[17205917.092000] [<c018b4ef>] sys_unmount+0x3f/0xa0
[17205917.092000] [<c018b545>] sys_oldumount+0x15/0x20
[17205917.092000] [<c01031ab>] sysenter_past_esp+0x54/0x75
Comment 4 John McCutchan 2005-06-26 08:15:57 UTC
What patches have you applied to your kernel?
Had you used inotify while the system was up?
Comment 5 Robert Love 2005-06-26 12:09:17 UTC
What is the -ARCH patch?

Can you try to reproduce with just 2.6.12+inotify?
Comment 6 Robert Love 2005-06-26 12:10:17 UTC
Created attachment 5217 [details]
inotify for 2.6.12
Comment 7 Alexander Hunziker 2005-06-26 12:52:08 UTC
It's really just the 2.6.12 kernel with the mm patchset applied. I didn't
compile the kernel myself, it's the kernel26mm package from Arch Linux. So
"-ARCH" is NO patch, it's just an identifier for the kernel. You can find the
config file and the build script at

http://cvs.archlinux.org/cgi-bin/viewcvs.cgi/kernels/kernel26mm/?cvsroot=Extra&only_with_tag=CURRENT

Also, I do use inotify: beagled is running and a gamin compiled with inotify
support.
Comment 8 Robert Love 2005-06-26 13:06:45 UTC
Ah, okay.  Fair enough.

We were--are still--curious why you'd soft lockup there (I presume that is some
NMI watchdog thing).  The loop should complete fine.

Hm...
Comment 9 Alexander Hunziker 2005-06-27 12:12:01 UTC
OK, some further information. As of today, there is a new kernel package in
Arch's testing repository. It's a 2.6.12.1 kernel, patched with inotify 0.23.
With this one, I experience the same problems on shutdown. It does however not
give any information like the one I posted earlier, it just hangs.

If I boot into the system w/o logging in (and thus running beagled and gamin)
and shut down again, it works fine. So it clearly only happens when some
application used inotify. I did test it with beagled run from a command line.
After that, again, I couldn't shut down the system.
Comment 10 Alexander Hunziker 2005-06-27 12:33:25 UTC
It also happens when I only use gamin, but not beagled. So the type of
application using inotify doesn't seem to matter. Also, (not surprising), it is
upon unmounting my /home partition the system crashes, for the / partition is
never recovering journals upon the next boot.

There is an entry in Arch Linux' Bugtracker for the same subject now:

http://bugs.archlinux.org/index.php?do=details&id=2887
Comment 11 John McCutchan 2005-06-28 16:02:23 UTC
Alexander, could you try and reproduce with the patch robert just released?
Comment 12 Alexander Hunziker 2005-06-29 06:52:27 UTC
Did try with the newest inotify patch. Problem persists.
Comment 13 Anton Altaparmakov 2005-07-05 00:44:43 UTC
Created attachment 5266 [details]
Patch to fix the hangs on umount.

This patch fixes the hangs at umount triggered by inotify.
Comment 14 Anton Altaparmakov 2005-07-05 00:48:21 UTC
Comment on attachment 5266 [details]
Patch to fix the hangs on umount.

Hm, I think IE on Mac OS 9 ate the whitespace.	Will post a url instead...
Comment 15 Anton Altaparmakov 2005-07-05 00:52:36 UTC
Create a New Attachment -> URL fails for me as it keeps saying there is 
no file specified!  so here is the URL for the patch.  This should hopefully 
have the whitespace intact:

http://lkml.org/lkml/2005/7/4/149
Comment 16 Alexander Hunziker 2005-07-10 06:07:27 UTC
What are the plans for this one? Is it going to be integrated in the next
inotify patch?
Comment 17 Anton Altaparmakov 2005-07-10 06:31:10 UTC
It is already in the latest inotify patch.
Comment 18 Alexander Hunziker 2005-07-10 07:37:51 UTC
Robert, is it possible to publish an up to date patch against the stable kernel
2.6.12.2?
Comment 19 Andrew Morton 2005-07-28 22:35:53 UTC
I think we can close this one, yes?
Comment 20 Anton Altaparmakov 2005-07-29 01:12:45 UTC
Yes.