Skip to contentSkip to conversation

block: fix duplicate headers for /proc/partitions

PATCH Applied Tejun Heo 2 participants 2 messages Sep 3, 2008 – Sep 4, 2008 Block layer

lore
Share & tools
lore

Tejun Heo

author
#0 lore raw

PATCH 1/1 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.

---
 block/genhd.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
block/genhd.c +1 -1
index ed926b7..8acaff0 100644
@@ -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;
 }
Applied
#1 lore raw
Quoted 2 lines · Tejun Heo

seqf can be started multiple times for a read and the header should be printed only for the initial one. Fix it.

Applied

Signature · 1 line
Jens Axboe