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/sysv68.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'fs/partitions/sysv68.c') diff --git a/fs/partitions/sysv68.c b/fs/partitions/sysv68.c index 9030c864428..9627ccffc1c 100644 --- a/fs/partitions/sysv68.c +++ b/fs/partitions/sysv68.c @@ -54,6 +54,7 @@ int sysv68_partition(struct parsed_partitions *state) unsigned char *data; struct dkblk0 *b; struct slice *slice; + char tmp[64]; data = read_part_sector(state, 0, §); if (!data) @@ -73,7 +74,8 @@ int sysv68_partition(struct parsed_partitions *state) return -1; slices -= 1; /* last slice is the whole disk */ - printk("sysV68: %s(s%u)", state->name, slices); + snprintf(tmp, sizeof(tmp), "sysV68: %s(s%u)", state->name, slices); + strlcat(state->pp_buf, tmp, PAGE_SIZE); slice = (struct slice *)data; for (i = 0; i < slices; i++, slice++) { if (slot == state->limit) @@ -82,11 +84,12 @@ int sysv68_partition(struct parsed_partitions *state) put_partition(state, slot, be32_to_cpu(slice->blkoff), be32_to_cpu(slice->nblocks)); - printk("(s%u)", i); + snprintf(tmp, sizeof(tmp), "(s%u)", i); + strlcat(state->pp_buf, tmp, PAGE_SIZE); } slot++; } - printk("\n"); + strlcat(state->pp_buf, "\n", PAGE_SIZE); put_dev_sector(sect); return 1; } -- cgit v1.2.3-18-g5258