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/ibm.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/ibm.c')
-rw-r--r-- | fs/partitions/ibm.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/fs/partitions/ibm.c b/fs/partitions/ibm.c index fc8497643fd0..d1b8a5c4bc0a 100644 --- a/fs/partitions/ibm.c +++ b/fs/partitions/ibm.c | |||
@@ -75,6 +75,7 @@ int ibm_partition(struct parsed_partitions *state) | |||
75 | unsigned char *data; | 75 | unsigned char *data; |
76 | Sector sect; | 76 | Sector sect; |
77 | sector_t labelsect; | 77 | sector_t labelsect; |
78 | char tmp[64]; | ||
78 | 79 | ||
79 | res = 0; | 80 | res = 0; |
80 | blocksize = bdev_logical_block_size(bdev); | 81 | blocksize = bdev_logical_block_size(bdev); |
@@ -144,13 +145,15 @@ int ibm_partition(struct parsed_partitions *state) | |||
144 | */ | 145 | */ |
145 | blocksize = label->cms.block_size; | 146 | blocksize = label->cms.block_size; |
146 | if (label->cms.disk_offset != 0) { | 147 | if (label->cms.disk_offset != 0) { |
147 | printk("CMS1/%8s(MDSK):", name); | 148 | snprintf(tmp, sizeof(tmp), "CMS1/%8s(MDSK):", name); |
149 | strlcat(state->pp_buf, tmp, PAGE_SIZE); | ||
148 | /* disk is reserved minidisk */ | 150 | /* disk is reserved minidisk */ |
149 | offset = label->cms.disk_offset; | 151 | offset = label->cms.disk_offset; |
150 | size = (label->cms.block_count - 1) | 152 | size = (label->cms.block_count - 1) |
151 | * (blocksize >> 9); | 153 | * (blocksize >> 9); |
152 | } else { | 154 | } else { |
153 | printk("CMS1/%8s:", name); | 155 | snprintf(tmp, sizeof(tmp), "CMS1/%8s:", name); |
156 | strlcat(state->pp_buf, tmp, PAGE_SIZE); | ||
154 | offset = (info->label_block + 1); | 157 | offset = (info->label_block + 1); |
155 | size = label->cms.block_count | 158 | size = label->cms.block_count |
156 | * (blocksize >> 9); | 159 | * (blocksize >> 9); |
@@ -159,7 +162,8 @@ int ibm_partition(struct parsed_partitions *state) | |||
159 | size-offset*(blocksize >> 9)); | 162 | size-offset*(blocksize >> 9)); |
160 | } else { | 163 | } else { |
161 | if (strncmp(type, "LNX1", 4) == 0) { | 164 | if (strncmp(type, "LNX1", 4) == 0) { |
162 | printk("LNX1/%8s:", name); | 165 | snprintf(tmp, sizeof(tmp), "LNX1/%8s:", name); |
166 | strlcat(state->pp_buf, tmp, PAGE_SIZE); | ||
163 | if (label->lnx.ldl_version == 0xf2) { | 167 | if (label->lnx.ldl_version == 0xf2) { |
164 | fmt_size = label->lnx.formatted_blocks | 168 | fmt_size = label->lnx.formatted_blocks |
165 | * (blocksize >> 9); | 169 | * (blocksize >> 9); |
@@ -178,7 +182,7 @@ int ibm_partition(struct parsed_partitions *state) | |||
178 | offset = (info->label_block + 1); | 182 | offset = (info->label_block + 1); |
179 | } else { | 183 | } else { |
180 | /* unlabeled disk */ | 184 | /* unlabeled disk */ |
181 | printk("(nonl)"); | 185 | strlcat(tmp, sizeof(tmp), "(nonl)", PAGE_SIZE); |
182 | size = i_size >> 9; | 186 | size = i_size >> 9; |
183 | offset = (info->label_block + 1); | 187 | offset = (info->label_block + 1); |
184 | } | 188 | } |
@@ -197,7 +201,8 @@ int ibm_partition(struct parsed_partitions *state) | |||
197 | * if not, something is wrong, skipping partition detection | 201 | * if not, something is wrong, skipping partition detection |
198 | */ | 202 | */ |
199 | if (strncmp(type, "VOL1", 4) == 0) { | 203 | if (strncmp(type, "VOL1", 4) == 0) { |
200 | printk("VOL1/%8s:", name); | 204 | snprintf(tmp, sizeof(tmp), "VOL1/%8s:", name); |
205 | strlcat(state->pp_buf, tmp, PAGE_SIZE); | ||
201 | /* | 206 | /* |
202 | * get block number and read then go through format1 | 207 | * get block number and read then go through format1 |
203 | * labels | 208 | * labels |
@@ -253,7 +258,7 @@ int ibm_partition(struct parsed_partitions *state) | |||
253 | 258 | ||
254 | } | 259 | } |
255 | 260 | ||
256 | printk("\n"); | 261 | strlcat(state->pp_buf, "\n", PAGE_SIZE); |
257 | goto out_freeall; | 262 | goto out_freeall; |
258 | 263 | ||
259 | 264 | ||