linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mmc: card: Don't show eMMC RPMB and BOOT areas in /proc/partitions
@ 2018-02-27 11:33 Harish Jenny K N
  2018-02-27 13:51 ` Shawn Lin
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Harish Jenny K N @ 2018-02-27 11:33 UTC (permalink / raw)
  To: ulf.hansson, linus.walleij, adrian.hunter, shawn.lin
  Cc: linux-mmc, linux-kernel, harish_kandiga

From: Andrew Gabbasov <andrew_gabbasov@mentor.com>

Since RPMB area is accessible via special ioctl only and boot areas
are unlikely to contain any partitions, exclude them all from listing
in /proc/partitions. This will hide them from various user-level
software (e.g. fdisk), thus avoiding unnecessary access attempts.

Signed-off-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
Signed-off-by: Harish Jenny K N <harish_kandiga@mentor.com>
---
 drivers/mmc/core/block.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
index 20135a5..376e47e 100644
--- a/drivers/mmc/core/block.c
+++ b/drivers/mmc/core/block.c
@@ -2341,7 +2341,8 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card,
 	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;
+		md->disk->flags |= GENHD_FL_NO_PART_SCAN
+				   | GENHD_FL_SUPPRESS_PARTITION_INFO;
 
 	/*
 	 * As discussed on lkml, GENHD_FL_REMOVABLE should:
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-04-04 12:46 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-27 11:33 [PATCH] mmc: card: Don't show eMMC RPMB and BOOT areas in /proc/partitions Harish Jenny K N
2018-02-27 13:51 ` Shawn Lin
2018-02-27 14:56 ` Alex Lemberg
2018-02-27 14:58 ` Alex Lemberg
2018-03-01  5:34   ` Harish Jenny K N
2018-03-02 12:53 ` Linus Walleij
2018-03-06 12:47   ` Harish Jenny K N
2018-03-08 20:36   ` Alex Lemberg
2018-03-10 11:59     ` Linus Walleij
2018-03-12  4:44       ` Harish Jenny K N
2018-04-04 12:46 ` Ulf Hansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).