2.0.35 :: Translate "Oops" of removing a procfs entry.

Andre M. Hedrick (hedrick@Astro.Dyer.Vanderbilt.Edu)
Sun, 2 Aug 1998 23:29:23 -0500 (CDT)


What does this mean?
The results of this break the /proc fs directory.

Unable to handle kernel paging request at virtual address c481bba0
current->tss.cr3 = 03bcd000, Lr3 = 03bcd000
*pde = 00315067
*pte = 00000000
Oops: 0000
CPU: 1
EIP: 0010:[proc_match+18/88]
EFLAGS: 00010216
eax: 00164000 ebx: 0481bba0 ecx: 00000006 edx: 0481bba0
esi: 0354c006 edi: 03fbf900 ebp: 0354c006 esp: 03bd0ec8
ds: 0018 es: 0018 fs: 002b gs: 002b ss: 0018
Process watchdog (pid: 60, process nr: 21, stackpage=03bd0000)
Stack: 00000006 03fbf900 0016f3b4 00000006 0354c006 0481bba0 00000006 0354c006
03bd0f64 03fbf900 0016f442 03fbf900 0354c006 00000006 03bd0f64 03fbf900
00000001 00000006 03bd0f64 00133b96 00133a32 03fbf900 0354c006 00000006
Call Trace: [proc_lookup+204/308] [<0481bba0>] [proc_root_lookup+38/236]
[dir_namei+226/324] [lookup+218/240] [open_namei+521/1040]
[do_open+79/296]
[sys_open+61/132] [system_call+283/340]
Code: 66 83 3a 00 74 38 85 c9 75 18 8b 42 04 80 38 2e 75 10 80 78

If someone would explain what I have done wrong under the 2.0.X kernel
for removing an entry that I have added to the /proc directory
when unloading a misc_device_driver that I have written.

<source code at end>

This is only effected under the stable kernel, the development kernel
handles this request without complaints.

Is the removal of a procfs file the default if you unload a driver?
If you reload a newer version of driver, does it remember that
you have done "proc_register_dynamic" earlier?

Regards,
Andre Hedrick

#ifdef _PROCFS
#if LINUX_VERSION_CODE < TTGPS_LINUX_VERSION(2,1,0)
static struct proc_dir_entry proc_ttgps_entry = {
0, 5, "ttgps",
S_IFREG | S_IRUGO, 1,
0, 0, 0, 0,
get_info_ttgps, NULL,
NULL, &proc_root, NULL };
#else /* version >= v2.1.0 */
struct proc_dir_entry *proc_ttgps;
#endif /* version >= v2.1.0 */
#endif /* _PROCFS */

.............

/*****************************************************************************/
#if LINUX_VERSION_CODE < TTGPS_LINUX_VERSION(2,1,0)
int ttgps_init(void)
#else /* version >= v2.1.0 */
__initfunc(int ttgps_init(void))
#endif /* version >= v2.1.0 */

................

#ifdef _PROCFS
#if LINUX_VERSION_CODE < TTGPS_LINUX_VERSION(2,1,0)
proc_register_dynamic(&proc_root, &proc_ttgps_entry);
#else /* version >= v2.1.0 */
if ((proc_ttgps = create_proc_entry( "ttgps", 0, 0 )))
proc_ttgps->get_info = get_info_ttgps;
#endif /* version >= v2.1.0 */
#endif /* _PROCFS */

.................

error_end:

return((ret)?ret:-EINVAL); }

#ifdef MODULE
#if LINUX_VERSION_CODE > TTGPS_LINUX_VERSION(2,1,0)
/*
MODULE_AUTHOR("author=");
MODULE_DESCRIPTION("description=");
MODULE_SUPPORTED_DEVICE("ttgps=");
*/
MODULE_PARM(ttgps_port,"i");
MODULE_PARM(ttgps_irq,"i");
MODULE_PARM(ttgps_debug,"i");
#endif /* version >= v2.1.0 */

int init_module(void)
{ return(ttgps_init()); }

void cleanup_module(void)
{ IFDEBUG(10) printk("\nTTPGS : cleanup module\n");
#ifdef _PROCFS
IFDEBUG(10) printk("TTPGS : Clearing Procfs\n");
#if LINUX_VERSION_CODE < TTGPS_LINUX_VERSION(2,1,0)
proc_unregister(&proc_ttgps_entry, proc_ttgps_entry.low_ino);
#else /* version >= v2.1.0 */
if (proc_ttgps)
remove_proc_entry("ttgps", proc_ttgps->parent);
#endif /* version >= v2.1.0 */
#endif /* _PROCFS */

..................

IFDEBUG(10) printk("TTPGS : De-Registering Driver.\n");
misc_deregister(&ttgps_dev);
IFDEBUG(10) printk("TTPGS : Releasing IO Base.\n");
release_region(ttgps_port, 0x80); }
#endif /* !MODULE */

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html