Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 371685
b: refs/heads/master
c: bd08ec3
h: refs/heads/master
i:
  371683: d1b330d
v: v3
  • Loading branch information
Arve Hjønnevåg authored and Anton Vorontsov committed Apr 4, 2013
1 parent 6a5f127 commit 49ff485
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c31ad081e8734aab3fb45d2f32e9969994dd076e
refs/heads/master: bd08ec33b5c23833581e5a36b2a69ccae6b39a28
12 changes: 10 additions & 2 deletions trunk/fs/pstore/ram.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ static ssize_t ramoops_pstore_read(u64 *id, enum pstore_type_id *type,
char **buf, struct pstore_info *psi)
{
ssize_t size;
ssize_t ecc_notice_size;
struct ramoops_context *cxt = psi->data;
struct persistent_ram_zone *prz;

Expand All @@ -156,11 +157,18 @@ static ssize_t ramoops_pstore_read(u64 *id, enum pstore_type_id *type,
time->tv_nsec = 0;

size = persistent_ram_old_size(prz);
*buf = kmemdup(persistent_ram_old(prz), size, GFP_KERNEL);

/* ECC correction notice */
ecc_notice_size = persistent_ram_ecc_string(prz, NULL, 0);

*buf = kmalloc(size + ecc_notice_size + 1, GFP_KERNEL);
if (*buf == NULL)
return -ENOMEM;

return size;
memcpy(*buf, persistent_ram_old(prz), size);
persistent_ram_ecc_string(prz, *buf + size, ecc_notice_size + 1);

return size + ecc_notice_size;
}

static size_t ramoops_write_kmsg_hdr(struct persistent_ram_zone *prz)
Expand Down
3 changes: 3 additions & 0 deletions trunk/fs/pstore/ram_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,9 @@ ssize_t persistent_ram_ecc_string(struct persistent_ram_zone *prz,
{
ssize_t ret;

if (!prz->ecc_info.ecc_size)
return 0;

if (prz->corrected_bytes || prz->bad_blocks)
ret = snprintf(str, len, ""
"\n%d Corrected bytes, %d unrecoverable blocks\n",
Expand Down

0 comments on commit 49ff485

Please sign in to comment.