Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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]>
- Loading branch information