Patchwork WARNINGs because of ide-proc handling

login
register
mail settings
Submitter Wolfram Sang
Date Aug. 31, 2010, 8:56 p.m.
Message ID <20100831205605.GA23636@pengutronix.de>
Download mbox | patch
Permalink /patch/63317/
State RFC
Delegated to: David Miller
Headers show

Comments

Wolfram Sang - Aug. 31, 2010, 8:56 p.m.
Hello,

I get the following warning (and some similar ones) on my laptop running
2.6.36-rc3 when removing a CF card via pcmcia:

[ 1087.602129] WARNING: at fs/proc/generic.c:816 remove_proc_entry+0x185/0x1d0()
[ 1087.602137] Hardware name: Amilo M14255
[ 1087.602142] name 'cache'
...

It turned out that none of the entries in ide_disk_proc[] gets created when
inserting the card, so trying to remove them triggers this warning. Adding
some debug printouts

========

results in:

[    9.040157] *** wsa: cache - (null) - 1

This shows that the path needed for those proc-entries does not exist at this
moment (pointer is null). So the callchain for creating all the proc-entries
seems to be disordered? The entries are present for my hard-disk, though.

Kind regards,

   Wolfram
David Miller - Sept. 2, 2010, 2:33 a.m.
From: Wolfram Sang <w.sang@pengutronix.de>
Date: Tue, 31 Aug 2010 22:56:05 +0200

> Hello,
> 
> I get the following warning (and some similar ones) on my laptop running
> 2.6.36-rc3 when removing a CF card via pcmcia:
> 
> [ 1087.602129] WARNING: at fs/proc/generic.c:816 remove_proc_entry+0x185/0x1d0()
> [ 1087.602137] Hardware name: Amilo M14255
> [ 1087.602142] name 'cache'
> ...
> 
> It turned out that none of the entries in ide_disk_proc[] gets created when
> inserting the card, so trying to remove them triggers this warning. Adding
> some debug printouts

Hmmm, at some point ide_host_add() or ide_host_register() should be invoked,
which should create the drive->proc and hwif->proc PROCFS directories.

What driver is your pcmcia IDE card using?
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

========

diff --git a/drivers/ide/ide-proc.c b/drivers/ide/ide-proc.c
index a3133d7..5016a54 100644
--- a/drivers/ide/ide-proc.c
+++ b/drivers/ide/ide-proc.c
@@ -650,6 +651,7 @@  void ide_proc_register_driver(ide_drive_t *drive, struct ide_driver *driver)
        drive->settings = driver->proc_devsets(drive);
        mutex_unlock(&ide_setting_mtx);
 
+       printk(KERN_INFO "*** wsa: %s - %p - %d\n", driver->proc_entries(drive)->name, drive->proc, (drive->media == ide_disk));
        ide_add_proc_entries(drive->proc, driver->proc_entries(drive), drive);
 }