diff options
author | Josh Hunt <johunt@akamai.com> | 2016-07-27 09:32:20 +1000 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2016-07-28 00:56:34 +1000 |
commit | 8f8fa2eaae4ad1aa9b240ed3e99c18cdd05bab3f (patch) | |
tree | c1edaf6b9e41d535eba1ddba13cd4d5786d2633a | |
parent | e6ce758ccfb89a3933dc23ebf9b305b560525029 (diff) | |
download | linux-next-8f8fa2eaae4ad1aa9b240ed3e99c18cdd05bab3f.tar.gz |
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 d27769ec ("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 <johunt@akamai.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-rw-r--r-- | block/genhd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/block/genhd.c b/block/genhd.c index f06d7f3b075b..5fedf8f772c6 100644 --- a/block/genhd.c +++ b/block/genhd.c @@ -877,7 +877,7 @@ static int show_partition(struct seq_file *seqf, void *v) char buf[BDEVNAME_SIZE]; /* Don't show non-partitionable removeable devices or empty devices */ - if (!get_capacity(sgp) || (!disk_max_parts(sgp) && + if (!get_capacity(sgp) || (!(disk_max_parts(sgp) > 1) && (sgp->flags & GENHD_FL_REMOVABLE))) return 0; if (sgp->flags & GENHD_FL_SUPPRESS_PARTITION_INFO) |