lkml.org 
[lkml]   [2012]   [Nov]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] block: Restore /proc/partitions to not display non-partitionable removable devices
ping?

On 11/19/2012 08:56 PM, Josh Hunt wrote:
> 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.
>
> Thanks
> Josh
> ---
>
> After commit d27769ec... block: add GENHD_FL_NO_PART_SCAN, /proc/partitions
> started printing removable devices with only one partition. This is different
> than prior to the commit. This restores /proc/partitions to behave as it did before.
>
> Signed-off-by: Josh Hunt <johunt@akamai.com>
> ---
> block/genhd.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/block/genhd.c b/block/genhd.c
> index 6cace66..6bfeb2a 100644
> --- a/block/genhd.c
> +++ b/block/genhd.c
> @@ -851,7 +851,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)
>


\
 
 \ /
  Last update: 2012-11-27 17:41    [W:0.054 / U:0.336 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site