block: fix duplicate headers for /proc/partitions
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.
Signed-off-by Tejun Heo <[email protected]>
--- block/genhd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
block/genhd.c +1 -1
@@ -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; }
Jens Axboe
AppliedQuoted 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