* [PATCH] xen-blkfront: module exit handling adjustments
@ 2012-04-05 15:04 Jan Beulich
0 siblings, 0 replies; 2+ messages in thread
From: Jan Beulich @ 2012-04-05 15:04 UTC (permalink / raw)
To: Jeremy Fitzhardinge, Konrad Rzeszutek Wilk
Cc: Jens Axboe, linux-kernel, xen-devel
The blkdev major must be released upon exit, or else the module can't
attach to devices using the same majors upon being loaded again. Also
avoid leaking the minor tracking bitmap.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
drivers/block/xen-blkfront.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- 3.4-rc1/drivers/block/xen-blkfront.c
+++ 3.4-rc1-xen-blkfront-exit-cleanup/drivers/block/xen-blkfront.c
@@ -1497,7 +1497,9 @@ module_init(xlblk_init);
static void __exit xlblk_exit(void)
{
- return xenbus_unregister_driver(&blkfront_driver);
+ xenbus_unregister_driver(&blkfront_driver);
+ unregister_blkdev(XENVBD_MAJOR, DEV_NAME);
+ kfree(minors);
}
module_exit(xlblk_exit);
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH] xen-blkfront: module exit handling adjustments
@ 2012-04-05 15:04 Jan Beulich
0 siblings, 0 replies; 2+ messages in thread
From: Jan Beulich @ 2012-04-05 15:04 UTC (permalink / raw)
To: Jeremy Fitzhardinge, Konrad Rzeszutek Wilk
Cc: Jens Axboe, xen-devel, linux-kernel
The blkdev major must be released upon exit, or else the module can't
attach to devices using the same majors upon being loaded again. Also
avoid leaking the minor tracking bitmap.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
drivers/block/xen-blkfront.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- 3.4-rc1/drivers/block/xen-blkfront.c
+++ 3.4-rc1-xen-blkfront-exit-cleanup/drivers/block/xen-blkfront.c
@@ -1497,7 +1497,9 @@ module_init(xlblk_init);
static void __exit xlblk_exit(void)
{
- return xenbus_unregister_driver(&blkfront_driver);
+ xenbus_unregister_driver(&blkfront_driver);
+ unregister_blkdev(XENVBD_MAJOR, DEV_NAME);
+ kfree(minors);
}
module_exit(xlblk_exit);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-04-05 15:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-05 15:04 [PATCH] xen-blkfront: module exit handling adjustments Jan Beulich
-- strict thread matches above, loose matches on Subject: below --
2012-04-05 15:04 Jan Beulich
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.