From: Tejun Heo Date: Thu, 4 Sep 2008 07:17:31 +0000 (+0200) Subject: block: fix duplicate headers for /proc/partitions X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=243294dae09c909c0442c8f04d470b69c3c19d6e;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git block: fix duplicate headers for /proc/partitions seqf can be started multiple times for a read and the header should be printed only for the initial one. Fix it. Signed-off-by: Tejun Heo Signed-off-by: Jens Axboe --- diff --git a/block/genhd.c b/block/genhd.c index ed926b760ca0..8acaff0154e3 100644 --- a/block/genhd.c +++ b/block/genhd.c @@ -697,7 +697,7 @@ static void *show_partition_start(struct seq_file *seqf, loff_t *pos) static void *p; p = disk_seqf_start(seqf, pos); - if (!IS_ERR(p) && p) + if (!IS_ERR(p) && p && !*pos) seq_puts(seqf, "major minor #blocks name\n\n"); return p; }