summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* exec: remove the no longer needed remove_arg_zero()->free_arg_page()Oleg Nesterov2016-05-231-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | remove_arg_zero() does free_arg_page() for no reason. This was needed before and only if CONFIG_MMU=y: see commit 4fc75ff4816c ("exec: fix remove_arg_zero"), install_arg_page() was called for every page != NULL in bprm->page[] array. Today install_arg_page() has already gone and free_arg_page() is nop after another commit b6a2fea39318 ("mm: variable length argument support"). CONFIG_MMU=n does free_arg_pages() in free_bprm() and thus it doesn't need remove_arg_zero()->free_arg_page() too; apart from get_arg_page() it never checks if the page in bprm->page[] was allocated or not, so the "extra" non-freed page is fine. OTOH, this free_arg_page() can add the minor pessimization, the caller is going to do copy_strings_kernel() right after remove_arg_zero() which will likely need to re-allocate the same page again. And as Hujunjie pointed out, the "offset == PAGE_SIZE" check is wrong because we are going to increment bprm->p once again before return, so CONFIG_MMU=n "leaks" the page anyway if '0' is the final byte in this page. NOTE: remove_arg_zero() assumes that argv[0] is null-terminated but this is not necessarily true. copy_strings() does "len = strnlen_user(...)", then copy_from_user(len) but another thread or debuger can overwrite the trailing '0' in between. Afaics nothing really bad can happen because we must always have the null-terminated bprm->filename copied by the 1st copy_strings_kernel(), but perhaps we should change this code to check "bprm->p < bprm->exec" anyway, and/or change copy_strings() to ensure that the last byte in string is always zero. Link: http://lkml.kernel.org/r/20160517155335.GA31435@redhat.com Signed-off-by: Oleg Nesterov <oleg@redhat.com> Reported by: hujunjie <jj.net@163.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* kernek/fork.c: allocate idle task for a CPU always on its local nodeAndi Kleen2016-05-231-6/+9
| | | | | | | | | | | | | | | | | | | | | | Linux preallocates the task structs of the idle tasks for all possible CPUs. This currently means they all end up on node 0. This also implies that the cache line of MWAIT, which is around the flags field in the task struct, are all located in node 0. We see a noticeable performance improvement on Knights Landing CPUs when the cache lines used for MWAIT are located in the local nodes of the CPUs using them. I would expect this to give a (likely slight) improvement on other systems too. The patch implements placing the idle task in the node of its CPUs, by passing the right target node to copy_process() [akpm@linux-foundation.org: use NUMA_NO_NODE, not a bare -1] Link: http://lkml.kernel.org/r/1463492694-15833-1-git-send-email-andi@firstfloor.org Signed-off-by: Andi Kleen <ak@linux.intel.com> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* signal: move the "sig < SIGRTMIN" check into siginmask(sig)Oleg Nesterov2016-05-231-9/+7
| | | | | | | | | | | | | | | | | All the users of siginmask() must ensure that sig < SIGRTMIN. sig_fatal() doesn't and this is wrong: UBSAN: Undefined behaviour in kernel/signal.c:911:6 shift exponent 32 is too large for 32-bit type 'long unsigned int' the patch doesn't add the neccesary check to sig_fatal(), it moves the check into siginmask() and updates other callers. Link: http://lkml.kernel.org/r/20160517195052.GA15187@redhat.com Reported-by: Meelis Roos <mroos@linux.ee> Signed-off-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* kernel/signal.c: convert printk(KERN_<LEVEL> ...) to pr_<level>(...)Wang Xiaoqiang2016-05-231-5/+5
| | | | | | | | Use pr_<level> instead of printk(KERN_<LEVEL> ). Signed-off-by: Wang Xiaoqiang <wangxq10@lzu.edu.cn> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* signal: make oom_flags a boolTetsuo Handa2016-05-233-8/+8
| | | | | | | | | | | | | | | | | | Currently the size of "struct signal_struct"->oom_flags member is sizeof(unsigned) bytes, but only one flag OOM_FLAG_ORIGIN which is updated by current thread is defined. We can convert OOM_FLAG_ORIGIN into a bool, and reuse the saved bytes for updating from the OOM killer and/or the OOM reaper thread. By the way, do we care about a race window between run_store() and swapoff() because it would be theoretically possible that two threads sharing the "struct signal_struct" concurrently call respective functions? If we care, we can make oom_flags an atomic_t. Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Cc: Hugh Dickins <hughd@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* wait: allow sys_waitid() to accept __WNOTHREAD/__WCLONE/__WALLOleg Nesterov2016-05-231-1/+2
| | | | | | | | | | | | | | | | | | | | I see no reason why waitid() can't support other linux-specific flags allowed in sys_wait4(). In particular this change can help if we reconsider the previous change ("wait/ptrace: assume __WALL if the child is traced") which adds the "automagical" __WALL for debugger. Signed-off-by: Oleg Nesterov <oleg@redhat.com> Cc: Dmitry Vyukov <dvyukov@google.com> Cc: Denys Vlasenko <dvlasenk@redhat.com> Cc: Jan Kratochvil <jan.kratochvil@redhat.com> Cc: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com> Cc: Pedro Alves <palves@redhat.com> Cc: Roland McGrath <roland@hack.frob.com> Cc: <syzkaller@googlegroups.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* wait/ptrace: assume __WALL if the child is tracedOleg Nesterov2016-05-231-9/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following program (simplified version of generated by syzkaller) #include <pthread.h> #include <unistd.h> #include <sys/ptrace.h> #include <stdio.h> #include <signal.h> void *thread_func(void *arg) { ptrace(PTRACE_TRACEME, 0,0,0); return 0; } int main(void) { pthread_t thread; if (fork()) return 0; while (getppid() != 1) ; pthread_create(&thread, NULL, thread_func, NULL); pthread_join(thread, NULL); return 0; } creates an unreapable zombie if /sbin/init doesn't use __WALL. This is not a kernel bug, at least in a sense that everything works as expected: debugger should reap a traced sub-thread before it can reap the leader, but without __WALL/__WCLONE do_wait() ignores sub-threads. Unfortunately, it seems that /sbin/init in most (all?) distributions doesn't use it and we have to change the kernel to avoid the problem. Note also that most init's use sys_waitid() which doesn't allow __WALL, so the necessary user-space fix is not that trivial. This patch just adds the "ptrace" check into eligible_child(). To some degree this matches the "tsk->ptrace" in exit_notify(), ->exit_signal is mostly ignored when the tracee reports to debugger. Or WSTOPPED, the tracer doesn't need to set this flag to wait for the stopped tracee. This obviously means the user-visible change: __WCLONE and __WALL no longer have any meaning for debugger. And I can only hope that this won't break something, but at least strace/gdb won't suffer. We could make a more conservative change. Say, we can take __WCLONE into account, or !thread_group_leader(). But it would be nice to not complicate these historical/confusing checks. Signed-off-by: Oleg Nesterov <oleg@redhat.com> Reported-by: Dmitry Vyukov <dvyukov@google.com> Cc: Denys Vlasenko <dvlasenk@redhat.com> Cc: Jan Kratochvil <jan.kratochvil@redhat.com> Cc: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com> Cc: Pedro Alves <palves@redhat.com> Cc: Roland McGrath <roland@hack.frob.com> Cc: <syzkaller@googlegroups.com> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* nilfs2: fix block commentsRyusuke Konishi2016-05-2311-107/+202
| | | | | | | | | | | | | This fixes block comments with proper formatting to eliminate the following checkpatch.pl warnings: "WARNING: Block comments use * on subsequent lines" "WARNING: Block comments use a trailing */ on a separate line" Link: http://lkml.kernel.org/r/1462886671-3521-8-git-send-email-konishi.ryusuke@lab.ntt.co.jp Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* nilfs2: remove loops of single statement macrosRyusuke Konishi2016-05-231-5/+4
| | | | | | | | | | This fixes checkpatch.pl warning "WARNING: Single statement macros should not use a do {} while (0) loop". Link: http://lkml.kernel.org/r/1462886671-3521-7-git-send-email-konishi.ryusuke@lab.ntt.co.jp Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* nilfs2: remove unnecessary else after return or breakRyusuke Konishi2016-05-233-23/+21
| | | | | | | | | | This fixes the checkpatch.pl warning that suggests else is not generally useful after a break or return. Link: http://lkml.kernel.org/r/1462886671-3521-6-git-send-email-konishi.ryusuke@lab.ntt.co.jp Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* nilfs2: avoid bare use of 'unsigned'Ryusuke Konishi2016-05-2327-90/+97
| | | | | | | | | | This fixes checkpatch.pl warning "WARNING: Prefer 'unsigned int' to bare use of 'unsigned'". Link: http://lkml.kernel.org/r/1462886671-3521-5-git-send-email-konishi.ryusuke@lab.ntt.co.jp Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* nilfs2: fix code indent coding style issueRyusuke Konishi2016-05-231-1/+1
| | | | | | | | | | This fixes checkpatch.pl warning "WARNING: suspect code indent for conditional statements". Link: http://lkml.kernel.org/r/1462886671-3521-4-git-send-email-konishi.ryusuke@lab.ntt.co.jp Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* nilfs2: remove space before semicolonRyusuke Konishi2016-05-231-1/+1
| | | | | | | | | | This fixes the checkpatch.pl warning "WARNING: space prohibited before semicolon" at nilfs_store_magic_and_option(). Link: http://lkml.kernel.org/r/1462886671-3521-3-git-send-email-konishi.ryusuke@lab.ntt.co.jp Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* nilfs2: do not emit extra newline on nilfs_warning() and nilfs_error()Ryusuke Konishi2016-05-236-16/+16
| | | | | | | | | | | This updates call sites of nilfs_warning() and nilfs_error() so that they don't add a duplicate newline. These output functions are already designed to add a trailing newline to the message. Link: http://lkml.kernel.org/r/1462886671-3521-2-git-send-email-konishi.ryusuke@lab.ntt.co.jp Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* nilfs2: clean trailing semicolons in macrosRyusuke Konishi2016-05-232-5/+5
| | | | | | | | | | | Remove trailing semicolons from macros, as suggested by checkpatch.pl. Link: http://lkml.kernel.org/r/1461935747-10380-12-git-send-email-konishi.ryusuke@lab.ntt.co.jp [konishi.ryusuke@lab.ntt.co.jp: fix style issues] Link: http://lkml.kernel.org/r/20160509.231703.1481729973362188932.konishi.ryusuke@lab.ntt.co.jp Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* nilfs2: add missing line spacingRyusuke Konishi2016-05-2310-0/+14
| | | | | | | | | | Clean up checkpatch.pl warnings "WARNING: Missing a blank line after declarations" from nilfs2. Link: http://lkml.kernel.org/r/1461935747-10380-11-git-send-email-konishi.ryusuke@lab.ntt.co.jp Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* nilfs2: replace __attribute__((packed)) with __packedRyusuke Konishi2016-05-231-1/+1
| | | | | | | | | | | | | This fixes the following checkpatch.pl warning: WARNING: __packed is preferred over __attribute__((packed)) #23: FILE: export.h:23: +} __attribute__ ((packed)); Link: http://lkml.kernel.org/r/1461935747-10380-10-git-send-email-konishi.ryusuke@lab.ntt.co.jp Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* nilfs2: move cleanup code of metadata file from inode routinesRyusuke Konishi2016-05-234-8/+38
| | | | | | | | | | | Refactor nilfs_clear_inode() and nilfs_i_callback() so that cleanup code or resource deallocation related to metadata file will be moved out to mdt.c. Link: http://lkml.kernel.org/r/1461935747-10380-9-git-send-email-konishi.ryusuke@lab.ntt.co.jp Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* nilfs2: get rid of nilfs_mdt_mark_block_dirty()Ryusuke Konishi2016-05-233-32/+8
| | | | | | | | | | | | | | nilfs_mdt_mark_block_dirty() can be replaced with primary functions like nilfs_mdt_get_block() and mark_buffer_dirty(), and it's used only by nilfs_ioctl_mark_blocks_dirty(). This gets rid of the function to simplify the interface of metadata file. Link: http://lkml.kernel.org/r/1461935747-10380-8-git-send-email-konishi.ryusuke@lab.ntt.co.jp Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* nilfs2: clarify permission to replicate the designRyusuke Konishi2016-05-231-0/+5
| | | | | | | | | | | To respond to a certain developer's request, this explicitly state that developers can reimplement the nilfs2 design for other operating systems to share data stored in that format. Link: http://lkml.kernel.org/r/1461935747-10380-7-git-send-email-konishi.ryusuke@lab.ntt.co.jp Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* MAINTAINERS: add web link for nilfs projectRyusuke Konishi2016-05-231-0/+1
| | | | | | | | | Add nilfs.osdn.jp as the second web site of nilfs project. Link: http://lkml.kernel.org/r/1461935747-10380-6-git-send-email-konishi.ryusuke@lab.ntt.co.jp Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* nilfs2: clean up old e-mail addressesRyusuke Konishi2016-05-2338-56/+46
| | | | | | | | | | | E-mail addresses of osrg.net domain are no longer available. This removes them from authorship notices and prevents reporters from being confused. Link: http://lkml.kernel.org/r/1461935747-10380-5-git-send-email-konishi.ryusuke@lab.ntt.co.jp Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* nilfs2: remove FSF mailing address from GPL noticesRyusuke Konishi2016-05-2338-152/+0
| | | | | | | | | | | This removes the extra paragraph which mentions FSF address in GPL notices from source code of nilfs2 and avoids the checkpatch.pl error related to it. Link: http://lkml.kernel.org/r/1461935747-10380-4-git-send-email-konishi.ryusuke@lab.ntt.co.jp Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* nilfs2: remove space before commaRyusuke Konishi2016-05-232-4/+4
| | | | | | | | | | | | | | Fix checkpatch.pl error "ERROR: space prohibited before that ',' (ctx:WxW)" at nilfs_sufile_set_suinfo(). This also fixes checkpatch.pl warning "WARNING: Prefer 'unsigned int' to bare use of 'unsigned'" at nilfs_sufile_set_suinfo() and nilfs_sufile_get_suinfo(). Link: http://lkml.kernel.org/r/1461935747-10380-3-git-send-email-konishi.ryusuke@lab.ntt.co.jp Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* nilfs2: fix white space issue in nilfs_mount()Ryusuke Konishi2016-05-231-1/+1
| | | | | | | | | | | | | | | | | | | | | Fix the following checkpatch.pl error and warnings: ERROR: code indent should use tabs where possible #1317: FILE: super.c:1317: + ^I^Is_new = true;$ WARNING: please, no space before tabs #1317: FILE: super.c:1317: + ^I^Is_new = true;$ WARNING: please, no spaces at the start of a line #1317: FILE: super.c:1317: + ^I^Is_new = true;$ Link: http://lkml.kernel.org/r/1461935747-10380-2-git-send-email-konishi.ryusuke@lab.ntt.co.jp Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* nilfs2: constify nilfs_sc_operations structuresJulia Lawall2016-05-231-5/+5
| | | | | | | | | | | | The nilfs_sc_operations structures are never modified, so declare them as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* fs/befs/io.c:befs_bread(): remove unneeded initialization to NULLSalah Triki2016-05-231-1/+1
| | | | | | | | | | bh is reinitialized by sb_bread() so no need to init it with NULL in the beginning of befs_bread() Link: http://lkml.kernel.org/r/88481760b43226fac16adb1f1e68897e47d8235c.1462841692.git.salah.triki@acm.org Signed-off-by: Salah Triki <salah.triki@acm.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* fs/befs/io.c:befs_bread_iaddr(): remove unneeded initialization to NULLSalah Triki2016-05-231-1/+1
| | | | | | | | | | bh is reinitialized by sb_bread() so no need to init it with NULL in the beginning of befs_bread_iaddr() Link: http://lkml.kernel.org/r/586d2639d729345b9c07aac10ba713d8ceb8745a.1462841692.git.salah.triki@acm.org Signed-off-by: Salah Triki <salah.triki@acm.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* fs/befs/linuxvfs.c:befs_iget(): remove unneeded befs_nio initialization to NULLSalah Triki2016-05-231-1/+1
| | | | | | | | | | befs_ino is reinitialized by BEFS_I() so no need to init it with NULL in the beginning of befs_iget() Link: http://lkml.kernel.org/r/a5c02445e436629c4d4ba1b65d91501878942f58.1462842887.git.salah.triki@acm.org Signed-off-by: Salah Triki <salah.triki@acm.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* fs/befs/linuxvfs.c:befs_iget(): remove unneeded raw_inode initialization to NULLSalah Triki2016-05-231-1/+1
| | | | | | | | | | raw_inode is reinitialized to bh->b_data so no need to init it with NULL in the beginning of befs_iget() Link: http://lkml.kernel.org/r/0a66baaaacb6b7e5fcea5b31b57b649261152281.1462842887.git.salah.triki@acm.org Signed-off-by: Salah Triki <salah.triki@acm.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* fs/befs/linuxvfs.c:befs_iget(): remove unneeded initialization to NULLSalah Triki2016-05-231-1/+1
| | | | | | | | | | bh is reinitialized by befs_bread() so no need to init it with NULL in the beginning of befs_iget() Link: http://lkml.kernel.org/r/38d62b1469bc3b316ba6b81fd8e26fc66fdd713b.1462842886.git.salah.triki@acm.org Signed-off-by: Salah Triki <salah.triki@acm.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* fs/befs/linuxvfs.c:befs_get_block(): remove unneeded initialization to NULLSalah Triki2016-05-231-1/+1
| | | | | | | | | | inode is reinitialized by befs_iget() so no need to init it with NULL in the beginning of befs_lookup() Link: http://lkml.kernel.org/r/03d7e46890aef94078130bed97c4f8f8ae9ea2b2.1462842886.git.salah.triki@acm.org Signed-off-by: Salah Triki <salah.triki@acm.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* fs/befs/datastream.c:befs_find_brun_dblindirect(): remove unneeded ↵Salah Triki2016-05-231-3/+1
| | | | | | | | | | | | initializations to NULL iaddr_array is unconditionally initialized to NULL in befs_find_brun_dblindirect(). Link: http://lkml.kernel.org/r/940def273e30ef37957fba9da6981a10fb3c9741.1462649034.git.salah.triki@acm.org Signed-off-by: Salah Triki <salah.triki@acm.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* fs/befs/datastream.c:befs_read_lsymlink(): remove unneeded initialization to ↵Salah Triki2016-05-231-1/+1
| | | | | | | | | | | | NULL bh is reinitialized by befs_read_datastream() so no need to init it with NULL in the beginning of befs_read_lsymlink(). Link: http://lkml.kernel.org/r/e22f279bceb8d026af048952e02ba98925b21c92.1462649034.git.salah.triki@acm.org Signed-off-by: Salah Triki <salah.triki@acm.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* fs/befs/datastream.c:befs_read_datastream(): remove unneeded initialization ↵Salah Triki2016-05-231-1/+1
| | | | | | | | | | | | to NULL bh is reinitialized by befs_bread_iaddr() so no need to init it with NULL in the beginning of befs_read_datastream(). Link: http://lkml.kernel.org/r/81e1f70187db34d195c8e42b1ff78be6a71c0060.1462649034.git.salah.triki@acm.org Signed-off-by: Salah Triki <salah.triki@acm.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* mm: memcontrol: fix possible css ref leak on oomVladimir Davydov2016-05-231-1/+1
| | | | | | | | | | | | | mem_cgroup_oom may be invoked multiple times while a process is handling a page fault, in which case current->memcg_in_oom will be overwritten leaking the previously taken css reference. Link: http://lkml.kernel.org/r/1464019330-7579-1-git-send-email-vdavydov@virtuozzo.com Signed-off-by: Vladimir Davydov <vdavydov@virtuozzo.com> Acked-by: Michal Hocko <mhocko@suse.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* ELF/MIPS build fixRalf Baechle2016-05-233-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CONFIG_MIPS32_N32=y but CONFIG_BINFMT_ELF disabled results in the following linker errors: arch/mips/built-in.o: In function `elf_core_dump': binfmt_elfn32.c:(.text+0x23dbc): undefined reference to `elf_core_extra_phdrs' binfmt_elfn32.c:(.text+0x246e4): undefined reference to `elf_core_extra_data_size' binfmt_elfn32.c:(.text+0x248d0): undefined reference to `elf_core_write_extra_phdrs' binfmt_elfn32.c:(.text+0x24ac4): undefined reference to `elf_core_write_extra_data' CONFIG_MIPS32_O32=y but CONFIG_BINFMT_ELF disabled results in the following linker errors: arch/mips/built-in.o: In function `elf_core_dump': binfmt_elfo32.c:(.text+0x28a04): undefined reference to `elf_core_extra_phdrs' binfmt_elfo32.c:(.text+0x29330): undefined reference to `elf_core_extra_data_size' binfmt_elfo32.c:(.text+0x2951c): undefined reference to `elf_core_write_extra_phdrs' binfmt_elfo32.c:(.text+0x29710): undefined reference to `elf_core_write_extra_data' This is because binfmt_elfn32 and binfmt_elfo32 are using symbols from elfcore but for these configurations elfcore will not be built. Fixed by making elfcore selectable by a separate config symbol which unlike the current mechanism can also be used from other directories than kernel/, then having each flavor of ELF that relies on elfcore.o, select it in Kconfig, including CONFIG_MIPS32_N32 and CONFIG_MIPS32_O32 which fixes this issue. Link: http://lkml.kernel.org/r/20160520141705.GA1913@linux-mips.org Signed-off-by: Ralf Baechle <ralf@linux-mips.org> Reviewed-by: James Hogan <james.hogan@imgtec.com> Cc: "Maciej W. Rozycki" <macro@linux-mips.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* m32r: fix build failureSudip Mukherjee2016-05-231-0/+1
| | | | | | | | | | | | | | | | m32r allmodconfig build was failing with the error: ERROR: "smp_flush_cache_all" [drivers/misc/lkdtm.ko] undefined! lkdtm driver at drivers/misc is using flush_icache_range() which for m32r is defined as smp_flush_cache_all() if CONFIG_SMP is defined. But as smp_flush_cache_all() was not exported so the build was failing with the error of undefined symbol. Link: http://lkml.kernel.org/r/1464001182-8329-1-git-send-email-sudipm.mukherjee@gmail.com Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* Merge tag 'trace-v4.7-2' of ↵Linus Torvalds2016-05-223-4/+147
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull motr tracing updates from Steven Rostedt: "Three more changes. - I forgot that I had another selftest to stress test the ftrace instance creation. It was actually suppose to go into the 4.6 merge window, but I never committed it. I almost forgot about it again, but noticed it was missing from your tree. - Soumya PN sent me a clean up patch to not disable interrupts when taking the tasklist_lock for read, as it's unnecessary because that lock is never taken for write in irq context. - Newer gcc's can cause the jump in the function_graph code to the global ftrace_stub label to be a short jump instead of a long one. As that jump is dynamically converted to jump to the trace code to do function graph tracing, and that conversion expects a long jump it can corrupt the ftrace_stub itself (it's directly after that call). One way to prevent gcc from using a short jump is to declare the ftrace_stub as a weak function, which we do here to keep gcc from optimizing too much" * tag 'trace-v4.7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: ftrace/x86: Set ftrace_stub to weak to prevent gcc from using short jumps to it ftrace: Don't disable irqs when taking the tasklist_lock read_lock ftracetest: Add instance created, delete, read and enable event test
| * ftrace/x86: Set ftrace_stub to weak to prevent gcc from using short jumps to itSteven Rostedt2016-05-201-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Matt Fleming reported seeing crashes when enabling and disabling function profiling which uses function graph tracer. Later Namhyung Kim hit a similar issue and he found that the issue was due to the jmp to ftrace_stub in ftrace_graph_call was only two bytes, and when it was changed to jump to the tracing code, it overwrote the ftrace_stub that was after it. Masami Hiramatsu bisected this down to a binutils change: 8dcea93252a9ea7dff57e85220a719e2a5e8ab41 is the first bad commit commit 8dcea93252a9ea7dff57e85220a719e2a5e8ab41 Author: H.J. Lu <hjl.tools@gmail.com> Date: Fri May 15 03:17:31 2015 -0700 Add -mshared option to x86 ELF assembler This patch adds -mshared option to x86 ELF assembler. By default, assembler will optimize out non-PLT relocations against defined non-weak global branch targets with default visibility. The -mshared option tells the assembler to generate code which may go into a shared library where all non-weak global branch targets with default visibility can be preempted. The resulting code is slightly bigger. This option only affects the handling of branch instructions. Declaring ftrace_stub as a weak call prevents gas from using two byte jumps to it, which would be converted to a jump to the function graph code. Link: http://lkml.kernel.org/r/20160516230035.1dbae571@gandalf.local.home Reported-by: Matt Fleming <matt@codeblueprint.co.uk> Reported-by: Namhyung Kim <namhyung@kernel.org> Tested-by: Matt Fleming <matt@codeblueprint.co.uk> Reviewed-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
| * ftrace: Don't disable irqs when taking the tasklist_lock read_lockSoumya PN2016-05-201-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In ftrace.c inside the function alloc_retstack_tasklist() (which will be invoked when function_graph tracing is on) the tasklist_lock is being held as reader while iterating through a list of threads. Here the lock is being held as reader with irqs disabled. The tasklist_lock is never write_locked in interrupt context so it is safe to not disable interrupts for the duration of read_lock in this block which, can be significant, given the block of code iterates through all threads. Hence changing the code to call read_lock() and read_unlock() instead of read_lock_irqsave() and read_unlock_irqrestore(). A similar change was made in commits: 8063e41d2ffc ("tracing: Change syscall_*regfunc() to check PF_KTHREAD and use for_each_process_thread()")' and 3472eaa1f12e ("sched: normalize_rt_tasks(): Don't use _irqsave for tasklist_lock, use task_rq_lock()")' Link: http://lkml.kernel.org/r/1463500874-77480-1-git-send-email-soumya.p.n@hpe.com Signed-off-by: Soumya PN <soumya.p.n@hpe.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
| * ftracetest: Add instance created, delete, read and enable event testSteven Rostedt (Red Hat)2016-05-091-0/+143
| | | | | | | | | | | | | | | | | | Add a new ftrace test that creates three threads. One that creates and removes an ftrace instance, one that reads the instance, and one that enables and disables events in the instance. This is a stress test for accessing and removing instances at the same time. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* | Merge branch 'for-next' of ↵Linus Torvalds2016-05-221-1/+2
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu Pull m68knommu update from Greg Ungerer: "Only a single change to update my email address in the MAINTAINERS file" * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu: m68k: change m68knommu maintainer email address
| * | m68k: change m68knommu maintainer email addressGreg Ungerer2016-05-101-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | Change my email address in the "UCLINUX (M68KNOMMU and COLDFIRE)" entry from gerg@uclinux.org to gerg@linux-m68k.org. I intend using that for m68k (and uclinux) specific work from now on. Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
* | | Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparcLinus Torvalds2016-05-2219-110/+147
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pull sparc updates from David Miller: "Some 32-bit kgdb cleanups from Sam Ravnborg, and a hugepage TLB flush overhead fix on 64-bit from Nitin Gupta" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc: sparc64: Reduce TLB flushes during hugepte changes aeroflex/greth: fix warning about unused variable openprom: fix warning sparc32: drop superfluous cast in calls to __nocache_pa() sparc32: fix build with STRICT_MM_TYPECHECKS sparc32: use proper prototype for trapbase sparc32: drop local prototype in kgdb_32 sparc32: drop hardcoding trap_level in kgdb_trap
| * | | sparc64: Reduce TLB flushes during hugepte changesNitin Gupta2016-05-206-51/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During hugepage map/unmap, TSB and TLB flushes are currently issued at every PAGE_SIZE'd boundary which is unnecessary. We now issue the flush at REAL_HPAGE_SIZE boundaries only. Without this patch workloads which unmap a large hugepage backed VMA region get CPU lockups due to excessive TLB flush calls. Orabug: 22365539, 22643230, 22995196 Signed-off-by: Nitin Gupta <nitin.m.gupta@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * | | aeroflex/greth: fix warning about unused variableSam Ravnborg2016-05-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix following warning: aeroflex/greth.c:1326:11: warning: unused variable 'phy' [-Wunused-variable] The variable was unused - remove it. It looks like this warning has been there forever - was found by an allyesconfig build of sparc32. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Cc: Kristoffer Glembo <kristoffer@gaisler.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * | | openprom: fix warningSam Ravnborg2016-05-201-24/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix following warnings: openprom.c:510:2: warning: 'tmp' may be used uninitialized in this function [-Wmaybe-uninitialized] openprom.c:503:3: warning: 'str' may be used uninitialized in this function [-Wmaybe-uninitialized] openprom.c:459:8: warning: 'str' may be used uninitialized in this function [-Wmaybe-uninitialized] openprom.c:422:7: warning: 'str' may be used uninitialized in this function [-Wmaybe-uninitialized] Fixed by introducing PTR_ERR etc. This simplified the code as a nice side effect. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
| * | | Merge branch 'sparc32-cosmetic-changes'David S. Miller2016-05-2011-34/+33
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sam Ravnborg says: ==================== sparc32: kgdb_32 and STRICT_MM_TYPECHECKS updates A few cosmetic pathes for sparc32 follows. I noticed some inconsistency in kgdb_32 that triggered a few patches. The inconsistency in kgdb_32 turned out to have no functional impact. But I anyway fixed it so kgdb_32 and kgdb_64 became just a tiny bit more alike. The STRICT_MM_TYPECHECKS patch was triggered by a discussion on linux-arch where Arnd considered removing this cruft. The resulting benary of srmmu.c (I checked an assembler file) was _smaller_ when I defined STRICT_MM_TYPECHECKS. But due to lack of testing I left it undefined. With the build errors fixed it should be trivial to try out if defining STRICT_MM_TYPECHECKS breaks anything. Any takers? As I miss any working sparc32 gear for the moment this has only been build tested - so please consider if it is worth taking the risk to apply the patches. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
| | * | | sparc32: drop superfluous cast in calls to __nocache_pa()Sam Ravnborg2016-05-202-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>