[PATCH linux-2.6-block#for-2.6.28] block: fix duplicate headers for/proc/partitions

From: Tejun Heo
Date: Wed Sep 03 2008 - 13:34:31 EST


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 <tj@xxxxxxxxxx>
---
block/genhd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/genhd.c b/block/genhd.c
index ed926b7..8acaff0 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;
}

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/