gendisk: Avoid partition scan when GENHD_FL_NO_PART_SCAN is set
Seshagiri Holi [Mon, 18 Nov 2013 08:20:13 +0000 (13:20 +0530)]
The RPMB partitions should have authenticated
 read/write requests. Any regular read/write request
 will prompt errors.

mmc driver will set block device of RPMB type
 to GENHD_FL_NO_PART_SCAN.

With this patch rpmb partition are not listed in
 /proc/partition so that fdisk command will not
 process for read request.

Bug 1367536

Change-Id: I13d02c4c810fcfe4627ef949efbf51f484b27a7f
Signed-off-by: Seshagiri Holi <sholi@nvidia.com>
Reviewed-on: http://git-master/r/388056
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
Reviewed-by: Pavan Kunapuli <pkunapuli@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>

block/genhd.c

index 6f612a7..b9125e7 100644 (file)
@@ -852,7 +852,8 @@ static int show_partition(struct seq_file *seqf, void *v)
        if (!get_capacity(sgp) || (!disk_max_parts(sgp) &&
                                   (sgp->flags & GENHD_FL_REMOVABLE)))
                return 0;
-       if (sgp->flags & GENHD_FL_SUPPRESS_PARTITION_INFO)
+       if (sgp->flags & GENHD_FL_SUPPRESS_PARTITION_INFO ||
+               sgp->flags & GENHD_FL_NO_PART_SCAN)
                return 0;
 
        /* show the full disk and all non-0 size partitions of it */