summaryrefslogtreecommitdiffstats
path: root/fs/partitions/check.h
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2010-08-11 03:03:14 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-11 17:59:20 +0200
commit9c867fbe06458a8957024236b574733fae0cefed (patch)
tree6eae6def53e4ca9e30f90f6e9c07d8044581f08f /fs/partitions/check.h
parentcs5535-mfgpt: reuse timers that have never been set up (diff)
downloadlinux-9c867fbe06458a8957024236b574733fae0cefed.tar.xz
linux-9c867fbe06458a8957024236b574733fae0cefed.zip
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.h6
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 {
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);
}
}