[BusyBox 0005634]: rmmod hangs when trying to remove a busy kernel module using delete_module() from µClibc

bugs at busybox.net bugs at busybox.net
Wed Oct 22 11:35:19 UTC 2008


A NOTE has been added to this issue. 
====================================================================== 
http://busybox.net/bugs/view.php?id=5634 
====================================================================== 
Reported By:                zaphod
Assigned To:                uClibc
====================================================================== 
Project:                    BusyBox
Issue ID:                   5634
Category:                   Kernel Module Support
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     assigned
====================================================================== 
Date Submitted:             10-22-2008 00:46 PDT
Last Modified:              10-22-2008 04:35 PDT
====================================================================== 
Summary:                    rmmod hangs when trying to remove a busy kernel
module using delete_module() from µClibc
Description: 
Busybox uses delete_module() to remove a kernel module. It assumes
delete_module() to be a function with the following prototype:

    int delete_module(const char *module, unsigned int flags);

Unfortunatly µClibc provides delete_module() as follows:

    int delete_module(const char *name);

The flags containing O_NONBLOCK gets lost on the way to the kernel and
rmmod hangs.

To fix this simply fall back to busybox own implementation, which is used
in all cases except for µClibc:

#ifdef __UCLIBC__
extern int delete_module(const char *module, unsigned int flags);
#else
# include <sys/syscall.h>
# define delete_module(mod, flags) syscall(__NR_delete_module, mod,
flags)
#endif


====================================================================== 

---------------------------------------------------------------------- 
 zaphod - 10-22-08 04:35  
---------------------------------------------------------------------- 
In a note in the µClibc delete_module report you asked, whether I could
check the syscall2 version of delete_module under a 2.4 kernel. The
following is from strace  rmmod under 2.4.32:

delete_module("ip_conntrack_ftp", O_RDONLY|O_EXCL|O_NONBLOCK) = -1 EBUSY
(Device
 or resource busy)

rmmod sets the flags to O_NONBLOCK|O_EXCL, O_RDONLY is defined as 0, so
delete_module passes the right flags to the kernel and the kernel ignores
them as expected. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
10-22-08 00:46  zaphod         New Issue                                    
10-22-08 00:46  zaphod         Status                   new => assigned     
10-22-08 00:46  zaphod         Assigned To               => BusyBox         
10-22-08 01:13  bernhardf      Assigned To              BusyBox => uClibc   
10-22-08 01:13  bernhardf      Additional Information Updated                   

10-22-08 04:35  zaphod         Note Added: 0013974                          
======================================================================




More information about the uClibc-cvs mailing list