diff options
author | Anton Vorontsov <anton.vorontsov@linaro.org> | 2012-05-26 09:07:49 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-06-13 19:52:39 -0400 |
commit | 201e4aca5aa179e6c69a4dcd36a3562e56b8d670 (patch) | |
tree | 0d75a50b12cd1c8e39119419ed7c65195b518a16 /fs/pstore/ram.c | |
parent | 33735a94afdfb39c550b952a40f77c60afdddfa5 (diff) |
pstore/ram: Should update old dmesg buffer before reading
Without the update, we'll only see the new dmesg buffer after the
reboot, but previously we could see it right away. Making an oops
visible in pstore filesystem before reboot is a somewhat dubious
feature, but removing it wasn't an intentional change, so let's
restore it.
For this we have to make persistent_ram_save_old() safe for calling
multiple times, and also extern it.
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/pstore/ram.c')
-rw-r--r-- | fs/pstore/ram.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c index 9123cce28c1e..16ff7332eae0 100644 --- a/fs/pstore/ram.c +++ b/fs/pstore/ram.c | |||
@@ -106,6 +106,8 @@ static ssize_t ramoops_pstore_read(u64 *id, enum pstore_type_id *type, | |||
106 | time->tv_sec = 0; | 106 | time->tv_sec = 0; |
107 | time->tv_nsec = 0; | 107 | time->tv_nsec = 0; |
108 | 108 | ||
109 | /* Update old/shadowed buffer. */ | ||
110 | persistent_ram_save_old(prz); | ||
109 | size = persistent_ram_old_size(prz); | 111 | size = persistent_ram_old_size(prz); |
110 | *buf = kmalloc(size, GFP_KERNEL); | 112 | *buf = kmalloc(size, GFP_KERNEL); |
111 | if (*buf == NULL) | 113 | if (*buf == NULL) |