15 Nov, 2014
1 commit
-
commit d4bf205da618bbd0b038e404d646f14e76915718 upstream.
The pstore filesystem still creates duplicate filename/inode pairs for
some pstore types. Add the id to the filename to prevent that.Before patch:
[/sys/fs/pstore] ls -li
total 0
1250 -r--r--r--. 1 root root 67 Sep 29 17:09 console-efi
1250 -r--r--r--. 1 root root 67 Sep 29 17:09 console-efi
1250 -r--r--r--. 1 root root 67 Sep 29 17:09 console-efi
1250 -r--r--r--. 1 root root 67 Sep 29 17:09 console-efi
1250 -r--r--r--. 1 root root 67 Sep 29 17:09 console-efi
1250 -r--r--r--. 1 root root 67 Sep 29 17:09 console-efi
1250 -r--r--r--. 1 root root 67 Sep 29 17:09 console-efi
1250 -r--r--r--. 1 root root 67 Sep 29 17:09 console-efi
1250 -r--r--r--. 1 root root 67 Sep 29 17:09 console-efiAfter:
[/sys/fs/pstore] ls -li
total 0
1232 -r--r--r--. 1 root root 148 Sep 29 17:09 console-efi-141202499100000
1231 -r--r--r--. 1 root root 67 Sep 29 17:09 console-efi-141202499200000
1230 -r--r--r--. 1 root root 148 Sep 29 17:44 console-efi-141202705400000
1229 -r--r--r--. 1 root root 67 Sep 29 17:44 console-efi-141202705500000
1228 -r--r--r--. 1 root root 67 Sep 29 20:42 console-efi-141203772600000
1227 -r--r--r--. 1 root root 148 Sep 29 23:42 console-efi-141204854900000
1226 -r--r--r--. 1 root root 67 Sep 29 23:42 console-efi-141204855000000
1225 -r--r--r--. 1 root root 148 Sep 29 23:59 console-efi-141204954200000
1224 -r--r--r--. 1 root root 67 Sep 29 23:59 console-efi-141204954400000Signed-off-by: Valdis Kletnieks
Acked-by: Kees Cook
Signed-off-by: Tony Luck
Signed-off-by: Greg Kroah-Hartman
21 Dec, 2013
1 commit
-
Some pstore backing devices use on board flash as persistent
storage. These have limited numbers of write cycles so it
is a poor idea to use them from high frequency operations.Signed-off-by: Tony Luck
Signed-off-by: Linus Torvalds
17 Sep, 2013
3 commits
-
Remove the messages indicating compression failure as it will
add to the space during panic path.Reported-by: Seiji Aguchi
Tested-by: Seiji Aguchi
Signed-off-by: Aruna Balakrishnaiah
Signed-off-by: Tony Luck -
Since zlib_deflateInit2() is used for specifying window bit during compression,
zlib_inflateInit2() is appropriate for decompression.Reported-by: Seiji Aguchi
Tested-by: Seiji Aguchi
Signed-off-by: Aruna Balakrishnaiah
Signed-off-by: Tony Luck -
When backends (ex: efivars) have smaller registered buffers, the
big_oops_buf is too big for them as number of repeated occurences
in the text captured will be less. What happens is that pstore takes
too big a bite from the dmesg log and then finds it cannot compress it
enough to meet the backend block size. Patch takes care of adjusting
the buffer size based on the registered buffer size. cmpr values have
been arrived after doing experiments with plain text for buffers of
size 1k - 4k (Smaller the buffer size repeated occurence will be less)
and with sample crash log for buffers ranging from 4k - 10k.Reported-by: Seiji Aguchi
Tested-by: Seiji Aguchi
Signed-off-by: Aruna Balakrishnaiah
Signed-off-by: Tony Luck
31 Aug, 2013
1 commit
-
Previous attempt to fix was b042e47491ba5f487601b5141a3f1d8582304170
Suggested use of is_power_of_2() was bogus because is_power_of_2(0) is
false (documented behaviour).Signed-off-by: Maxime Bizon
Acked-by: Kees Cook
Signed-off-by: Tony Luck
20 Aug, 2013
8 commits
-
In pstore write, add character 'C'(compressed) or 'D'(decompressed)
in the header while writing to Ram persistent buffer. In pstore read,
read the header and update the 'compressed' flag accordingly.Signed-off-by: Aruna Balakrishnaiah
Reviewed-by: Kees Cook
Signed-off-by: Tony Luck -
In case decompression fails, add a ".enc.z" to indicate the file has
compressed data. This will help user space utilities to figure
out the file contents.Signed-off-by: Aruna Balakrishnaiah
Reviewed-by: Kees Cook
Signed-off-by: Tony Luck -
Based on the flag 'compressed' set or not, pstore will decompress the
data returning a plain text file. If decompression fails for a particular
record it will have the compressed data in the file which can be
decompressed with 'openssl' command line tool.Signed-off-by: Aruna Balakrishnaiah
Reviewed-by: Kees Cook
Signed-off-by: Tony Luck -
Backends will set the flag 'compressed' after reading the log from
persistent store to indicate the data being returned to pstore is
compressed or not.Signed-off-by: Aruna Balakrishnaiah
Reviewed-by: Kees Cook
Signed-off-by: Tony Luck -
Add compression support to pstore which will help in capturing more data.
Initially, pstore will make a call to kmsg_dump with a bigger buffer
and will pass the size of bigger buffer to kmsg_dump and then compress
the data to registered buffer of registered size.In case compression fails, pstore will capture the uncompressed
data by making a call again to kmsg_dump with registered_buffer
of registered size.Pstore will indicate the data is compressed or not with a flag
in the write callback.Signed-off-by: Aruna Balakrishnaiah
Reviewed-by: Kees Cook
Signed-off-by: Tony Luck -
Pstore will make use of deflate and inflate algorithm to compress and decompress
the data. So when Pstore is enabled select zlib_deflate and zlib_inflate.Signed-off-by: Aruna Balakrishnaiah
Reviewed-by: Kees Cook
Signed-off-by: Tony Luck -
Addition of new argument 'compressed' in the write call back will
help the backend to know if the data passed from pstore is compressed
or not (In case where compression fails.). If compressed, the backend
can add a tag indicating the data is compressed while writing to
persistent store.Signed-off-by: Aruna Balakrishnaiah
Reviewed-by: Kees Cook
Signed-off-by: Tony Luck -
d_alloc_name() returns NULL on error. Also I changed the error code
from -ENOSPC to -ENOMEM to reflect that we were short on RAM not disk
space.Signed-off-by: Dan Carpenter
Acked-by: Kees Cook
Signed-off-by: Tony Luck
05 Jul, 2013
1 commit
-
Pull powerpc updates from Ben Herrenschmidt:
"This is the powerpc changes for the 3.11 merge window. In addition to
the usual bug fixes and small updates, the main highlights are:- Support for transparent huge pages by Aneesh Kumar for 64-bit
server processors. This allows the use of 16M pages as transparent
huge pages on kernels compiled with a 64K base page size.- Base VFIO support for KVM on power by Alexey Kardashevskiy
- Wiring up of our nvram to the pstore infrastructure, including
putting compressed oopses in there by Aruna Balakrishnaiah- Move, rework and improve our "EEH" (basically PCI error handling
and recovery) infrastructure. It is no longer specific to pseries
but is now usable by the new "powernv" platform as well (no
hypervisor) by Gavin Shan.- I fixed some bugs in our math-emu instruction decoding and made it
usable to emulate some optional FP instructions on processors with
hard FP that lack them (such as fsqrt on Freescale embedded
processors).- Support for Power8 "Event Based Branch" facility by Michael
Ellerman. This facility allows what is basically "userspace
interrupts" for performance monitor events.- A bunch of Transactional Memory vs. Signals bug fixes and HW
breakpoint/watchpoint fixes by Michael Neuling.And more ... I appologize in advance if I've failed to highlight
something that somebody deemed worth it."* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (156 commits)
pstore: Add hsize argument in write_buf call of pstore_ftrace_call
powerpc/fsl: add MPIC timer wakeup support
powerpc/mpic: create mpic subsystem object
powerpc/mpic: add global timer support
powerpc/mpic: add irq_set_wake support
powerpc/85xx: enable coreint for all the 64bit boards
powerpc/8xx: Erroneous double irq_eoi() on CPM IRQ in MPC8xx
powerpc/fsl: Enable CONFIG_E1000E in mpc85xx_smp_defconfig
powerpc/mpic: Add get_version API both for internal and external use
powerpc: Handle both new style and old style reserve maps
powerpc/hw_brk: Fix off by one error when validating DAWR region end
powerpc/pseries: Support compression of oops text via pstore
powerpc/pseries: Re-organise the oops compression code
pstore: Pass header size in the pstore write callback
powerpc/powernv: Fix iommu initialization again
powerpc/pseries: Inform the hypervisor we are using EBB regs
powerpc/perf: Add power8 EBB support
powerpc/perf: Core EBB support for 64-bit book3s
powerpc/perf: Drop MMCRA from thread_struct
powerpc/perf: Don't enable if we have zero events
...
02 Jul, 2013
1 commit
-
Incorporate the addition of hsize argument in write_buf callback
of pstore. This was forgotten in6bbbca735936e15b9431882eceddcf6dff76e03c
pstore: Pass header size in the pstore write callbackCausing a build failure when ftrace and pstore are enabled.
Signed-off-by: Aruna Balakrishnaiah
Signed-off-by: Benjamin Herrenschmidt
01 Jul, 2013
1 commit
-
Header size is needed to distinguish between header and the dump data.
Incorporate the addition of new argument (hsize) in the pstore write
callback.Signed-off-by: Aruna Balakrishnaiah
Acked-by: Kees Cook
Signed-off-by: Benjamin Herrenschmidt
29 Jun, 2013
1 commit
-
This is patch 1/3 of a patch set that avoids what misleadingly appears
to be a error during boot:ERST: Could not register with persistent store
This message is displayed if the system has a valid ACPI ERST table and the
pstore.backend kernel parameter has been used to disable use of ERST by
pstore. But this same message is used for errors that preclude registration.As part of fixing this, return a unique error status from pstore_register
if the pstore.backend kernel parameter selects a specific facility other
than the requesting facility and check for this condition before any others.
This allows the caller to distinquish this benign case from the other failure
cases.Also, print an informational console message about which facility
successfully registered as the pstore backend. Since there are various
kernel parameters, config build options, and boot-time errors that can
influence which facility registers with pstore, it's useful to have a
positive indication.Signed-off-by: Lenny Szubowicz
Reported-by: Naotaka Hamaguchi
Signed-off-by: Tony Luck
26 Jun, 2013
1 commit
-
pstore_erase is used to erase the record from the persistent store.
So if a driver has not defined pstore_erase callback return
-EPERM instead of unlinking a file as deleting the file without
erasing its record in persistent store will give a wrong impression
to customers.Signed-off-by: Aruna Balakrishnaiah
Acked-by: Kees Cook
Signed-off-by: Tony Luck
20 Jun, 2013
3 commits
-
This patch exploits pstore subsystem to read details of common partition
in NVRAM to a separate file in /dev/pstore. For instance, common partition
details will be stored in a file named [common-nvram-6].Signed-off-by: Aruna Balakrishnaiah
Reviewed-by: Jim Keniston
Signed-off-by: Benjamin Herrenschmidt -
This patch set exploits the pstore subsystem to read details of
of-config partition in NVRAM to a separate file in /dev/pstore.
For instance, of-config partition details will be stored in a
file named [of-nvram-5].Signed-off-by: Aruna Balakrishnaiah
Reviewed-by: Jim Keniston
Signed-off-by: Benjamin Herrenschmidt -
This patch set exploits the pstore subsystem to read details of rtas partition
in NVRAM to a separate file in /dev/pstore. For instance, rtas details will be
stored in a file named [rtas-nvram-4].Signed-off-by: Aruna Balakrishnaiah
Reviewed-by: Jim Keniston
Signed-off-by: Benjamin Herrenschmidt
15 Jun, 2013
2 commits
-
There doesn't appear to be any reason for the overall pstore RAM buffer to
be a power of 2 size, so remove it. The individual console, ftrace and oops
buffers are still a power of 2 size.Signed-off-by: Rob Herring
Acked-by: Anton Vorontsov
Signed-off-by: Tony Luck -
For persistent RAM outside of main memory, the memory may have limitations
on supported accesses. For internal RAM on highbank platform exclusive
accesses are not supported and will hang the system. So atomic_cmpxchg
cannot be used. This commit uses spinlock protection for buffer size and
start updates on ioremapped regions instead.Signed-off-by: Rob Herring
Acked-by: Anton Vorontsov
Signed-off-by: Tony Luck
10 May, 2013
1 commit
-
Pull trivial pstore update from Tony Luck:
"Couple of pstore cleanups"It turns out that the kmemdup() conversion ends up being undone by the
fact that the memory block also needed the ecc information (see commit
bd08ec33b5c2: "pstore/ram: Restore ecc information block"), so all that
remains after merging is the error return code change.* tag 'please-pull-pstore' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux:
pstore/ram: fix error return code in ramoops_probe()
fs: pstore: Replaced calls to kmalloc and memcpy with kmemdup
09 May, 2013
1 commit
-
Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.Signed-off-by: Wei Yongjun
Acked-by: Kees Cook
Signed-off-by: Tony Luck
04 Apr, 2013
3 commits
-
This was lost when proc/last_kmsg moved to pstore/console-ramoops.
Signed-off-by: Arve Hjønnevåg
Signed-off-by: John Stultz
Acked-by: Kees Cook
Signed-off-by: Anton Vorontsov -
Allow specifying ecc parameters in platform data
Signed-off-by: Arve Hjønnevåg
[jstultz: Tweaked commit subject & add commit message]
Signed-off-by: John Stultz
Acked-by: Kees Cook
Signed-off-by: Anton Vorontsov -
Wastes less memory and allows using more memory for ecc than data.
Signed-off-by: Arve Hjønnevåg
[jstultz: Tweaked commit subject]
Signed-off-by: John Stultz
Acked-by: Kees Cook
Signed-off-by: Anton Vorontsov
19 Mar, 2013
1 commit
-
Replaced calls to kmalloc and memcpy with a single call to kmemdup. This
patch was found using coccicheck.Signed-off-by: Alexandru Gheorghiu
Acked-by: Kees Cook
Signed-off-by: Anton Vorontsov
12 Mar, 2013
1 commit
-
Replaced calls to kmalloc and memcpy with a single call to kmemdup.
This patch was found using coccicheck.Signed-off-by: Alexandru Gheorghiu
Acked-by: Kees Cook
Signed-off-by: Tony Luck
22 Feb, 2013
1 commit
-
Pull pstore patches from Tony Luck:
"A few fixes to reduce places where pstore might hang a system in the
crash path. Plus a new mountpoint (/sys/fs/pstore ... makes more
sense then /dev/pstore)."Fix up trivial conflict in drivers/firmware/efivars.c
* tag 'please-pull-pstore' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux:
pstore: Create a convenient mount point for pstore
efi_pstore: Introducing workqueue updating sysfs
efivars: Disable external interrupt while holding efivars->lock
efi_pstore: Avoid deadlock in non-blocking paths
pstore: Avoid deadlock in panic and emergency-restart path
13 Feb, 2013
1 commit
-
Using /dev/pstore as a mount point for the pstore filesystem is slightly
awkward. We don't normally mount filesystems in /dev/ and the /dev/pstore
file isn't created automatically by anything. While this method will
still work, we can create a persistent mount point in sysfs. This will
put pstore on par with things like cgroups and efivarfs.Signed-off-by: Josh Boyer
Acked-by: Kees Cook
Signed-off-by: Tony Luck
04 Feb, 2013
1 commit
-
Trivial conflict in arch/x86/Kconfig
Signed-off-by: Thomas Gleixner
16 Jan, 2013
1 commit
-
The pstore RAM backend can get called during resume, and must be defensive
against a suspended time source. Expose getnstimeofday logic that returns
an error instead of a WARN. This can be detected and the timestamp can
be zeroed out.Reported-by: Doug Anderson
Cc: John Stultz
Cc: Anton Vorontsov
Signed-off-by: Kees Cook
Signed-off-by: John Stultz
12 Jan, 2013
1 commit
-
[Issue]
When pstore is in panic and emergency-restart paths, it may be blocked
in those paths because it simply takes spin_lock.This is an example scenario which pstore may hang up in a panic path:
- cpuA grabs psinfo->buf_lock
- cpuB panics and calls smp_send_stop
- smp_send_stop sends IRQ to cpuA
- after 1 second, cpuB gives up on cpuA and sends an NMI instead
- cpuA is now in an NMI handler while still holding buf_lock
- cpuB is deadlockedThis case may happen if a firmware has a bug and
cpuA is stuck talking with it more than one second.Also, this is a similar scenario in an emergency-restart path:
- cpuA grabs psinfo->buf_lock and stucks in a firmware
- cpuB kicks emergency-restart via either sysrq-b or hangcheck timer.
And then, cpuB is deadlocked by taking psinfo->buf_lock again.[Solution]
This patch avoids the deadlocking issues in both panic and emergency_restart
paths by introducing a function, is_non_blocking_path(), to check if a cpu
can be blocked in current path.With this patch, pstore is not blocked even if another cpu has
taken a spin_lock, in those paths by changing from spin_lock_irqsave
to spin_trylock_irqsave.In addition, according to a comment of emergency_restart() in kernel/sys.c,
spin_lock shouldn't be taken in an emergency_restart path to avoid
deadlock. This patch fits the comment below./**
* emergency_restart - reboot the system
*
* Without shutting down any hardware or taking any locks
* reboot the system. This is called when we know we are in
* trouble so this is our best effort to reboot. This is
* safe to call in interrupt context.
*/
void emergency_restart(void)Signed-off-by: Seiji Aguchi
Acked-by: Don Zickus
Signed-off-by: Tony Luck
04 Jan, 2013
1 commit
-
CONFIG_HOTPLUG is going away as an option. As a result, the __dev*
markings need to be removed.This change removes the use of __devinit from the pstore filesystem.
Based on patches originally written by Bill Pemberton, but redone by me
in order to handle some of the coding style issues better, by hand.Cc: Bill Pemberton
Cc: Anton Vorontsov
Cc: Colin Cross
Cc: Kees Cook
Cc: Tony Luck
Signed-off-by: Greg Kroah-Hartman
18 Dec, 2012
1 commit
-
But the kernel decided to call it "origin" instead. Fix most of the
sites.Acked-by: Hugh Dickins
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
16 Dec, 2012
1 commit
-
Pull pstore update from Anton Vorontsov:
"Here are just a few fixups for the pstore subsystem, nothing special
this time"* tag 'for-v3.8' of git://git.infradead.org/users/cbou/linux-pstore:
pstore/ftrace: Adjust for ftrace_ops->func prototype change
pstore/ram: Fix bounds checks for mem_size, record_size, console_size and ftrace_size
pstore/ram: Fix undefined usage of rounddown_pow_of_two(0)
pstore/ram: Fixup section annotations
13 Dec, 2012
1 commit
-
This commit fixes the following warning:
fs/pstore/ftrace.c:51:2: warning: initialization from incompatible
pointer type [enabled by default]
fs/pstore/ftrace.c:51:2: warning: (near initialization for
‘pstore_ftrace_ops.func’) [enabled by defaulaSigned-off-by: Anton Vorontsov