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-next>] [day] [month] [year] [list]
Message-Id: <1445020846-529-1-git-send-email-john.stultz@linaro.org>
Date:	Fri, 16 Oct 2015 11:40:46 -0700
From:	John Stultz <john.stultz@...aro.org>
To:	linux-kernel@...r.kernel.org
Cc:	Colin Cross <ccross@...roid.com>,
	Ulf Hansson <ulf.hansson@...aro.org>,
	Adrian Hunter <adrian.hunter@...el.com>,
	Ben Hutchings <ben@...adent.org.uk>,
	Chuanxiao Dong <chuanxiao.dong@...el.com>,
	Shawn Lin <shawn.lin@...k-chips.com>,
	Android Kernel Team <kernel-team@...roid.com>,
	linux-mmc@...r.kernel.org, John Stultz <john.stultz@...aro.org>
Subject: [RFC][PATCH] mmc_block: Allow more than 8 partitions per card

From: Colin Cross <ccross@...roid.com>

It is quite common for Android devices to utilize more
then 8 partitions on internal eMMC storage. This patch,
which has been carried for quite awhile in the AOSP common
tree is necessary in order to support such configurations,
so I wanted to submit it for consideration upstream.

This patch sets the GENHD_FL_EXT_DEVT flag, which will
allocate minor number in major 259 for partitions past
disk->minors.

It also removes 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.

Thoughts or feedback would be greatly appreciated.

Cc: Ulf Hansson <ulf.hansson@...aro.org>
Cc: Adrian Hunter <adrian.hunter@...el.com>
Cc: Ben Hutchings <ben@...adent.org.uk>
Cc: Chuanxiao Dong <chuanxiao.dong@...el.com>
Cc: Shawn Lin <shawn.lin@...k-chips.com>
Cc: Android Kernel Team <kernel-team@...roid.com>
Cc: linux-mmc@...r.kernel.org
Signed-off-by: Colin Cross <ccross@...roid.com>
[jstultz: Added context to commit message]
Signed-off-by: John Stultz <john.stultz@...aro.org>
---
 drivers/mmc/card/block.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index c742cfd..564436e 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -172,11 +172,7 @@ static struct mmc_blk_data *mmc_blk_get(struct gendisk *disk)
 
 static inline int mmc_get_devidx(struct gendisk *disk)
 {
-	int devmaj = MAJOR(disk_devt(disk));
-	int devidx = MINOR(disk_devt(disk)) / perdev_minors;
-
-	if (!devmaj)
-		devidx = disk->first_minor / perdev_minors;
+	int devidx = disk->first_minor / perdev_minors;
 	return devidx;
 }
 
@@ -2162,6 +2158,7 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card,
 	md->disk->queue = md->queue.queue;
 	md->disk->driverfs_dev = parent;
 	set_disk_ro(md->disk, md->read_only || default_ro);
+	md->disk->flags = GENHD_FL_EXT_DEVT;
 	if (area_type & (MMC_BLK_DATA_AREA_RPMB | MMC_BLK_DATA_AREA_BOOT))
 		md->disk->flags |= GENHD_FL_NO_PART_SCAN;
 
-- 
1.9.1

--
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