Joe Perches [Fri, 8 Aug 2014 21:24:19 +0000 (14:24 -0700)]
i810: use pci_zalloc_consistent
Remove the now unnecessary memset too.
Signed-off-by: Joe Perches <[email protected]>
Cc: David Airlie <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Joe Perches [Fri, 8 Aug 2014 21:24:16 +0000 (14:24 -0700)]
infiniband: use pci_zalloc_consistent
Remove the now unnecessary memset too.
Signed-off-by: Joe Perches <[email protected]>
Cc: Tom Tucker <[email protected]>
Acked-by: Steve Wise <[email protected]>
Cc: Roland Dreier <[email protected]>
Cc: Sean Hefty <[email protected]>
Cc: Hal Rosenstock <[email protected]>
Cc: Faisal Latif <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Joe Perches [Fri, 8 Aug 2014 21:24:14 +0000 (14:24 -0700)]
crypto: use pci_zalloc_consistent
Remove the now unnecessary memset too.
Signed-off-by: Joe Perches <[email protected]>
Herbert Xu <
[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Joe Perches [Fri, 8 Aug 2014 21:24:12 +0000 (14:24 -0700)]
block: use pci_zalloc_consistent
Remove the now unnecessary memset too.
Signed-off-by: Joe Perches <[email protected]>
Mike Miller <
[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Joe Perches [Fri, 8 Aug 2014 21:24:10 +0000 (14:24 -0700)]
atm: use pci_zalloc_consistent
Remove the now unnecessary memset too.
Signed-off-by: Joe Perches <[email protected]>
Cc: Chas Williams <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Joe Perches [Fri, 8 Aug 2014 21:24:08 +0000 (14:24 -0700)]
pci-dma-compat: add pci_zalloc_consistent helper
Add this helper for consistency with pci_zalloc_coherent
and the ability to remove unnecessary memset(,0,) uses.
Signed-off-by: Joe Perches <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: "John W. Linville" <[email protected]>
Cc: "Stephen M. Cameron" <[email protected]>
Cc: Adam Radford <[email protected]>
Cc: Chaoming Li <[email protected]>
Cc: Chas Williams <[email protected]>
Cc: Christian Benvenuti <[email protected]>
Cc: Christopher Harrer <[email protected]>
Cc: Dario Ballabio <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Don Fry <[email protected]>
Cc: Faisal Latif <[email protected]>
Cc: Forest Bond <[email protected]>
Cc: Govindarajulu Varadarajan <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Hal Rosenstock <[email protected]>
Cc: Hans Verkuil <[email protected]>
Cc: Jayamohan Kallickal <[email protected]>
Cc: Jiri Slaby <[email protected]>
Cc: Jitendra Kalsaria <[email protected]>
Cc: Larry Finger <[email protected]>
Cc: Lennert Buytenhek <[email protected]>
Cc: Lior Dotan <[email protected]>
Cc: Manish Chopra <[email protected]>
Cc: Manohar Vanga <[email protected]>
Cc: Martyn Welch <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Michael Neuffer <[email protected]>
Cc: Mirko Lindner <[email protected]>
Cc: Neel Patel <[email protected]>
Cc: Neela Syam Kolli <[email protected]>
Cc: Rajesh Borundia <[email protected]>
Cc: Roland Dreier <[email protected]>
Cc: Ron Mercer <[email protected]>
Cc: Samuel Ortiz <[email protected]>
Cc: Sean Hefty <[email protected]>
Cc: Shahed Shaikh <[email protected]>
Cc: Sony Chacko <[email protected]>
Cc: Stanislav Yakovlev <[email protected]>
Cc: Stephen Hemminger <[email protected]>
Cc: Steve Wise <[email protected]>
Cc: Sujith Sankar <[email protected]>
Cc: Tom Tucker <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Daniel Walter [Fri, 8 Aug 2014 21:24:05 +0000 (14:24 -0700)]
drivers/scsi: replace strict_strto calls
Replace obsolete strict_strto with more appropriate kstrto calls
Signed-off-by: Daniel Walter <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Daniel Walter [Fri, 8 Aug 2014 21:24:03 +0000 (14:24 -0700)]
arch/x86: replace strict_strto calls
Replace obsolete strict_strto calls with appropriate kstrto calls
Signed-off-by: Daniel Walter <[email protected]>
Acked-by: Borislav Petkov <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Daniel Walter [Fri, 8 Aug 2014 21:24:01 +0000 (14:24 -0700)]
arch/powerpc: replace obsolete strict_strto* calls
Replace strict_strto calls with more appropriate kstrto calls
Signed-off-by: Daniel Walter <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Daniel Walter [Fri, 8 Aug 2014 21:23:59 +0000 (14:23 -0700)]
arch/arm/mach-w90x900/cpu.c: replace obsolete strict_strto
Replace obsolete strict_strto with kstrto calls
Signed-off-by: Daniel Walter <[email protected]>
Cc: Wan ZongShun <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Daniel Walter [Fri, 8 Aug 2014 21:23:57 +0000 (14:23 -0700)]
arch/arm/mach-s3c24xx/mach-jive.c: replace strict_strto* with kstrto*
Replace obsolete strict_strto call with kstrto
Signed-off-by: Daniel Walter <[email protected]>
Cc: Ben Dooks <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Daniel Walter [Fri, 8 Aug 2014 21:23:54 +0000 (14:23 -0700)]
arch/arm/mach-pxa: replace strict_strto call with kstrto
Replace obsolete call to strict_strto with kstrto
Signed-off-by: Daniel Walter <[email protected]>
Cc: Eric Miao <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Daniel Walter [Fri, 8 Aug 2014 21:23:52 +0000 (14:23 -0700)]
arch/arm/mach-omap2: replace strict_strto* with kstrto*
Replace obsolete strict_strto call with kstrto calls.
Simplify copy_from_user/strict_strto by using kstrto_from_user
Signed-off-by: Daniel Walter <[email protected]>
Cc: Tony Lindgren <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Michael Opdenacker [Fri, 8 Aug 2014 21:23:50 +0000 (14:23 -0700)]
MAINTAINERS: update IBM ServeRAID RAID info
- Invalid maintainer e-mail address:
Mail server reply:
Recipient address rejected: User unknown in virtual alias table
- Remove no longer working webpage URL
- Remove obsolete "Person" field
- Move status to "Orphan"
- Add Dave Jeffery and Jack Hammer to the CREDITS file
Signed-off-by: Michael Opdenacker <[email protected]>
Reviewed-by: Jean Delvare <[email protected]>
Cc: David Jeffery <[email protected]>
Cc: James Bottomley <[email protected]>
Cc: Paul Bolle <[email protected]>
Reviewed-by: Jingoo Han <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Joe Perches [Fri, 8 Aug 2014 21:23:48 +0000 (14:23 -0700)]
MAINTAINERS: remove two ancient EATA sections
These haven't had a single ack by the listed maintainer in all git history
and the email addresses don't work.
An EATA entry for Michael Neuffer is already in CREDITS.
Signed-off-by: Joe Perches <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Richard Weinberger [Fri, 8 Aug 2014 21:23:46 +0000 (14:23 -0700)]
update Roland McGrath's mail
[email protected] bounces, change it to
[email protected].
Signed-off-by: Richard Weinberger <[email protected]>
Acked-by: Roland McGrath <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Fabian Frederick [Fri, 8 Aug 2014 21:23:44 +0000 (14:23 -0700)]
init/main.c: code clean-up
Fixing some checkpatch warnings(remove global initialization, move
__initdata, coalesce formats ...)
Signed-off-by: Fabian Frederick <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Ionut Alexa [Fri, 8 Aug 2014 21:23:42 +0000 (14:23 -0700)]
kernel/acct.c: fix coding style warnings and errors
Signed-off-by: Ionut Alexa <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Andy Lutomirski [Fri, 8 Aug 2014 21:23:40 +0000 (14:23 -0700)]
arm64,ia64,ppc,s390,sh,tile,um,x86,mm: remove default gate area
The core mm code will provide a default gate area based on
FIXADDR_USER_START and FIXADDR_USER_END if
!defined(__HAVE_ARCH_GATE_AREA) && defined(AT_SYSINFO_EHDR).
This default is only useful for ia64. arm64, ppc, s390, sh, tile, 64-bit
UML, and x86_32 have their own code just to disable it. arm, 32-bit UML,
and x86_64 have gate areas, but they have their own implementations.
This gets rid of the default and moves the code into ia64.
This should save some code on architectures without a gate area: it's now
possible to inline the gate_area functions in the default case.
Signed-off-by: Andy Lutomirski <[email protected]>
Acked-by: Nathan Lynch <[email protected]>
Acked-by: H. Peter Anvin <[email protected]>
Acked-by: Benjamin Herrenschmidt <[email protected]> [in principle]
Acked-by: Richard Weinberger <[email protected]> [for um]
Acked-by: Will Deacon <[email protected]> [for arm64]
Cc: Catalin Marinas <[email protected]>
Cc: Will Deacon <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Fenghua Yu <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Martin Schwidefsky <[email protected]>
Cc: Heiko Carstens <[email protected]>
Cc: Chris Metcalf <[email protected]>
Cc: Jeff Dike <[email protected]>
Cc: Richard Weinberger <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Cc: Nathan Lynch <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Fabian Frederick [Fri, 8 Aug 2014 21:23:37 +0000 (14:23 -0700)]
fs/dlm/debug_fs.c: remove unnecessary null test before debugfs_remove
This fixes checkpatch warning:
WARNING: debugfs_remove(NULL) is safe this check is probably not required
Signed-off-by: Fabian Frederick <[email protected]>
Cc: Christine Caulfield <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Konstantin Khlebnikov [Fri, 8 Aug 2014 21:23:35 +0000 (14:23 -0700)]
scripts/checkstack.pl: automatically handle 32-bit and 64-bit mode for ARCH=x86
This patch adds support for ARCH=x86 into checkstack.
Commit
ffee0de411fd ("x86: Default to ARCH=x86 to avoid overriding
CONFIG_64BIT") had merged ARCH=i386 and ARCH=x86_64 into one ARCH=x86.
checkstack.pl searches patterns of machine instructions which are
usually used for allocating stack frames. checkstalk.pl needs either
i386 or x86_64, x86 isn't enough:
$ make checkstack
objdump -d vmlinux $(find . -name '*.ko') | \
perl linux/scripts/checkstack.pl x86
wrong or unknown architecture "x86"
Signed-off-by: Konstantin Khlebnikov <[email protected]>
Cc: David Woodhouse <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Cc: Richard Weinberger <[email protected]>
Cc: Geert Uytterhoeven <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Catalin Marinas [Fri, 8 Aug 2014 21:23:33 +0000 (14:23 -0700)]
scripts/tags.sh: include compat_sys_* symbols in the generated tags
Since the kernel now has a COMPAT_SYSCALL infrastructure via commit
468366138850 ("COMPAT_SYSCALL_DEFINE: infrastructure"), add the
corresponding regex for generating compat_sys_* symbols in the tags
files (similar to sys_*).
Signed-off-by: Catalin Marinas <[email protected]>
Cc: Alexander Viro <[email protected]>
Cc: Michal Marek <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Fabian Frederick [Fri, 8 Aug 2014 21:23:31 +0000 (14:23 -0700)]
scripts/coccinelle/free/ifnullfree.cocci: add copyright information
All coccinelle scripts have a copyright in the header.
Signed-off-by: Fabian Frederick <[email protected]>
Suggested-by: Julia Lawall <[email protected]>
Acked-by: Julia Lawall <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Fabian Frederick [Fri, 8 Aug 2014 21:23:29 +0000 (14:23 -0700)]
scripts/coccinelle/free: add NULL test before freeing functions
Warns or generates patch for NULL check before the following functions:
kfree
usb_free_urb
debugfs_remove
debugfs_remove_recursive
Signed-off-by: Fabian Frederick <[email protected]>
Acked-by: Julia Lawall <[email protected]>
Cc: Gilles Muller <[email protected]>
Cc: Joe Perches <[email protected]>
Cc: Markus Elfring <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Laura Abbott [Fri, 8 Aug 2014 21:23:27 +0000 (14:23 -0700)]
lib/scatterlist: clean up useless architecture versions of scatterlist.h
There's no need to have an architecture version of scatterlist.h if the
only thing the file does is include asm-generic/scatterlist.h. Switch to
the asm-generic versions directly.
Acked-by: Jesper Nilsson <[email protected]>
Acked-by: David Howells <[email protected]>
Signed-off-by: Laura Abbott <[email protected]>
Cc: Lennox Wu <[email protected]>
Cc: Chen Liqin <[email protected]>,
Cc: Koichi Yasutake <[email protected]>
Cc: Michal Simek <[email protected]>
Cc: Hirokazu Takata <[email protected]>
Cc: Mikael Starvik <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: Heiko Carstens <[email protected]>
Cc: Russell King <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Fenghua Yu <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: Martin Schwidefsky <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Laura Abbott [Fri, 8 Aug 2014 21:23:25 +0000 (14:23 -0700)]
lib/scatterlist: make ARCH_HAS_SG_CHAIN an actual Kconfig
Rather than have architectures #define ARCH_HAS_SG_CHAIN in an
architecture specific scatterlist.h, make it a proper Kconfig option and
use that instead. At same time, remove the header files are are now
mostly useless and just include asm-generic/scatterlist.h.
[
[email protected]: powerpc files now need asm/dma.h]
Signed-off-by: Laura Abbott <[email protected]>
Acked-by: Thomas Gleixner <[email protected]> [x86]
Acked-by: Benjamin Herrenschmidt <[email protected]> [powerpc]
Acked-by: Heiko Carstens <[email protected]>
Cc: Russell King <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Fenghua Yu <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: Martin Schwidefsky <[email protected]>
Signed-off-by: Stephen Rothwell <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Jack Miller [Fri, 8 Aug 2014 21:23:23 +0000 (14:23 -0700)]
shm: remove unneeded extern for function
A small cleanup while changing adjacent code. Extern is not needed for
functions and only one declaration had it so remove it from the odd line.
Signed-off-by: Milton Miller <[email protected]>
Signed-off-by: Jack Miller <[email protected]>
Cc: Davidlohr Bueso <[email protected]>
Cc: Manfred Spraul <[email protected]>
Cc: Anton Blanchard <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Jack Miller [Fri, 8 Aug 2014 21:23:21 +0000 (14:23 -0700)]
shm: allow exit_shm in parallel if only marking orphans
If shm_rmid_force (the default state) is not set then the shmids are only
marked as orphaned and does not require any add, delete, or locking of the
tree structure.
Seperate the sysctl on and off case, and only obtain the read lock. The
newly added list head can be deleted under the read lock because we are
only called with current and will only change the semids allocated by this
task and not manipulate the list.
This commit assumes that up_read includes a sufficient memory barrier for
the writes to be seen my others that later obtain a write lock.
Signed-off-by: Milton Miller <[email protected]>
Signed-off-by: Jack Miller <[email protected]>
Cc: Davidlohr Bueso <[email protected]>
Cc: Manfred Spraul <[email protected]>
Cc: Anton Blanchard <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Jack Miller [Fri, 8 Aug 2014 21:23:19 +0000 (14:23 -0700)]
shm: make exit_shm work proportional to task activity
This is small set of patches our team has had kicking around for a few
versions internally that fixes tasks getting hung on shm_exit when there
are many threads hammering it at once.
Anton wrote a simple test to cause the issue:
http://ozlabs.org/~anton/junkcode/bust_shm_exit.c
Before applying this patchset, this test code will cause either hanging
tracebacks or pthread out of memory errors.
After this patchset, it will still produce output like:
root@somehost:~# ./bust_shm_exit 1024 160
...
INFO: rcu_sched detected stalls on CPUs/tasks: {} (detected by 116, t=2111 jiffies, g=241, c=240, q=7113)
INFO: Stall ended before state dump start
...
But the task will continue to run along happily, so we consider this an
improvement over hanging, even if it's a bit noisy.
This patch (of 3):
exit_shm obtains the ipc_ns shm rwsem for write and holds it while it
walks every shared memory segment in the namespace. Thus the amount of
work is related to the number of shm segments in the namespace not the
number of segments that might need to be cleaned.
In addition, this occurs after the task has been notified the thread has
exited, so the number of tasks waiting for the ns shm rwsem can grow
without bound until memory is exausted.
Add a list to the task struct of all shmids allocated by this task. Init
the list head in copy_process. Use the ns->rwsem for locking. Add
segments after id is added, remove before removing from id.
On unshare of NEW_IPCNS orphan any ids as if the task had exited, similar
to handling of semaphore undo.
I chose a define for the init sequence since its a simple list init,
otherwise it would require a function call to avoid include loops between
the semaphore code and the task struct. Converting the list_del to
list_del_init for the unshare cases would remove the exit followed by
init, but I left it blow up if not inited.
Signed-off-by: Milton Miller <[email protected]>
Signed-off-by: Jack Miller <[email protected]>
Cc: Davidlohr Bueso <[email protected]>
Cc: Manfred Spraul <[email protected]>
Cc: Anton Blanchard <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
David Engraf [Fri, 8 Aug 2014 21:23:16 +0000 (14:23 -0700)]
initramfs: add write error checks
On a system with low memory extracting the initramfs may fail. If this
happens the user gets "Failed to execute /init" instead of an initramfs
error.
Check return value of sys_write and call error() when the write was
incomplete or failed.
Signed-off-by: David Engraf <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Yinghai Lu [Fri, 8 Aug 2014 21:23:14 +0000 (14:23 -0700)]
initramfs: support initramfs that is bigger than 2GiB
Now with 64bit bzImage and kexec tools, we support ramdisk that size is
bigger than 2g, as we could put it above 4G.
Found compressed initramfs image could not be decompressed properly. It
turns out that image length is int during decompress detection, and it
will become < 0 when length is more than 2G. Furthermore, during
decompressing len as int is used for inbuf count, that has problem too.
Change len to long, that should be ok as on 32 bit platform long is
32bits.
Tested with following compressed initramfs image as root with kexec.
gzip, bzip2, xz, lzma, lzop, lz4.
run time for populate_rootfs():
size name Nehalem-EX Westmere-EX Ivybridge-EX
9034400256 root_img : 26s 24s 30s
3561095057 root_img.lz4 : 28s 27s 27s
3459554629 root_img.lzo : 29s 29s 28s
3219399480 root_img.gz : 64s 62s 49s
2251594592 root_img.xz : 262s 260s 183s
2226366598 root_img.lzma: 386s 376s 277s
2901482513 root_img.bz2 : 635s 599s
Signed-off-by: Yinghai Lu <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Rashika Kheria <[email protected]>
Cc: Josh Triplett <[email protected]>
Cc: Kyungsik Lee <[email protected]>
Cc: P J P <[email protected]>
Cc: Al Viro <[email protected]>
Cc: Tetsuo Handa <[email protected]>
Cc: "Daniel M. Weeks" <[email protected]>
Cc: Alexandre Courbot <[email protected]>
Cc: Jan Beulich <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Yinghai Lu [Fri, 8 Aug 2014 21:23:12 +0000 (14:23 -0700)]
initramfs: support initrd that is bigger than 2GiB
When initrd (compressed or not) is used, kernel report data corrupted with
/dev/ram0.
The root cause:
During initramfs checking, if it is initrd, it will be transferred to
/initrd.image with sys_write.
sys_write only support 2G-4K write, so if the initrd ram is more than
that, /initrd.image will not complete at all.
Add local xwrite to loop calling sys_write to workaround the problem.
Also need to use xwrite in write_buffer() to handle:
image is uncompressed cpio and there is one big file (>2G) in it.
unpack_to_rootfs ===> write_buffer ===> actions[]/do_copy
At the same time, we don't need to worry about sys_read/sys_write in
do_mounts_rd.c::crd_load. As decompressor will have fill/flush and local
buffer that is smaller than 2G.
Test with uncompressed initrd, and compressed ones with gz, bz2, lzma,xz,
lzop.
Signed-off-by: Yinghai Lu <[email protected]>
Acked-by: H. Peter Anvin <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Geert Uytterhoeven <[email protected]>
Cc: Tetsuo Handa <[email protected]>
Cc: "Daniel M. Weeks" <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Yinghai Lu [Fri, 8 Aug 2014 21:23:10 +0000 (14:23 -0700)]
initrd: fix lz4 decompress with initrd
During testing initrd (>2G) support, find decompress/lz4 does not work
with initrd at all.
decompress_* should support:
1. inbuf[]/outbuf[] for kernel preboot.
2. inbuf[]/flush() for initramfs
3. fill()/flush() for initrd.
in the unlz4 does not handle case 3, as input len is passed as 0, and it
failed in first try.
Fix that add one extra if (fill) checking, and get out if EOF from the
fill().
Signed-off-by: Yinghai Lu <[email protected]>
Cc: Kyungsik Lee <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Fabian Frederick [Fri, 8 Aug 2014 21:23:07 +0000 (14:23 -0700)]
fs/qnx6: update debugging to current functions
Add DDEBUG in Makefile when CONFIG_QNX6FS_DEBUG is set. All QNX6DEBUG
messages are replaced by pr_debug which means debugging will be emitted in
debug level only and no more in error and info levels. debug uses now
pr_fmt and __func__
QNX6DEBUG definition has been removed.
Signed-off-by: Fabian Frederick <[email protected]>
Cc: Joe Perches <[email protected]>
Cc: Kai Bankett <[email protected]>
Cc: Al Viro <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Fabian Frederick [Fri, 8 Aug 2014 21:23:05 +0000 (14:23 -0700)]
fs/qnx6: use pr_fmt and __func__ in logging
Remove "qnx6:" and "qnx6: " from each logging instruction.
Signed-off-by: Fabian Frederick <[email protected]>
Cc: Joe Perches <[email protected]>
Cc: Kai Bankett <[email protected]>
Cc: Al Viro <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Fabian Frederick [Fri, 8 Aug 2014 21:23:03 +0000 (14:23 -0700)]
fs/qnx6: convert printk to pr_foo()
Use current logging functions.
Coalesce formats.
Signed-off-by: Fabian Frederick <[email protected]>
Cc: Joe Perches <[email protected]>
Cc: Kai Bankett <[email protected]>
Cc: Al Viro <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Fabian Frederick [Fri, 8 Aug 2014 21:23:01 +0000 (14:23 -0700)]
fs/romfs/super.c: add blank line after declarations
Fix checkpatch warning:
WARNING: Missing a blank line after declarations
Signed-off-by: Fabian Frederick <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Fabian Frederick [Fri, 8 Aug 2014 21:22:59 +0000 (14:22 -0700)]
fs/romfs/super.c: use pr_fmt in logging
- Remove "Error" in format logging (already in pr_ level)
- Use modulename in pr_fmt instead of ROMFS: in each pr_ callsites.
Signed-off-by: Fabian Frederick <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Fabian Frederick [Fri, 8 Aug 2014 21:22:57 +0000 (14:22 -0700)]
fs/romfs/super.c: convert printk to pr_foo()
Use current logging functions. Coalesce formats.
Signed-off-by: Fabian Frederick <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Fabian Frederick [Fri, 8 Aug 2014 21:22:55 +0000 (14:22 -0700)]
fs/cramfs/inode.c: use linux/uaccess.h
Fixes checkpatch warning:
WARNING: Use #include <linux/uaccess.h> instead of <asm/uaccess.h>
Signed-off-by: Fabian Frederick <[email protected]>
Cc: "Theodore Ts'o" <[email protected]>
Cc: Sasha Levin <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Fabian Frederick [Fri, 8 Aug 2014 21:22:52 +0000 (14:22 -0700)]
fs/cramfs: code clean-up
Fixes some checkpatch errors/warnings:
WARNING: Missing a blank line after declarations
ERROR: spaces required around that '=' (ctx:VxV)
ERROR: "foo * bar" should be "foo *bar"
ERROR: space prohibited after that open parenthesis '('
Signed-off-by: Fabian Frederick <[email protected]>
Cc: "Theodore Ts'o" <[email protected]>
Cc: Sasha Levin <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Fabian Frederick [Fri, 8 Aug 2014 21:22:50 +0000 (14:22 -0700)]
fs/cramfs: use pr_fmt
Use module name for "cramfs: " prefix. (note that uncompress.c printk had
no prefix).
Signed-off-by: Fabian Frederick <[email protected]>
Cc: "Theodore Ts'o" <[email protected]>
Cc: Sasha Levin <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Fabian Frederick [Fri, 8 Aug 2014 21:22:48 +0000 (14:22 -0700)]
fs/cramfs: convert printk to pr_foo()
Use current logging functions. No level printk converted to pr_err
Signed-off-by: Fabian Frederick <[email protected]>
Cc: "Theodore Ts'o" <[email protected]>
Cc: Sasha Levin <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Thierry Fauck [Fri, 8 Aug 2014 21:22:46 +0000 (14:22 -0700)]
tools/testing/selftests/ptrace/peeksiginfo.c: add PAGE_SIZE definition
On IBM powerpc where multiple page size value are supported, current
ppc64 and ppc64el distro don't define the PAGE_SIZE variable in
/usr/include as this is a dynamic value retrieved by the getpagesize()
or sysconf() defined in unistd.h. The PAGE_SIZE variable sounds defined
when only one value is supported by the kernel.
As such, when the PAGE_SIZE definition doesn't exist system should
retrieve the dynamic value.
Signed-off-by: Thierry Fauck <[email protected]>
Cc: Andrey Vagin <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Himangi Saraogi [Fri, 8 Aug 2014 21:22:44 +0000 (14:22 -0700)]
kfifo: use BUG_ON
Use BUG_ON(x) rather than if(x) BUG();
The semantic patch that fixes this problem is as follows:
// <smpl>
@@ identifier x; @@
-if (!x) BUG();
+BUG_ON(!x);
// </smpl>
Signed-off-by: Himangi Saraogi <[email protected]>
Acked-by: Julia Lawall <[email protected]>
Cc: Stefani Seibold <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Fabian Frederick [Fri, 8 Aug 2014 21:22:41 +0000 (14:22 -0700)]
fs/omfs/inode.c: replace count*size kzalloc by kcalloc
kcalloc manages count*sizeof overflow.
Signed-off-by: Fabian Frederick <[email protected]>
Acked-by: Bob Copeland <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Fabian Frederick [Fri, 8 Aug 2014 21:22:35 +0000 (14:22 -0700)]
fs/pstore/ram_core.c: replace count*size kmalloc by kmalloc_array
kmalloc_array manages count*sizeof overflow.
Signed-off-by: Fabian Frederick <[email protected]>
Cc: Anton Vorontsov <[email protected]>
Cc: Colin Cross <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Fabian Frederick [Fri, 8 Aug 2014 21:22:33 +0000 (14:22 -0700)]
drivers/parport/parport_ip32.c: use PTR_ERR_OR_ZERO
replace IS_ERR/PTR_ERR
Signed-off-by: Fabian Frederick <[email protected]>
Cc: Wolfram Sang <[email protected]>
Cc: Linus Walleij <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Josh Hunt [Fri, 8 Aug 2014 21:22:31 +0000 (14:22 -0700)]
panic: add TAINT_SOFTLOCKUP
This taint flag will be set if the system has ever entered a softlockup
state. Similar to TAINT_WARN it is useful to know whether or not the
system has been in a softlockup state when debugging.
[
[email protected]: apply the taint before calling panic()]
Signed-off-by: Josh Hunt <[email protected]>
Cc: Jason Baron <[email protected]>
Cc: Randy Dunlap <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Fabian Frederick [Fri, 8 Aug 2014 21:22:29 +0000 (14:22 -0700)]
fs/bfs: use bfs prefix for dump_imap
All bfs related functions use bfs_ prefix. This patch also moves extern
declaration to bfs.h and removes prototype from inode.c
This fixes checkpatch warning:
WARNING: externs should be avoided in .c files
Signed-off-by: Fabian Frederick <[email protected]>
Cc: "Tigran A. Aivazian" <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Joe Perches [Fri, 8 Aug 2014 21:22:26 +0000 (14:22 -0700)]
adfs: add __printf verification, fix format/argument mismatches
Might as well do the right thing.
Signed-off-by: Joe Perches <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Fabian Frederick [Fri, 8 Aug 2014 21:22:24 +0000 (14:22 -0700)]
fs/adfs/dir_fplus.c: replace count*size kzalloc by kcalloc
kcalloc manages count*sizeof overflow.
Signed-off-by: Fabian Frederick <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Fabian Frederick [Fri, 8 Aug 2014 21:22:22 +0000 (14:22 -0700)]
fs/adfs/dir_fplus.c: use ARRAY_SIZE instead of sizeof/sizeof[0]
Use kernel.h definition.
Signed-off-by: Fabian Frederick <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Fabian Frederick [Fri, 8 Aug 2014 21:22:20 +0000 (14:22 -0700)]
kernel/gcov/fs.c: remove unnecessary null test before debugfs_remove
This fixes checkpatch warning:
WARNING: debugfs_remove(NULL) is safe this check is probably not required
Signed-off-by: Fabian Frederick <[email protected]>
Cc: Peter Oberparleiter <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Fabian Frederick [Fri, 8 Aug 2014 21:22:18 +0000 (14:22 -0700)]
fs/exofs/ore_raid.c: replace count*size kzalloc by kcalloc
kcalloc manages count*sizeof overflow.
Signed-off-by: Fabian Frederick <[email protected]>
Acked-by: Boaz Harrosh <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Joe Perches [Fri, 8 Aug 2014 21:22:16 +0000 (14:22 -0700)]
sysctl: remove typedef ctl_table
Remove the final user, and the typedef itself.
Signed-off-by: Joe Perches <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Wei Yang [Fri, 8 Aug 2014 21:22:14 +0000 (14:22 -0700)]
lib/rbtree.c: fix typo in comment of __rb_insert()
In case 1, it passes down the BLACK color from G to p and u, and maintains
the color of n. By doing so, it maintains the black height of the
sub-tree.
While in the comment, it marks the color of n to BLACK. This is a typo
and not consistents with the code.
This patch fixs this typo in comment.
Signed-off-by: Wei Yang <[email protected]>
Acked-by: Michel Lespinasse <[email protected]>
Cc: Xiao Guangrong <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Alexandre Bounine [Fri, 8 Aug 2014 21:22:12 +0000 (14:22 -0700)]
rapidio/tsi721_dma: rework scatter-gather list handling
Rework Tsi721 RapidIO DMA engine support to allow handling data
scatter/gather lists longer than number of hardware buffer descriptors in
the DMA channel's descriptor list.
The current implementation of Tsi721 DMA transfers requires that number of
entries in a scatter/gather list provided by a caller of
dmaengine_prep_rio_sg() should not exceed number of allocated hardware
buffer descriptors.
This patch removes the limitation by processing long scatter/gather lists
by sections that can be transferred using hardware descriptor ring of
configured size. It also introduces a module parameter
"dma_desc_per_channel" to allow run-time configuration of Tsi721 hardware
buffer descriptor rings.
Signed-off-by: Alexandre Bounine <[email protected]>
Cc: Matt Porter <[email protected]>
Cc: Andre van Herk <[email protected]>
Cc: Stef van Os <[email protected]>
Cc: Vinod Koul <[email protected]>
Cc: Dan Williams <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Alexandre Bounine [Fri, 8 Aug 2014 21:22:09 +0000 (14:22 -0700)]
rapidio: add new RapidIO DMA interface routines
Add RapidIO DMA interface routines that directly use reference to the mport
device object and/or target device destination ID as parameters.
This allows to perform RapidIO DMA transfer requests by modules that do not
have an access to the RapidIO device list.
Signed-off-by: Alexandre Bounine <[email protected]>
Cc: Matt Porter <[email protected]>
Cc: Andre van Herk <[email protected]>
Cc: Stef van Os <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Andrey Ryabinin [Fri, 8 Aug 2014 21:22:07 +0000 (14:22 -0700)]
lib/idr.c: fix out-of-bounds pointer dereference
I'm working on address sanitizer project for kernel. Recently we
started experiments with stack instrumentation, to detect out-of-bounds
read/write bugs on stack.
Just after booting I've hit out-of-bounds read on stack in idr_for_each
(and in __idr_remove_all as well):
struct idr_layer **paa = &pa[0];
while (id >= 0 && id <= max) {
...
while (n < fls(id)) {
n += IDR_BITS;
p = *--paa; <--- here we are reading pa[-1] value.
}
}
Despite the fact that after this dereference we are exiting out of loop
and never use p, such behaviour is undefined and should be avoided.
Fix this by moving pointer derference to the beggining of the loop,
right before we will use it.
Signed-off-by: Andrey Ryabinin <[email protected]>
Reviewed-by: Lai Jiangshan <[email protected]>
Cc: Tejun Heo <[email protected]>
Cc: Alexey Preobrazhensky <[email protected]>
Cc: Dmitry Vyukov <[email protected]>
Cc: Konstantin Khlebnikov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Vitaly Kuznetsov [Fri, 8 Aug 2014 21:22:05 +0000 (14:22 -0700)]
fs/proc/vmcore.c:mmap_vmcore: skip non-ram pages reported by hypervisors
We have a special check in read_vmcore() handler to check if the page was
reported as ram or not by the hypervisor (pfn_is_ram()). However, when
vmcore is read with mmap() no such check is performed. That can lead to
unpredictable results, e.g. when running Xen PVHVM guest memcpy() after
mmap() on /proc/vmcore will hang processing HVMMEM_mmio_dm pages creating
enormous load in both DomU and Dom0.
Fix the issue by mapping each non-ram page to the zero page. Keep direct
path with remap_oldmem_pfn_range() to avoid looping through all pages on
bare metal.
The issue can also be solved by overriding remap_oldmem_pfn_range() in
xen-specific code, as remap_oldmem_pfn_range() was been designed for.
That, however, would involve non-obvious xen code path for all x86 builds
with CONFIG_XEN_PVHVM=y and would prevent all other hypervisor-specific
code on x86 arch from doing the same override.
[
[email protected]: remap_oldmem_pfn_checked() can be static]
[
[email protected]: clean up layout]
Signed-off-by: Vitaly Kuznetsov <[email protected]>
Reviewed-by: Andrew Jones <[email protected]>
Cc: Michael Holzheu <[email protected]>
Acked-by: Vivek Goyal <[email protected]>
Cc: David Vrabel <[email protected]>
Signed-off-by: Fengguang Wu <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Vladimir Davydov [Fri, 8 Aug 2014 21:22:03 +0000 (14:22 -0700)]
kernel/fork.c: make mm_init_owner static
It's only used in fork.c:mm_init().
Signed-off-by: Vladimir Davydov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Vladimir Davydov [Fri, 8 Aug 2014 21:22:01 +0000 (14:22 -0700)]
fork: copy mm's vm usage counters under mmap_sem
If a forking process has a thread calling (un)mmap (silly but still),
the child process may have some of its mm's vm usage counters (total_vm
and friends) screwed up, because currently they are copied from oldmm
w/o holding any locks (memcpy in dup_mm).
This patch moves the counters initialization to dup_mmap() to be called
under oldmm->mmap_sem, which eliminates any possibility of race.
Signed-off-by: Vladimir Davydov <[email protected]>
Cc: Oleg Nesterov <[email protected]>
Cc: David Rientjes <[email protected]>
Cc: Christoph Lameter <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Vladimir Davydov [Fri, 8 Aug 2014 21:21:58 +0000 (14:21 -0700)]
fork: reset mm->pinned_vm
mm->pinned_vm counts pages of mm's address space that were permanently
pinned in memory by increasing their reference counter. The counter was
introduced by commit
bc3e53f682d9 ("mm: distinguish between mlocked and
pinned pages"), while before it locked_vm had been used for such pages.
Obviously, we should reset the counter on fork if !CLONE_VM, just like
we do with locked_vm, but currently we don't. Let's fix it.
This patch will fix the contents of /proc/pid/status:VmPin.
ib_umem_get[infiniband] and perf_mmap still check pinned_vm against
RLIMIT_MEMLOCK. It's left from the times when pinned pages were accounted
under locked_vm, but today it looks wrong. It isn't clear how we should
deal with it.
We still have some drivers accounting pinned pages under mm->locked_vm -
this is what commit
bc3e53f682d9 was fighting against. It's
infiniband/usnic and vfio.
Signed-off-by: Vladimir Davydov <[email protected]>
Cc: Oleg Nesterov <[email protected]>
Cc: David Rientjes <[email protected]>
Cc: Christoph Lameter <[email protected]>
Cc: Roland Dreier <[email protected]>
Cc: Sean Hefty <[email protected]>
Cc: Hal Rosenstock <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Vladimir Davydov [Fri, 8 Aug 2014 21:21:56 +0000 (14:21 -0700)]
fork/exec: cleanup mm initialization
mm initialization on fork/exec is spread all over the place, which makes
the code look inconsistent.
We have mm_init(), which is supposed to init/nullify mm's internals, but
it doesn't init all the fields it should:
- on fork ->mmap,mm_rb,vmacache_seqnum,map_count,mm_cpumask,locked_vm
are zeroed in dup_mmap();
- on fork ->pmd_huge_pte is zeroed in dup_mm(), immediately before
calling mm_init();
- ->cpu_vm_mask_var ptr is initialized by mm_init_cpumask(), which is
called before mm_init() on both fork and exec;
- ->context is initialized by init_new_context(), which is called after
mm_init() on both fork and exec;
Let's consolidate all the initializations in mm_init() to make the code
look cleaner.
Signed-off-by: Vladimir Davydov <[email protected]>
Cc: Oleg Nesterov <[email protected]>
Cc: David Rientjes <[email protected]>
Cc: Christoph Lameter <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Alexey Dobriyan [Fri, 8 Aug 2014 21:21:54 +0000 (14:21 -0700)]
proc: remove INF macro
If you're applying this patch, all /proc/$PID/* files were converted
to seq_file interface and this code became unused.
Signed-off-by: Alexey Dobriyan <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Alexey Dobriyan [Fri, 8 Aug 2014 21:21:52 +0000 (14:21 -0700)]
proc: convert /proc/$PID/hardwall to seq_file interface
Signed-off-by: Alexey Dobriyan <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Alexey Dobriyan [Fri, 8 Aug 2014 21:21:50 +0000 (14:21 -0700)]
proc: convert /proc/$PID/io to seq_file interface
Signed-off-by: Alexey Dobriyan <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Alexey Dobriyan [Fri, 8 Aug 2014 21:21:48 +0000 (14:21 -0700)]
proc: convert /proc/$PID/oom_score to seq_file interface
Signed-off-by: Alexey Dobriyan <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Alexey Dobriyan [Fri, 8 Aug 2014 21:21:46 +0000 (14:21 -0700)]
proc: convert /proc/$PID/schedstat to seq_file interface
Signed-off-by: Alexey Dobriyan <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Alexey Dobriyan [Fri, 8 Aug 2014 21:21:44 +0000 (14:21 -0700)]
proc: convert /proc/$PID/wchan to seq_file interface
Signed-off-by: Alexey Dobriyan <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Alexey Dobriyan [Fri, 8 Aug 2014 21:21:41 +0000 (14:21 -0700)]
proc: convert /proc/$PID/cmdline to seq_file interface
Signed-off-by: Alexey Dobriyan <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Alexey Dobriyan [Fri, 8 Aug 2014 21:21:39 +0000 (14:21 -0700)]
proc: convert /proc/$PID/syscall to seq_file interface
Signed-off-by: Alexey Dobriyan <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Alexey Dobriyan [Fri, 8 Aug 2014 21:21:37 +0000 (14:21 -0700)]
proc: convert /proc/$PID/limits to seq_file interface
Signed-off-by: Alexey Dobriyan <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Alexey Dobriyan [Fri, 8 Aug 2014 21:21:35 +0000 (14:21 -0700)]
proc: convert /proc/$PID/auxv to seq_file interface
Signed-off-by: Alexey Dobriyan <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Alexey Dobriyan [Fri, 8 Aug 2014 21:21:33 +0000 (14:21 -0700)]
proc: more "const char *" pointers
Signed-off-by: Alexey Dobriyan <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Alexey Dobriyan [Fri, 8 Aug 2014 21:21:31 +0000 (14:21 -0700)]
proc: remove proc_tty_ldisc variable
/proc/tty/ldisc appear to be unused as a directory and
it had been always that way.
But it is userspace visible thing.
Cowardly remove only in-kernel variable holding it.
[
[email protected]: add comment]
Signed-off-by: Alexey Dobriyan <[email protected]>
Cc: Al Viro <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Alexey Dobriyan [Fri, 8 Aug 2014 21:21:29 +0000 (14:21 -0700)]
proc: make proc_subdir_lock static
Signed-off-by: Alexey Dobriyan <[email protected]>
Cc: Al Viro <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Alexey Dobriyan [Fri, 8 Aug 2014 21:21:27 +0000 (14:21 -0700)]
proc: faster /proc/$PID lookup
Currently lookup for /proc/$PID first goes through spinlock and whole list
of misc /proc entries only to confirm that, yes, /proc/42 can not possibly
match random proc entry.
List is is several dozens entries long (52 entries on my setup).
None of this is necessary.
Try to convert dentry name to integer first.
If it works, it must be /proc/$PID.
If it doesn't, it must be random proc entry.
Based on patch from Al Viro.
Signed-off-by: Alexey Dobriyan <[email protected]>
Cc: Al Viro <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Alexey Dobriyan [Fri, 8 Aug 2014 21:21:25 +0000 (14:21 -0700)]
proc: add and remove /proc entry create checks
* remove proc_create(NULL, ...) check, let it oops
* warn about proc_create("", ...) and proc_create("very very long name", ...)
proc code keeps length as u8, no 256+ name length possible
* warn about proc_create("123", ...)
/proc/$PID and /proc/misc namespaces are separate things,
but dumb module might create funky a-la $PID entry.
* remove post mortem strchr('/') check
Triggering it implies either strchr() is buggy or memory corruption.
It should be VFS check anyway.
In reality, none of these checks will ever trigger,
it is preparation for the next patch.
Based on patch from Al Viro.
Signed-off-by: Alexey Dobriyan <[email protected]>
Cc: Al Viro <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Fabian Frederick [Fri, 8 Aug 2014 21:21:22 +0000 (14:21 -0700)]
proc: constify seq_operations
proc_uid_seq_operations, proc_gid_seq_operations and
proc_projid_seq_operations are only called in proc_id_map_open with
seq_open as const struct seq_operations so we can constify the 3
structures and update proc_id_map_open prototype.
text data bss dec hex filename
6817 404 1984 9205 23f5 kernel/user_namespace.o-before
6913 308 1984 9205 23f5 kernel/user_namespace.o-after
Signed-off-by: Fabian Frederick <[email protected]>
Cc: Joe Perches <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Fabian Frederick [Fri, 8 Aug 2014 21:21:20 +0000 (14:21 -0700)]
fs/proc/kcore.c: use PAGE_ALIGN instead of ALIGN(PAGE_SIZE)
Use mm.h definition.
Signed-off-by: Fabian Frederick <[email protected]>
Cc: Xishi Qiu <[email protected]>
Acked-by: David Rientjes <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Ionut Alexa [Fri, 8 Aug 2014 21:21:18 +0000 (14:21 -0700)]
kernel/exit.c: fix coding style warnings and errors
Fixed coding style warnings and errors.
Signed-off-by: Ionut Alexa <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Fabian Frederick [Fri, 8 Aug 2014 21:21:16 +0000 (14:21 -0700)]
fs/hpfs/dnode.c: fix suspect code indent
Fix 2 checkpatch warnings:
WARNING: suspect code indent for conditional statements
Signed-off-by: Fabian Frederick <[email protected]>
Cc: Mikulas Patocka <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Fabian Frederick [Fri, 8 Aug 2014 21:21:14 +0000 (14:21 -0700)]
fs/reiserfs/xattr.c: fix blank line missing after declarations
Fix checkpatch warning:
WARNING: Missing a blank line after declarations
Signed-off-by: Fabian Frederick <[email protected]>
Cc: Jeff Mahoney <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Fabian Frederick [Fri, 8 Aug 2014 21:21:12 +0000 (14:21 -0700)]
fs/reiserfs: use linux/uaccess.h
Fix checkpatch warning
WARNING: Use #include <linux/uaccess.h> instead of <asm/uaccess.h>
Signed-off-by: Fabian Frederick <[email protected]>
Cc: Jeff Mahoney <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Fabian Frederick [Fri, 8 Aug 2014 21:21:10 +0000 (14:21 -0700)]
fs/reiserfs: replace not-standard %Lu/%Ld
Fixes checkpatch warnings:
"WARNING: %Ld/%Lu are not-standard C, use %lld/%llu"
Signed-off-by: Fabian Frederick <[email protected]>
Cc: Jeff Mahoney <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Fabian Frederick [Fri, 8 Aug 2014 21:21:08 +0000 (14:21 -0700)]
fs/ufs/inode.c: kernel-doc warning fixes
Signed-off-by: Fabian Frederick <[email protected]>
Cc: Evgeniy Dushistov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Fabian Frederick [Fri, 8 Aug 2014 21:21:05 +0000 (14:21 -0700)]
fs/ufs: convert UFSD printk to pr_debug
Convert no level printk to pr_debug in UFSD. DEBUG is defined with
CONFIG_UFS_DEBUG so pr_debug are emitted here.
Also fixing call to UFSD (add;)
Signed-off-by: Fabian Frederick <[email protected]>
Cc: Evgeniy Dushistov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Fabian Frederick [Fri, 8 Aug 2014 21:21:03 +0000 (14:21 -0700)]
fs/ufs/super.c: use va_format instead of buffer/vsnprintf
Remove error_buffer and use %pV
Signed-off-by: Fabian Frederick <[email protected]>
Cc: Evgeniy Dushistov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Fabian Frederick [Fri, 8 Aug 2014 21:21:01 +0000 (14:21 -0700)]
fs/ufs/super.c: use __func__ in logging
Replace approximate function name by __func__ using standard format
"function():"
Signed-off-by: Fabian Frederick <[email protected]>
Cc: Evgeniy Dushistov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Fabian Frederick [Fri, 8 Aug 2014 21:20:59 +0000 (14:20 -0700)]
fs/ufs: use pr_fmt
Replace UFS-fs, UFS-fs: and UFS: by pr_fmt with module name "ufs: "
Signed-off-by: Fabian Frederick <[email protected]>
Cc: Evgeniy Dushistov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Fabian Frederick [Fri, 8 Aug 2014 21:20:57 +0000 (14:20 -0700)]
fs/ufs: convert printk to pr_foo()
Use current logging functions.
- no level printk under CONFIG_UFS_DEBUG converted to pr_debug
- no level printk elsewhere converted to pr_err
- add DDEBUG flag in Makefile
- coalesce formats
Signed-off-by: Fabian Frederick <[email protected]>
Cc: Evgeniy Dushistov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Vyacheslav Dubeyko [Fri, 8 Aug 2014 21:20:55 +0000 (14:20 -0700)]
nilfs2: integrate sysfs support into driver
This patch integrates creation of sysfs groups and
attributes into NILFS file system driver.
It was found the issue with nilfs_sysfs_{create/delete}_snapshot_group
functions by Michael L Semon <
[email protected]> in the first
version of the patch:
BUG: sleeping function called from invalid context at kernel/locking/mutex.c:579
in_atomic(): 1, irqs_disabled(): 0, pid: 32676, name: umount.nilfs2
2 locks held by umount.nilfs2/32676:
#0: (&type->s_umount_key#21){++++..}, at: [<
790c18e2>] deactivate_super+0x37/0x58
#1: (&(&nilfs->ns_cptree_lock)->rlock){+.+...}, at: [<
791bf659>] nilfs_put_root+0x23/0x5a
Preemption disabled at:[<
791bf659>] nilfs_put_root+0x23/0x5a
CPU: 0 PID: 32676 Comm: umount.nilfs2 Not tainted 3.14.0+ #2
Hardware name: Dell Computer Corporation Dimension 2350/07W080, BIOS A01 12/17/2002
Call Trace:
dump_stack+0x4b/0x75
__might_sleep+0x111/0x16f
mutex_lock_nested+0x1e/0x3ad
kernfs_remove+0x12/0x26
sysfs_remove_dir+0x3d/0x62
kobject_del+0x13/0x38
nilfs_sysfs_delete_snapshot_group+0xb/0xd
nilfs_put_root+0x2a/0x5a
nilfs_detach_log_writer+0x1ab/0x2c1
nilfs_put_super+0x13/0x68
generic_shutdown_super+0x60/0xd1
kill_block_super+0x1d/0x60
deactivate_locked_super+0x22/0x3f
deactivate_super+0x3e/0x58
mntput_no_expire+0xe2/0x141
SyS_oldumount+0x70/0xa5
syscall_call+0x7/0xb
The reason of the issue was placement of
nilfs_sysfs_{create/delete}_snapshot_group() call under
nilfs->ns_cptree_lock protection. But this protection is unnecessary and
wrong solution. The second version of the patch fixes this issue.
[
[email protected]: nilfs_sysfs_create_mounted_snapshots_group can be static]
Reported-by: Michael L. Semon <[email protected]>
Signed-off-by: Vyacheslav Dubeyko <[email protected]>
Cc: Vyacheslav Dubeyko <[email protected]>
Cc: Ryusuke Konishi <[email protected]>
Tested-by: Michael L. Semon <[email protected]>
Signed-off-by: Fengguang Wu <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Vyacheslav Dubeyko [Fri, 8 Aug 2014 21:20:52 +0000 (14:20 -0700)]
nilfs2: add /sys/fs/nilfs2/<device>/mounted_snapshots/<snapshot> group
This patch adds creation of <snapshot> group for every mounted
snapshot in /sys/fs/nilfs2/<device>/mounted_snapshots group.
The group contains details about mounted snapshot:
(1) inodes_count - show number of inodes for snapshot.
(2) blocks_count - show number of blocks for snapshot.
Signed-off-by: Vyacheslav Dubeyko <[email protected]>
Cc: Vyacheslav Dubeyko <[email protected]>
Cc: Ryusuke Konishi <[email protected]>
Cc: Michael L. Semon <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Vyacheslav Dubeyko [Fri, 8 Aug 2014 21:20:50 +0000 (14:20 -0700)]
nilfs2: add /sys/fs/nilfs2/<device>/mounted_snapshots group
This patch adds creation of /sys/fs/nilfs2/<device>/mounted_snapshots
group.
The mounted_snapshots group contains group for every
mounted snapshot.
Signed-off-by: Vyacheslav Dubeyko <[email protected]>
Cc: Vyacheslav Dubeyko <[email protected]>
Cc: Ryusuke Konishi <[email protected]>
Cc: Michael L. Semon <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Vyacheslav Dubeyko [Fri, 8 Aug 2014 21:20:48 +0000 (14:20 -0700)]
nilfs2: add /sys/fs/nilfs2/<device>/checkpoints group
This patch adds creation of /sys/fs/nilfs2/<device>/checkpoints
group.
The checkpoints group contains attributes that describe
details about volume's checkpoints:
(1) checkpoints_number - show number of checkpoints on volume.
(2) snapshots_number - show number of snapshots on volume.
(3) last_seg_checkpoint - show checkpoint number of the latest segment.
(4) next_checkpoint - show next checkpoint number.
Signed-off-by: Vyacheslav Dubeyko <[email protected]>
Cc: Vyacheslav Dubeyko <[email protected]>
Cc: Ryusuke Konishi <[email protected]>
Cc: Michael L. Semon <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Vyacheslav Dubeyko [Fri, 8 Aug 2014 21:20:46 +0000 (14:20 -0700)]
nilfs2: add /sys/fs/nilfs2/<device>/segments group
This patch adds creation of /sys/fs/nilfs2/<device>/segments
group.
The segments group contains attributes that describe
details about volume's segments:
(1) segments_number - show number of segments on volume.
(2) blocks_per_segment - show number of blocks in segment.
(3) clean_segments - show count of clean segments.
(4) dirty_segments - show count of dirty segments.
Signed-off-by: Vyacheslav Dubeyko <[email protected]>
Cc: Vyacheslav Dubeyko <[email protected]>
Cc: Ryusuke Konishi <[email protected]>
Cc: Michael L. Semon <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Vyacheslav Dubeyko [Fri, 8 Aug 2014 21:20:44 +0000 (14:20 -0700)]
nilfs2: add /sys/fs/nilfs2/<device>/segctor group
This patch adds creation of /sys/fs/nilfs2/<device>/segctor
group.
The segctor group contains attributes that describe
segctor thread activity details:
(1) last_pseg_block - show start block number of the latest segment.
(2) last_seg_sequence - show sequence value of the latest segment.
(3) last_seg_checkpoint - show checkpoint number of the latest segment.
(4) current_seg_sequence - show segment sequence counter.
(5) current_last_full_seg - show index number of the latest full segment.
(6) next_full_seg - show index number of the full segment index
to be used next.
(7) next_pseg_offset - show offset of next partial segment in
the current full segment.
(8) next_checkpoint - show next checkpoint number.
(9) last_seg_write_time - show write time of the last segment
in human-readable format.
(10) last_seg_write_time_secs - show write time of the last segment
in seconds.
(11) last_nongc_write_time - show write time of the last segment
not for cleaner operation in human-readable format.
(12) last_nongc_write_time_secs - show write time of the last segment
not for cleaner operation in seconds.
(13) dirty_data_blocks_count - show number of dirty data blocks.
Signed-off-by: Vyacheslav Dubeyko <[email protected]>
Cc: Vyacheslav Dubeyko <[email protected]>
Cc: Ryusuke Konishi <[email protected]>
Cc: Michael L. Semon <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Vyacheslav Dubeyko [Fri, 8 Aug 2014 21:20:42 +0000 (14:20 -0700)]
nilfs2: add /sys/fs/nilfs2/<device>/superblock group
This patch adds creation of /sys/fs/nilfs2/<device>/superblock
group.
The superblock group contains attributes that describe
superblock's details:
(1) sb_write_time - show previous write time of super block in
human-readable format.
(2) sb_write_time_secs - show previous write time of super block
in seconds.
(3) sb_write_count - show write count of super block.
(4) sb_update_frequency - show/set interval of periodical update
of superblock (in seconds). You can set preferable frequency of
superblock update by command:
echo <value> > /sys/fs/nilfs2/<device>/superblock/sb_update_frequency
Signed-off-by: Vyacheslav Dubeyko <[email protected]>
Cc: Vyacheslav Dubeyko <[email protected]>
Cc: Ryusuke Konishi <[email protected]>
Cc: Michael L. Semon <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>