09 Aug, 2014
1 commit
-
kmalloc_array manages count*sizeof overflow.
Signed-off-by: Fabian Frederick
Cc: Anton Vorontsov
Cc: Colin Cross
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
07 Jun, 2014
1 commit
-
- Define pr_fmt in plateform.c and ram_core.c for global prefix.
- Coalesce format fragments.
- Separate format/arguments on lines > 80 characters.
Note: Some pr_foo() were initially declared without prefix and therefore
this could break existing log analyzer.[akpm@linux-foundation.org: missed a couple of prefix removals]
Signed-off-by: Fabian Frederick
Cc: Joe Perches
Cc: Anton Vorontsov
Cc: Colin Cross
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
05 Apr, 2014
1 commit
-
Pull ext4 updates from Ted Ts'o:
"Major changes for 3.14 include support for the newly added ZERO_RANGE
and COLLAPSE_RANGE fallocate operations, and scalability improvements
in the jbd2 layer and in xattr handling when the extended attributes
spill over into an external block.Other than that, the usual clean ups and minor bug fixes"
* tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (42 commits)
ext4: fix premature freeing of partial clusters split across leaf blocks
ext4: remove unneeded test of ret variable
ext4: fix comment typo
ext4: make ext4_block_zero_page_range static
ext4: atomically set inode->i_flags in ext4_set_inode_flags()
ext4: optimize Hurd tests when reading/writing inodes
ext4: kill i_version support for Hurd-castrated file systems
ext4: each filesystem creates and uses its own mb_cache
fs/mbcache.c: doucple the locking of local from global data
fs/mbcache.c: change block and index hash chain to hlist_bl_node
ext4: Introduce FALLOC_FL_ZERO_RANGE flag for fallocate
ext4: refactor ext4_fallocate code
ext4: Update inode i_size after the preallocation
ext4: fix partial cluster handling for bigalloc file systems
ext4: delete path dealloc code in ext4_ext_handle_uninitialized_extents
ext4: only call sync_filesystm() when remounting read-only
fs: push sync_filesystem() down to the file system's remount_fs()
jbd2: improve error messages for inconsistent journal heads
jbd2: minimize region locked by j_list_lock in jbd2_journal_forget()
jbd2: minimize region locked by j_list_lock in journal_get_create_access()
...
18 Mar, 2014
6 commits
-
After sucessful decompressing, the buffer which pointed by 'buf' will be
lost as 'buf' is overwrite by 'big_oops_buf' and will never be freed.Signed-off-by: Liu ShuoX
Acked-by: Kees Cook
Signed-off-by: Tony Luck -
In case new offset is equal to prz->buffer_size, it won't wrap at this
time and will return old(overflow) value next time.Signed-off-by: Liu ShuoX
Acked-by: Kees Cook
Signed-off-by: Tony Luck -
In case that ramoops_init_przs failed, max_dump_cnt won't be reset to
zero in error handle path.Signed-off-by: Liu ShuoX
Acked-by: Kees Cook
Signed-off-by: Tony Luck -
ramoops_get_next_prz get the prz according the paramters. If it get a
uninitialized prz, access its members by following persistent_ram_old_size(prz)
will cause a NULL pointer crash.
Ex: if ftrace_size is 0, fprz will be NULL.Fix it by return NULL in advance.
Signed-off-by: Liu ShuoX
Acked-by: Kees Cook
Signed-off-by: Tony Luck -
In ramoops_pstore_read, a valid prz pointer with zero size buffer will
break traverse of all persistent ram buffers. The latter buffer might be
lost.Signed-off-by: Liu ShuoX
Cc: "Zhang, Yanmin"
Cc: Colin Cross
Reviewed-by: Kees Cook
Signed-off-by: Andrew Morton
Signed-off-by: Tony Luck -
*_read_cnt in ramoops_context need to be cleared during pstore ->open to
support mutli times getting the records. The patch added missed
ftrace_read_cnt clearing and removed duplicate clearing in ramoops_probe.Signed-off-by: Liu ShuoX
Cc: "Zhang, Yanmin"
Cc: Colin Cross
Cc: Kees Cook
Signed-off-by: Andrew Morton
Signed-off-by: Tony Luck
13 Mar, 2014
1 commit
-
Previously, the no-op "mount -o mount /dev/xxx" operation when the
file system is already mounted read-write causes an implied,
unconditional syncfs(). This seems pretty stupid, and it's certainly
documented or guaraunteed to do this, nor is it particularly useful,
except in the case where the file system was mounted rw and is getting
remounted read-only.However, it's possible that there might be some file systems that are
actually depending on this behavior. In most file systems, it's
probably fine to only call sync_filesystem() when transitioning from
read-write to read-only, and there are some file systems where this is
not needed at all (for example, for a pseudo-filesystem or something
like romfs).Signed-off-by: "Theodore Ts'o"
Cc: linux-fsdevel@vger.kernel.org
Cc: Christoph Hellwig
Cc: Artem Bityutskiy
Cc: Adrian Hunter
Cc: Evgeniy Dushistov
Cc: Jan Kara
Cc: OGAWA Hirofumi
Cc: Anders Larsen
Cc: Phillip Lougher
Cc: Kees Cook
Cc: Mikulas Patocka
Cc: Petr Vandrovec
Cc: xfs@oss.sgi.com
Cc: linux-btrfs@vger.kernel.org
Cc: linux-cifs@vger.kernel.org
Cc: samba-technical@lists.samba.org
Cc: codalist@coda.cs.cmu.edu
Cc: linux-ext4@vger.kernel.org
Cc: linux-f2fs-devel@lists.sourceforge.net
Cc: fuse-devel@lists.sourceforge.net
Cc: cluster-devel@redhat.com
Cc: linux-mtd@lists.infradead.org
Cc: jfs-discussion@lists.sourceforge.net
Cc: linux-nfs@vger.kernel.org
Cc: linux-nilfs@vger.kernel.org
Cc: linux-ntfs-dev@lists.sourceforge.net
Cc: ocfs2-devel@oss.oracle.com
Cc: reiserfs-devel@vger.kernel.org
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