/[linux-patches]/genpatches-2.6/trunk/2.6.14/1455_15.5_dm-free-minor-after-del_gendisk.patch
Gentoo

Contents of /genpatches-2.6/trunk/2.6.14/1455_15.5_dm-free-minor-after-del_gendisk.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 328 - (hide annotations) (download) (as text)
Tue Mar 14 13:34:17 2006 UTC (14 years, 8 months ago) by johnm
File MIME type: text/x-diff
File size: 1234 byte(s)
2.6.14-11, rebase against local tree
1 johnm 328 From: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
2     Date: Fri, 24 Feb 2006 21:04:25 +0000 (-0800)
3     Subject: [PATCH] dm: free minor after unlink gendisk
4     X-Git-Url: http://www.kernel.org/git/?p=linux/kernel/git/chrisw/linux-2.6.15.y.git;a=commitdiff;h=e5a78bb9935a635ebcb71c10899c53bfc99f8c7f
5    
6     [PATCH] dm: free minor after unlink gendisk
7    
8     Minor number should be freed after del_gendisk(). Otherwise, there could
9     be a window where 2 registered gendisk has same minor number.
10    
11     Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
12     Acked-by: Alasdair G Kergon <agk@redhat.com>
13     Cc: <stable@kernel.org>
14     Signed-off-by: Andrew Morton <akpm@osdl.org>
15     [chrisw: backport to 2.6.15]
16     Signed-off-by: Chris Wright <chrisw@sous-sol.org>
17     ---
18    
19     --- a/drivers/md/dm.c
20     +++ b/drivers/md/dm.c
21     @@ -812,14 +812,16 @@ static struct mapped_device *alloc_dev(u
22    
23     static void free_dev(struct mapped_device *md)
24     {
25     + unsigned int minor = md->disk->first_minor;
26     +
27     if (md->frozen_bdev) {
28     thaw_bdev(md->frozen_bdev, NULL);
29     bdput(md->frozen_bdev);
30     }
31     - free_minor(md->disk->first_minor);
32     mempool_destroy(md->tio_pool);
33     mempool_destroy(md->io_pool);
34     del_gendisk(md->disk);
35     + free_minor(minor);
36     put_disk(md->disk);
37     blk_put_queue(md->queue);
38     kfree(md);

  ViewVC Help
Powered by ViewVC 1.1.20