lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Thu, 09 Sep 2010 10:54:56 +0300
From:	Adrian Hunter <adrian.hunter@...ia.com>
To:	Colin Cross <ccross@...roid.com>
CC:	Olof Johansson <olof@...om.net>,
	Kay Sievers <kay.sievers@...y.org>,
	Lei Wen <adrian.wenl@...il.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	"linux-mmc@...r.kernel.org" <linux-mmc@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Mandeep Baines <msb@...omium.org>
Subject: Re: [PATCH] mmc_block: Allow more than 8 partitions per card

ext Colin Cross wrote:
> Set the GENHD_FL_EXT_DEVT flag, which will allocate minor numbers
> in major 259 for partitions past disk->minors.
> 
> Also remove the use of disk_devt to determine devidx from md->disk.
> md->disk->first_minor is always initialized from devidx and can
> always be used to recover it.

Yeah, but it is a bit weird.  It seems to me that devidx should just
be a member of struct mmc_blk_data.

Doesn't look like devidx is cleared in all the error paths out of
mmc_blk_alloc() either, if you want something else to do ;-)

> 
> Signed-off-by: Colin Cross <ccross@...roid.com>
> ---
>  drivers/mmc/card/block.c |    7 ++-----
>  1 files changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
> index d545f79..07d8eb0 100644
> --- a/drivers/mmc/card/block.c
> +++ b/drivers/mmc/card/block.c
> @@ -87,11 +87,7 @@ static void mmc_blk_put(struct mmc_blk_data *md)
>  	mutex_lock(&open_lock);
>  	md->usage--;
>  	if (md->usage == 0) {
> -		int devmaj = MAJOR(disk_devt(md->disk));
> -		int devidx = MINOR(disk_devt(md->disk)) >> MMC_SHIFT;
> -
> -		if (!devmaj)
> -			devidx = md->disk->first_minor >> MMC_SHIFT;
> +		int devidx = md->disk->first_minor >> MMC_SHIFT;
>  
>  		blk_cleanup_queue(md->queue.queue);
>  
> @@ -607,6 +603,7 @@ static struct mmc_blk_data *mmc_blk_alloc(struct mmc_card *card)
>  	md->disk->private_data = md;
>  	md->disk->queue = md->queue.queue;
>  	md->disk->driverfs_dev = &card->dev;
> +	md->disk->flags = GENHD_FL_EXT_DEVT;
>  
>  	/*
>  	 * As discussed on lkml, GENHD_FL_REMOVABLE should:

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ