Skip to content

Commit 0fb0ac8

Browse files
joshhunt-akamaisfrothwell
authored andcommitted
block: restore /proc/partitions to not display non-partitionable removable devices
We found with newer kernels we started seeing the cdrom device showing up in /proc/partitions, but it was not there before. Looking into this I found that commit d27769e ("block: add GENHD_FL_NO_PART_SCAN") introduces this change in behavior. It's not clear to me from the commit's changelog if this change was intentional or not. This comment still remains: /* Don't show non-partitionable removeable devices or empty devices */ so I've decided to send a patch to restore the behavior of not printing unpartitionable removable devices. Signed-off-by: Josh Hunt <[email protected]> Cc: Tejun Heo <[email protected]> Cc: Kay Sievers <[email protected]> Cc: Jens Axboe <[email protected]> Cc: Al Viro <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 776824d commit 0fb0ac8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

block/genhd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,7 @@ static int show_partition(struct seq_file *seqf, void *v)
877877
char buf[BDEVNAME_SIZE];
878878

879879
/* Don't show non-partitionable removeable devices or empty devices */
880-
if (!get_capacity(sgp) || (!disk_max_parts(sgp) &&
880+
if (!get_capacity(sgp) || (!(disk_max_parts(sgp) > 1) &&
881881
(sgp->flags & GENHD_FL_REMOVABLE)))
882882
return 0;
883883
if (sgp->flags & GENHD_FL_SUPPRESS_PARTITION_INFO)

0 commit comments

Comments
 (0)