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/check.h | |
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/check.h')
-rw-r--r-- | fs/partitions/check.h | 6 |
1 files changed, 5 insertions, 1 deletions
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 { | |||
16 | int next; | 16 | int next; |
17 | int limit; | 17 | int limit; |
18 | bool access_beyond_eod; | 18 | bool access_beyond_eod; |
19 | char *pp_buf; | ||
19 | }; | 20 | }; |
20 | 21 | ||
21 | static inline void *read_part_sector(struct parsed_partitions *state, | 22 | static inline void *read_part_sector(struct parsed_partitions *state, |
@@ -32,9 +33,12 @@ static inline void | |||
32 | put_partition(struct parsed_partitions *p, int n, sector_t from, sector_t size) | 33 | put_partition(struct parsed_partitions *p, int n, sector_t from, sector_t size) |
33 | { | 34 | { |
34 | if (n < p->limit) { | 35 | if (n < p->limit) { |
36 | char tmp[1 + BDEVNAME_SIZE + 10 + 1]; | ||
37 | |||
35 | p->parts[n].from = from; | 38 | p->parts[n].from = from; |
36 | p->parts[n].size = size; | 39 | p->parts[n].size = size; |
37 | printk(" %s%d", p->name, n); | 40 | snprintf(tmp, sizeof(tmp), " %s%d", p->name, n); |
41 | strlcat(p->pp_buf, tmp, PAGE_SIZE); | ||
38 | } | 42 | } |
39 | } | 43 | } |
40 | 44 | ||