projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d9dde59
)
[PATCH] dm: free minor after unlink gendisk
author
Jun'ichi Nomura
<
[email protected]
>
Fri, 24 Feb 2006 21:04:25 +0000
(13:04 -0800)
committer
Linus Torvalds
<
[email protected]
>
Fri, 24 Feb 2006 22:31:39 +0000
(14:31 -0800)
Minor number should be freed after del_gendisk(). Otherwise, there could
be a window where 2 registered gendisk has same minor number.
Signed-off-by: Jun'ichi Nomura <
[email protected]
>
Acked-by: Alasdair G Kergon <
[email protected]
>
Cc: <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
drivers/md/dm.c
patch
|
blob
|
history
diff --git
a/drivers/md/dm.c
b/drivers/md/dm.c
index dad9e403d59de3ac4732f625d4c672f74647e925..745ca1f67b14a93db8e7c2802746d7963641aa7e 100644
(file)
--- a/
drivers/md/dm.c
+++ b/
drivers/md/dm.c
@@
-849,14
+849,16
@@
static struct mapped_device *alloc_dev(unsigned int minor, int persistent)
static void free_dev(struct mapped_device *md)
{
+ unsigned int minor = md->disk->first_minor;
+
if (md->suspended_bdev) {
thaw_bdev(md->suspended_bdev, NULL);
bdput(md->suspended_bdev);
}
- free_minor(md->disk->first_minor);
mempool_destroy(md->tio_pool);
mempool_destroy(md->io_pool);
del_gendisk(md->disk);
+ free_minor(minor);
put_disk(md->disk);
blk_put_queue(md->queue);
kfree(md);