From 9c867fbe06458a8957024236b574733fae0cefed Mon Sep 17 00:00:00 2001 From: Alexey Dobriyan Date: Tue, 10 Aug 2010 18:03:14 -0700 Subject: partitions: fix sometimes unreadable partition strings Fix this garbage happening quite often: ==> sda: scsi 3:0:0:0: CD-ROM TOSHIBA ==> sda1 sda2 sda3 sda4 sda5 sda6 sda7 > Make "sda: sda1 ..." lines actually lines. Signed-off-by: Alexey Dobriyan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- fs/partitions/check.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'fs/partitions/check.h') diff --git a/fs/partitions/check.h b/fs/partitions/check.h index 52f8bd399396..8e4e103ba216 100644 --- a/fs/partitions/check.h +++ b/fs/partitions/check.h @@ -16,6 +16,7 @@ struct parsed_partitions { int next; int limit; bool access_beyond_eod; + char *pp_buf; }; static inline void *read_part_sector(struct parsed_partitions *state, @@ -32,9 +33,12 @@ static inline void put_partition(struct parsed_partitions *p, int n, sector_t from, sector_t size) { if (n < p->limit) { + char tmp[1 + BDEVNAME_SIZE + 10 + 1]; + p->parts[n].from = from; p->parts[n].size = size; - printk(" %s%d", p->name, n); + snprintf(tmp, sizeof(tmp), " %s%d", p->name, n); + strlcat(p->pp_buf, tmp, PAGE_SIZE); } } -- cgit v1.2.3-59-g8ed1b