Bug 2281

Summary: button driver calls remove_proc_entry() on a directory that is not empty
Product: ACPI Reporter: Arjan van de Ven (arjan)
Component: OtherAssignee: Luming Yu (luming.yu)
Status: CLOSED CODE_FIX    
Severity: normal CC: acpi-bugzilla
Priority: P2    
Hardware: i386   
OS: Linux   
Kernel Version: 2.6.4-rc3 Subsystem:
Regression: --- Bisected commit-id:
Attachments: a proposal
patch for removing fixed button cleanly, against 2.6 kernel

Description Arjan van de Ven 2004-03-10 08:21:26 UTC
Distribution: FC2test

modprobe button
rmmod button
triggers an assert in remove_proc_entry() which we added to avoid datacorruption,
eg on calling remove_proc_entry() on a non-empty directory.
------------[ cut here ]------------
kernel BUG at fs/proc/generic.c:664!
invalid operand: 0000 [#1]
SMP
CPU:    1
EIP:    0060:[<0219300d>]    Not tainted
EFLAGS: 00010202   (2.6.3-2.1.247.rootsmp)
EIP is at remove_proc_entry+0xa6/0xf5
eax: 39fd9ee0   ebx: 4287e5f5   ecx: 00000000   edx: 39fd9ee0
esi: 39fd9ee0   edi: 413a9d98   ebp: 00000006   esp: 18f0df50
ds: 007b   es: 007b   ss: 0068
Process rmmod (pid: 2987, threadinfo=18f0d000 task=03ed0770)
Stack: 39fd9eb0 4287e5f5 4287ef80 00000000 022eeb38 18f0d000 4287e4b2 0213becf
       00000000 74747562 11006e6f 11fd2318 f7098000 021548aa 381b29ec f7099000
       02154d40 11fd2354 381b2318 20d813e4 00000246 11fd2318 11fd2340 00000000
Call Trace:
 [<4287e4b2>] acpi_button_exit+0x1a/0x1b [button]
 [<0213becf>] sys_delete_module+0x100/0x121
 [<021548aa>] unmap_vma_list+0xe/0x17
 [<02154d40>] do_munmap+0x189/0x195
 
Code: 0f 0b 98 02 5a de 2b 02 8b 47 40 85 c0 75 09 89 f8 e8 0c ff
Comment 1 Len Brown 2004-03-10 17:46:08 UTC
another related issue.
I don't think we should have empty /proc/acpi/foo/ directories
maybe there is a simple way to remove them when we decide that there will be 
no contents?
Comment 2 Luming Yu 2004-03-31 06:05:10 UTC
Created attachment 2465 [details]
a proposal

 Note: fixed feature button can not be removed from 
acpi_bus_unregister_driver(&acpi_button_driver);

--Luming
Comment 3 Len Brown 2004-04-15 23:58:03 UTC
reported also at Red Hat 
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=119954 
 
Comment 4 Luming Yu 2004-04-27 23:43:57 UTC
Created attachment 2738 [details]
patch for removing fixed button cleanly, against 2.6 kernel
Comment 5 Len Brown 2004-05-11 23:32:40 UTC
shipped in 2.6.6, and on top of 2.4.27-pre2 -- closing.