Title: [5833] trunk/mm/backing-dev.c: Fix bug [#4463] bfin_nand module would be failed if inserted twice
- Revision
- 5833
- Author
- cooloney
- Date
- 2008-12-07 20:58:56 -0600 (Sun, 07 Dec 2008)
Log Message
Fix bug [#4463] bfin_nand module would be failed if inserted twice
I reported this bug to upstream. They also found it in Floppy driver.
So I backport this fixing to our svn from upstream git.
----
bdi: register sysfs bdi device only once per queue
Devices which share the same queue, like floppies and mtd devices, get
registered multiple times in the bdi interface, but bdi accounts only the
last registered device of the devices sharing one queue.
On remove, all earlier registered devices leak, stay around in sysfs, and
cause "duplicate filename" errors if the devices are re-created.
This prevents the creation of multiple bdi interfaces per queue, and the
bdi device will carry the dev_t name of the block device which is the
first one registered, of the pool of devices using the same queue.
[EMAIL PROTECTED]: add a WARN_ON so we know which drivers are misbehaving]
Tested-by: Peter Korsgaard <[EMAIL PROTECTED]>
Acked-by: Peter Zijlstra <[EMAIL PROTECTED]>
Signed-off-by: Kay Sievers <[EMAIL PROTECTED]>
Cc: David Woodhouse <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
Modified Paths
Diff
Modified: trunk/mm/backing-dev.c (5832 => 5833)
--- trunk/mm/backing-dev.c 2008-12-06 14:46:56 UTC (rev 5832)
+++ trunk/mm/backing-dev.c 2008-12-08 02:58:56 UTC (rev 5833)
@@ -176,6 +176,9 @@
int ret = 0;
struct device *dev;
+ if (WARN_ON(bdi->dev))
+ goto exit;
+
va_start(args, fmt);
dev = device_create_vargs(bdi_class, parent, MKDEV(0, 0), bdi, fmt, args);
va_end(args);
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
http://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits