diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2010-08-10 21:03:14 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-11 11:59:20 -0400 |
commit | 9c867fbe06458a8957024236b574733fae0cefed (patch) | |
tree | 6eae6def53e4ca9e30f90f6e9c07d8044581f08f /fs/partitions/sysv68.c | |
parent | ecd6269174c04da5efbd17d6bff793e428eb45ef (diff) |
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 <sr0: scsi3-mmc drive: 24x/24x writer dvd-ram cd/rw xa/form2 cdda tray
^^^
Uniform CD-ROM driver Revision: 3.20
sr 3:0:0:0: Attached scsi CD-ROM sr0
==> sda5 sda6 sda7 >
Make "sda: sda1 ..." lines actually lines.
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/partitions/sysv68.c')
-rw-r--r-- | fs/partitions/sysv68.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/partitions/sysv68.c b/fs/partitions/sysv68.c index 9030c864428e..9627ccffc1c4 100644 --- a/fs/partitions/sysv68.c +++ b/fs/partitions/sysv68.c | |||
@@ -54,6 +54,7 @@ int sysv68_partition(struct parsed_partitions *state) | |||
54 | unsigned char *data; | 54 | unsigned char *data; |
55 | struct dkblk0 *b; | 55 | struct dkblk0 *b; |
56 | struct slice *slice; | 56 | struct slice *slice; |
57 | char tmp[64]; | ||
57 | 58 | ||
58 | data = read_part_sector(state, 0, §); | 59 | data = read_part_sector(state, 0, §); |
59 | if (!data) | 60 | if (!data) |
@@ -73,7 +74,8 @@ int sysv68_partition(struct parsed_partitions *state) | |||
73 | return -1; | 74 | return -1; |
74 | 75 | ||
75 | slices -= 1; /* last slice is the whole disk */ | 76 | slices -= 1; /* last slice is the whole disk */ |
76 | printk("sysV68: %s(s%u)", state->name, slices); | 77 | snprintf(tmp, sizeof(tmp), "sysV68: %s(s%u)", state->name, slices); |
78 | strlcat(state->pp_buf, tmp, PAGE_SIZE); | ||
77 | slice = (struct slice *)data; | 79 | slice = (struct slice *)data; |
78 | for (i = 0; i < slices; i++, slice++) { | 80 | for (i = 0; i < slices; i++, slice++) { |
79 | if (slot == state->limit) | 81 | if (slot == state->limit) |
@@ -82,11 +84,12 @@ int sysv68_partition(struct parsed_partitions *state) | |||
82 | put_partition(state, slot, | 84 | put_partition(state, slot, |
83 | be32_to_cpu(slice->blkoff), | 85 | be32_to_cpu(slice->blkoff), |
84 | be32_to_cpu(slice->nblocks)); | 86 | be32_to_cpu(slice->nblocks)); |
85 | printk("(s%u)", i); | 87 | snprintf(tmp, sizeof(tmp), "(s%u)", i); |
88 | strlcat(state->pp_buf, tmp, PAGE_SIZE); | ||
86 | } | 89 | } |
87 | slot++; | 90 | slot++; |
88 | } | 91 | } |
89 | printk("\n"); | 92 | strlcat(state->pp_buf, "\n", PAGE_SIZE); |
90 | put_dev_sector(sect); | 93 | put_dev_sector(sect); |
91 | return 1; | 94 | return 1; |
92 | } | 95 | } |