id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
ca2b84cb3c4a0d4d2143b46ec072cdff5d1b3b87
Analyze and fix the following issue in the Linux kernel code: kmemtrace: use tracepoints
Problem Details: kmemtrace now uses tracepoints instead of markers. We no longer need to use format specifiers to pass arguments. Signed-off-by: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro> [ folded: Use the new TP_PROTO and TP_ARGS to fix the build. ] [ folded: fix build when CONFIG_KMEMTRACE is disabl...
```diff diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h index f4523651fa42..5ac9b0bcaf9a 100644 --- a/include/linux/slab_def.h +++ b/include/linux/slab_def.h @@ -73,8 +73,8 @@ found: ret = kmem_cache_alloc_notrace(cachep, flags); - kmemtrace_mark_alloc(KMEMTRACE_TYPE_KMALLOC, _THIS_IP_, ret, - ...
a979241c532f07c201fe94e0a632107268f02578
Analyze and fix the following issue in the Linux kernel code: kmemtrace, rcu: fix rcupreempt.c data structure dependencies
Problem Details: Impact: cleanup We want to remove percpu.h from rcupreempt.h, but if we do that the percpu primitives there wont build anymore. Move them to the .c file instead. Cc: Pekka Enberg <penberg@cs.helsinki.fi> Cc: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro> Cc: paulmck@linux.vnet.ibm.com LKML-R...
```diff diff --git a/include/linux/rcupreempt.h b/include/linux/rcupreempt.h index 74304b4538d8..3eb8fdd19445 100644 --- a/include/linux/rcupreempt.h +++ b/include/linux/rcupreempt.h @@ -40,30 +40,15 @@ #include <linux/cpumask.h> #include <linux/seqlock.h> -struct rcu_dyntick_sched { - int dynticks; - int dynticks_...
6258c4fb59e77d748f7efc2c137ad420372edd07
Analyze and fix the following issue in the Linux kernel code: kmemtrace, rcu: fix rcu_tree_trace.c data structure dependencies
Problem Details: Impact: cleanup We want to remove rcutree internals from the public rcutree.h file for upcoming kmemtrace changes - but kernel/rcutree_trace.c depends on them. Introduce kernel/rcutree.h for internal definitions. (Probably all the other data types from include/linux/rcutree.h could be moved here too ...
```diff diff --git a/kernel/rcutree.c b/kernel/rcutree.c index a2015edfe167..7f3266922572 100644 --- a/kernel/rcutree.c +++ b/kernel/rcutree.c @@ -72,11 +72,11 @@ EXPORT_SYMBOL_GPL(rcu_lock_map); .n_force_qs_ngp = 0, \ } -static struct rcu_state rcu_state = RCU_STATE_INITIALIZER(rcu_state); -static DEFINE_PER_CPU(...
b1f77b0581b8fd837acb4a973f7d5496cae6efee
Analyze and fix the following issue in the Linux kernel code: kmemtrace, rcu: fix linux/rcutree.h and linux/rcuclassic.h dependencies
Problem Details: Impact: build fix for all non-x86 architectures We want to remove percpu.h from rcuclassic.h/rcutree.h (for upcoming kmemtrace changes) but that would break the DECLARE_PER_CPU based declarations in these files. Move the quiescent counter management functions to their respective RCU implementation .c...
```diff diff --git a/include/linux/rcuclassic.h b/include/linux/rcuclassic.h index 80044a4f3ab9..2d688b4461f7 100644 --- a/include/linux/rcuclassic.h +++ b/include/linux/rcuclassic.h @@ -108,25 +108,14 @@ struct rcu_data { struct rcu_head barrier; }; -DECLARE_PER_CPU(struct rcu_data, rcu_data); -DECLARE_PER_CPU(st...
255d11bc910fd38153156a0c5ebb256657290882
Analyze and fix the following issue in the Linux kernel code: kmemtrace, mm: fix slab.h dependency problem in mm/failslab.c
Problem Details: Impact: cleanup mm/failslab.c depends on slab.h without including it: CC mm/failslab.o mm/failslab.c: In function ‘should_failslab’: mm/failslab.c:16: error: ‘__GFP_NOFAIL’ undeclared (first use in this function) mm/failslab.c:16: error: (Each undeclared identifier is reported only onc...
```diff diff --git a/mm/failslab.c b/mm/failslab.c index 7c6ea6493f80..9339de5f0a91 100644 --- a/mm/failslab.c +++ b/mm/failslab.c @@ -1,4 +1,5 @@ #include <linux/fault-inject.h> +#include <linux/gfp.h> static struct { struct fault_attr attr; ```
e65a1b7c390a72fbcefb2639e255fb7f145538d3
Analyze and fix the following issue in the Linux kernel code: kmemtrace, kbuild: fix slab.h dependency problem in lib/decompress_unlzma.c
Problem Details: Impact: cleanup lib/decompress_unlzma.c depends on slab.h without including it: CC lib/decompress_unlzma.o lib/decompress_unlzma.c: In function ‘rc_free’: lib/decompress_unlzma.c:122: error: implicit declaration of function ‘kfree’ lib/decompress_unlzma.c: In function ‘unlzma’: lib/d...
```diff diff --git a/lib/decompress_unlzma.c b/lib/decompress_unlzma.c index 546f2f4c157e..32123a1340e6 100644 --- a/lib/decompress_unlzma.c +++ b/lib/decompress_unlzma.c @@ -34,6 +34,7 @@ #endif /* STATIC */ #include <linux/decompress/mm.h> +#include <linux/slab.h> #define MIN(a, b) (((a) < (b)) ? (a) : (b)) ``...
ba56617ef37f2be31f46f9533057e173b778602e
Analyze and fix the following issue in the Linux kernel code: kmemtrace, kbuild: fix slab.h dependency problem in lib/decompress_bunzip2.c
Problem Details: Impact: cleanup lib/decompress_bunzip2.c depends on slab.h without including it: CC lib/decompress_bunzip2.o lib/decompress_bunzip2.c: In function ‘start_bunzip’: lib/decompress_bunzip2.c:636: error: implicit declaration of function ‘kmalloc’ lib/decompress_bunzip2.c:636: warning: assi...
```diff diff --git a/lib/decompress_bunzip2.c b/lib/decompress_bunzip2.c index 5d3ddb5fcfd9..708e2a86d87b 100644 --- a/lib/decompress_bunzip2.c +++ b/lib/decompress_bunzip2.c @@ -50,6 +50,7 @@ #endif /* !STATIC */ #include <linux/decompress/mm.h> +#include <linux/slab.h> #ifndef INT_MAX #define INT_MAX 0x7fffff...
079effb6933f34b9b1b67b08bd4fd7fb672d16ef
Analyze and fix the following issue in the Linux kernel code: kmemtrace, kbuild: fix slab.h dependency problem in lib/decompress_inflate.c
Problem Details: Impact: fix build lib/decompress_inflate.c depends on slab.h without including it: CC lib/decompress_inflate.o lib/decompress_inflate.c: In function ‘gunzip’: lib/decompress_inflate.c:45: error: implicit declaration of function ‘kmalloc’ lib/decompress_inflate.c:45: warning: assignment...
```diff diff --git a/lib/decompress_inflate.c b/lib/decompress_inflate.c index 839a329b4fc4..e36b296fc9f8 100644 --- a/lib/decompress_inflate.c +++ b/lib/decompress_inflate.c @@ -23,6 +23,7 @@ #endif /* STATIC */ #include <linux/decompress/mm.h> +#include <linux/slab.h> #define INBUF_LEN (16*1024) ```
23516dc709914845f18fbe379b3524b8156e5c85
Analyze and fix the following issue in the Linux kernel code: kmemtrace, squashfs: fix slab.h dependency problem in squasfs
Problem Details: Impact: cleanup fs/squashfs/export.c depends on slab.h without including it: CC fs/squashfs/export.o fs/squashfs/export.c: In function ‘squashfs_read_inode_lookup_table’: fs/squashfs/export.c:133: error: implicit declaration of function ‘kmalloc’ fs/squashfs/export.c:133: warning: assi...
```diff diff --git a/fs/squashfs/export.c b/fs/squashfs/export.c index 69e971d5ddc1..2b1b8fe5e037 100644 --- a/fs/squashfs/export.c +++ b/fs/squashfs/export.c @@ -40,6 +40,7 @@ #include <linux/dcache.h> #include <linux/exportfs.h> #include <linux/zlib.h> +#include <linux/slab.h> #include "squashfs_fs.h" #include...
c325962b68bbeeddcd4f755f7d34ada4d007b5f8
Analyze and fix the following issue in the Linux kernel code: kmemtrace, befs: fix slab.h dependency problem
Problem Details: Impact: cleanup fs/befs/debug.c depends on slab.h without including it. Upcoming changes for kmemtrace would break the build: CC fs/befs/debug.o fs/befs/debug.c: In function ‘befs_error’: fs/befs/debug.c:31: error: implicit declaration of function ‘kmalloc’ fs/befs/debug.c:31: warning:...
```diff diff --git a/fs/befs/debug.c b/fs/befs/debug.c index b8e304a0661e..622e73775c83 100644 --- a/fs/befs/debug.c +++ b/fs/befs/debug.c @@ -17,6 +17,7 @@ #include <linux/spinlock.h> #include <linux/kernel.h> #include <linux/fs.h> +#include <linux/slab.h> #endif /* __KERNEL__ */ ```
aa84442d674ef83e1cbf2bce52a20ecff4ce515e
Analyze and fix the following issue in the Linux kernel code: kmemtrace, security: fix linux/key.h header file dependencies
Problem Details: Impact: cleanup We want to remove percpu.h from rcupdate.h (for upcoming kmemtrace changes), but this is not possible currently without breaking the build because key.h has an implicit include file dependency on rwsem.h: CC [M] fs/cifs/cifs_spnego.o In file included from include/keys/user-type...
```diff diff --git a/include/linux/key.h b/include/linux/key.h index 21d32a142c00..e544f466d69a 100644 --- a/include/linux/key.h +++ b/include/linux/key.h @@ -20,6 +20,7 @@ #include <linux/rbtree.h> #include <linux/rcupdate.h> #include <linux/sysctl.h> +#include <linux/rwsem.h> #include <asm/atomic.h> #ifdef __K...
21e5445928af0d80f7cf803a77f2b65e9e147890
Analyze and fix the following issue in the Linux kernel code: kmemtrace, fs: fix linux/fdtable.h header file dependencies
Problem Details: Impact: cleanup We want to remove percpu.h from rcupdate.h (for upcoming kmemtrace changes), but this is not possible currently without breaking the build because fdtable.h has an implicit include file dependency: it uses __init does not include init.h. This can cause build failures on non-x86 archit...
```diff diff --git a/include/linux/fdtable.h b/include/linux/fdtable.h index 09d6c5bbdddd..a2ec74bc4812 100644 --- a/include/linux/fdtable.h +++ b/include/linux/fdtable.h @@ -5,12 +5,14 @@ #ifndef __LINUX_FDTABLE_H #define __LINUX_FDTABLE_H -#include <asm/atomic.h> #include <linux/posix_types.h> #include <linux/c...
2cf3a11494b15949835ff92a7af15f979ac37bbd
Analyze and fix the following issue in the Linux kernel code: [MTD] fix use after free in register_mtd_blktrans
Problem Details: Reported-by: Dan Carpenter <error27@gmail.com> Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
```diff diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c index 1409f01406f6..4109e0bb94f5 100644 --- a/drivers/mtd/mtd_blkdevs.c +++ b/drivers/mtd/mtd_blkdevs.c @@ -382,11 +382,12 @@ int register_mtd_blktrans(struct mtd_blktrans_ops *tr) tr->blkcore_priv->thread = kthread_run(mtd_blktrans_thread, tr...
6770fa020fe3b63915ab082b4e5fd99d2d368c82
Analyze and fix the following issue in the Linux kernel code: xtensa: let platform override KERNELOFFSET
Problem Details: The linker script should not assume a fix offset in memory for the kernel, this is platform-specific, so let the platform set it. Signed-off-by: Johannes Weiner <jw@emlix.com> Signed-off-by: Chris Zankel <chris@zankel.net>
```diff diff --git a/arch/xtensa/kernel/vmlinux.lds.S b/arch/xtensa/kernel/vmlinux.lds.S index d506774f4b05..c1be9a4a740c 100644 --- a/arch/xtensa/kernel/vmlinux.lds.S +++ b/arch/xtensa/kernel/vmlinux.lds.S @@ -17,6 +17,7 @@ #include <asm-generic/vmlinux.lds.h> #include <variant/core.h> +#include <platform/hardware...
a81cbd2da48eacc860acf4f40ea05db790f4c7c3
Analyze and fix the following issue in the Linux kernel code: xtensa: enforce slab alignment to maximum register width
Problem Details: XCHAL_DATA_WIDTH is the maximum register width, slab caches should be aligned to this. Theoretical fix as all variants have had an XCHAL_DATA_WIDTH of 4 (wordsize) for now. But the S6000 variant will raise this to 16. Signed-off-by: Oskar Schirmer <os@emlix.com> Signed-off-by: Johannes Weiner <jw@em...
```diff diff --git a/arch/xtensa/include/asm/processor.h b/arch/xtensa/include/asm/processor.h index 07387d3b99f4..fba8b7e44a22 100644 --- a/arch/xtensa/include/asm/processor.h +++ b/arch/xtensa/include/asm/processor.h @@ -25,6 +25,8 @@ # error Linux requires the Xtensa Windowed Registers Option. #endif +#define AR...
0bef42e5c061b4aa63cc488d11400a1ef8b8f5a2
Analyze and fix the following issue in the Linux kernel code: xtensa: fix init_bootmem_node() argument order
Problem Details: The second argument to init_bootmem_node() is the PFN to place the bootmem bitmap at and the third argument is the first PFN on the node. This is currently backwards but never made any problems as both values were always zero. Signed-off-by: Johannes Weiner <jw@emlix.com> Signed-off-by: Chris Zankel ...
```diff diff --git a/arch/xtensa/mm/init.c b/arch/xtensa/mm/init.c index 34163cfaaffc..55b043a5918a 100644 --- a/arch/xtensa/mm/init.c +++ b/arch/xtensa/mm/init.c @@ -145,8 +145,9 @@ void __init bootmem_init(void) /* Reserve the bootmem bitmap area */ mem_reserve(bootmap_start, bootmap_start + bootmap_size, 1); -...
4f032ac4122a77dbabf7a24b2739b2790448180f
Analyze and fix the following issue in the Linux kernel code: cpumask: fix slab corruption caused by alloc_cpumask_var_node()
Problem Details: Fix slab corruption caused by alloc_cpumask_var_node() overwriting the tail end of an off-stack cpumask. The function zeros out cpumask bits beyond the last possible cpu. The starting point for zeroing should be the beginning of the mask offset by a byte count derived from the number of possible cpus...
```diff diff --git a/lib/cpumask.c b/lib/cpumask.c index 3389e2440da0..1f71b97de0f9 100644 --- a/lib/cpumask.c +++ b/lib/cpumask.c @@ -109,10 +109,10 @@ bool alloc_cpumask_var_node(cpumask_var_t *mask, gfp_t flags, int node) #endif /* FIXME: Bandaid to save us from old primitives which go to NR_CPUS. */ if (*mask)...
2d09cde985702503970d7cc18d762fae17e1cf88
Analyze and fix the following issue in the Linux kernel code: ia64: implement interrupt-enabling rwlocks
Problem Details: Implement __raw_read_lock_flags and __raw_write_lock_flags for the ia64 architecture. [kosaki.motohiro@jp.fujitsu.com: typo fix] Signed-off-by: Petr Tesarik <ptesarik@suse.cz> Signed-off-by: Robin Holt <holt@sgi.com> Cc: <linux-arch@vger.kernel.org> Cc: Ingo Molnar <mingo@elte.hu> Cc: Peter Zijlstra <...
```diff diff --git a/arch/ia64/include/asm/spinlock.h b/arch/ia64/include/asm/spinlock.h index 0a619618b2fa..13ab71576bc7 100644 --- a/arch/ia64/include/asm/spinlock.h +++ b/arch/ia64/include/asm/spinlock.h @@ -120,6 +120,38 @@ do { \ #define __raw_read_can_lock(rw) (*(volatile int *)(rw) >= 0) #define __r...
651d0623045d3265a21ab9803b3a1e0f24a17461
Analyze and fix the following issue in the Linux kernel code: fs/reiserfs: return f_fsid for statfs(2)
Problem Details: Make reiserfs3 return f_fsid info for statfs(2). By Andreas' suggestion, this patch populates a persistent f_fsid between boots/mounts with help of on-disk uuid record. Randy Dunlap reported a compiling error from v2 patch like: fs/built-in.o: In function `reiserfs_statfs': super.c:(.text+0x7...
```diff diff --git a/fs/reiserfs/Kconfig b/fs/reiserfs/Kconfig index 949b8c6addc8..513f431038f9 100644 --- a/fs/reiserfs/Kconfig +++ b/fs/reiserfs/Kconfig @@ -1,5 +1,6 @@ config REISERFS_FS tristate "Reiserfs support" + select CRC32 help Stores not just filenames but the files themselves in a balanced tree...
6e873ec71d091f52510f6aa9bc71d4732438522a
Analyze and fix the following issue in the Linux kernel code: xpc_sn2: fix max() warning about pointers of different types
Problem Details: Fix a minor compile warning when building on ia64. drivers/misc/sgi-xp/xpc_sn2.c: In function `xpc_clear_remote_msgqueue_flags_sn2': drivers/misc/sgi-xp/xpc_sn2.c:1746: warning: comparison of distinct pointer types lacks a cast Signed-off-by: Robin Holt <holt@sgi.com> Cc: Sam Ravnborg <sam@ravnborg.o...
```diff diff --git a/drivers/misc/sgi-xp/xpc_sn2.c b/drivers/misc/sgi-xp/xpc_sn2.c index a760dd08e425..eaaa964942de 100644 --- a/drivers/misc/sgi-xp/xpc_sn2.c +++ b/drivers/misc/sgi-xp/xpc_sn2.c @@ -1744,20 +1744,20 @@ xpc_clear_remote_msgqueue_flags_sn2(struct xpc_channel *ch) { struct xpc_channel_sn2 *ch_sn2 = &ch...
1bc4faa59b0e6aa5ede2d5d8fa74b6e051b31dca
Analyze and fix the following issue in the Linux kernel code: sgi-gru: remove SGI_GRU as a valid config option for ia64 configs with SGI_UV
Problem Details: Some current configs turn on GRU for ia64. The GRU code does not correctly load on boot on ia64 (GRU does continue to work for x86-64), so changing the IA64 Kconfig to not select GRU on ia64 configs for now until we have time to fix. Signed-off-by: Robin Holt <holt@sgi.com> Acked-by: Jack Steiner <st...
```diff diff --git a/arch/ia64/configs/generic_defconfig b/arch/ia64/configs/generic_defconfig index a109db30ce55..75645495c2dd 100644 --- a/arch/ia64/configs/generic_defconfig +++ b/arch/ia64/configs/generic_defconfig @@ -193,7 +193,6 @@ CONFIG_BOUNCE=y CONFIG_NR_QUICK=1 CONFIG_VIRT_TO_BUS=y CONFIG_UNEVICTABLE_LRU=...
27ca8a7b2bdfb3e22e67fbd5df58e6b6f0bbcd48
Analyze and fix the following issue in the Linux kernel code: sgi-gru: fix bugs related to module unload of the GRU driver
Problem Details: Fix bugs related to module unload of the GRU driver. Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/drivers/misc/sgi-gru/grufile.c b/drivers/misc/sgi-gru/grufile.c index b7a21ce91496..3e6e42d2f01b 100644 --- a/drivers/misc/sgi-gru/grufile.c +++ b/drivers/misc/sgi-gru/grufile.c @@ -440,7 +440,7 @@ exit1: static void __exit gru_exit(void) { - int i, bid; + int i, bid, gid; int order = get_ord...
874194123718e625aa96632bac457d686ba1378e
Analyze and fix the following issue in the Linux kernel code: sgi-gru: aSID (context management) bug fixes
Problem Details: This patch fixes bugs related to ASID (context id) management in the GRU driver. These changes are all internal to the SGI GRU driver and have no effect on the base kernel. Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torv...
```diff diff --git a/drivers/misc/sgi-gru/grufile.c b/drivers/misc/sgi-gru/grufile.c index 812678d8b47d..f8dcdb1a0ec4 100644 --- a/drivers/misc/sgi-gru/grufile.c +++ b/drivers/misc/sgi-gru/grufile.c @@ -274,6 +274,7 @@ static void gru_init_chiplet(struct gru_state *gru, unsigned long paddr, gru->gs_blade_id = bid; ...
438846043af39fef286f68b197d42bd75f49898e
Analyze and fix the following issue in the Linux kernel code: sgi-gru: improvements to GRU debug messages & statistics
Problem Details: Improvements to GRU debug messages & statistics. Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/drivers/misc/sgi-gru/grufault.c b/drivers/misc/sgi-gru/grufault.c index f85d27306789..61aa80a8411b 100644 --- a/drivers/misc/sgi-gru/grufault.c +++ b/drivers/misc/sgi-gru/grufault.c @@ -449,6 +449,7 @@ irqreturn_t gru_intr(int irq, void *dev_id) up_read(&gts->ts_mm->mmap_sem); } else { t...
fe5bb6b00c3a9374841d651e01694fe4190a677e
Analyze and fix the following issue in the Linux kernel code: sgi-gru: misc GRU cleanup
Problem Details: Misc trivial GRU drivers fixes: - fix long lines - eliminate extra whitespace - eliminate compiler warning - better validation of invalidate user parameters - bug fix for GRU TLB flush (not the cpu TLB flush) These changes are all internal to the SGI GRU driver and have no effect on the base kern...
```diff diff --git a/drivers/misc/sgi-gru/gru_instructions.h b/drivers/misc/sgi-gru/gru_instructions.h index 48762e7b98be..3fde33c1e8f3 100644 --- a/drivers/misc/sgi-gru/gru_instructions.h +++ b/drivers/misc/sgi-gru/gru_instructions.h @@ -19,8 +19,11 @@ #ifndef __GRU_INSTRUCTIONS_H__ #define __GRU_INSTRUCTIONS_H__ ...
2c53d9109f077900e140edb8b766132ad93b81cc
Analyze and fix the following issue in the Linux kernel code: relay: fix for possible loss/corruption of produced subbufs
Problem Details: Fix possible loss/corruption of produced subbufs in relay_subbufs_consumed(). When buf->subbufs_produced wraps around after UINT_MAX and buf->subbufs_consumed is still < UINT_MAX, the condition if (buf->subbufs_consumed > buf->subbufs_produced) will be true even for certain valid values of subbufs_...
```diff diff --git a/kernel/relay.c b/kernel/relay.c index 8f2179c8056f..e92db8c06acf 100644 --- a/kernel/relay.c +++ b/kernel/relay.c @@ -797,13 +797,15 @@ void relay_subbufs_consumed(struct rchan *chan, if (!chan) return; - if (cpu >= NR_CPUS || !chan->buf[cpu]) + if (cpu >= NR_CPUS || !chan->buf[cpu] || + ...
04d491ab2a53008a1aa98ac09561768c7f3adda3
Analyze and fix the following issue in the Linux kernel code: kexec: add dmesg log symbols to /proc/vmcoreinfo lists
Problem Details: It would be nice to be able to extract the dmesg log from a vmcore file without needing to keep the debug symbols for the running kernel handy all the time. We have a facility to do this in /proc/vmcore. This patch adds the log_buf and log_end symbols to the vmcoreinfo area so that tools (like makedu...
```diff diff --git a/include/linux/kernel.h b/include/linux/kernel.h index e720b0da7751..556d781e69fe 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -242,6 +242,7 @@ extern struct ratelimit_state printk_ratelimit_state; extern int printk_ratelimit(void); extern bool printk_timed_ratelimit(unsigne...
23c36c1aec895fd52d7dd8cd3ce4bbce43c969fd
Analyze and fix the following issue in the Linux kernel code: w1: coding style cleanups in w1_io.c
Problem Details: This fixes a number of coding style issues I stubled over. Acked-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru> Signed-off-by: Daniel Mack <daniel@caiaq.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/drivers/w1/w1_io.c b/drivers/w1/w1_io.c index 442bd8bbd4a5..3ebe9726a9e5 100644 --- a/drivers/w1/w1_io.c +++ b/drivers/w1/w1_io.c @@ -69,7 +69,7 @@ static u8 w1_touch_bit(struct w1_master *dev, int bit) return w1_read_bit(dev); else { w1_write_bit(dev, 0); - return(0); + return 0; } } ...
50db9d8e4ca17974595e3848cb65f9371a304de4
Analyze and fix the following issue in the Linux kernel code: parport: netmos 9845 & 9855 1P4S fixes
Problem Details: netmos serial/parallel adapters come in different flavour differing only by the number of parallel and serial ports, which are encoded in the subdevice ID. Last fix of Christian Pellegrin for 9855 2P2S broke support for 9855 1P4S, and works only by side-effect for the first parallel port of a 2P2S, as...
```diff diff --git a/drivers/parport/parport_serial.c b/drivers/parport/parport_serial.c index 032db815b0f9..f3492110b1ad 100644 --- a/drivers/parport/parport_serial.c +++ b/drivers/parport/parport_serial.c @@ -30,6 +30,7 @@ enum parport_pc_pci_cards { titan_210l, netmos_9xx5_combo, netmos_9855, + netmos_9855_2p,...
cc18e3cd5345715544e4d61b32a7442360817195
Analyze and fix the following issue in the Linux kernel code: edac: add more verbose debug info
Problem Details: A patch for making a debugging information more verbose for use in development debugging. By enabling the new option "More verbose debugging", information about source file and line number will be added to debugging message. This is sample output, EDAC MC0: Giving out device to 'e7xxx_edac' 'E7205':...
```diff diff --git a/drivers/edac/Kconfig b/drivers/edac/Kconfig index eee47fd16d79..56021f64ee22 100644 --- a/drivers/edac/Kconfig +++ b/drivers/edac/Kconfig @@ -40,6 +40,14 @@ config EDAC_DEBUG there're four debug levels (x=0,1,2,3 from low to high). Usually you should select 'N'. +config EDAC_DEBUG_VERBOSE...
1a2ad21128bb4eb79f3c05e5801edcc5ed3ef1d3
Analyze and fix the following issue in the Linux kernel code: nbd: add locking to nbd_ioctl
Problem Details: The code was written to rely on big kernel lock to protect it from races. It mostly works when interface is not abused. So this uses tx_lock to protect data structures from concurrent use between ioctl and worker threads. Next step will be moving from ioctl to unlocked_ioctl. [akpm@linux-foundation....
```diff diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index 8299e2d3b611..5e982814797d 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -568,27 +568,17 @@ static void do_nbd_request(struct request_queue * q) } } -static int nbd_ioctl(struct block_device *bdev, fmode_t mode, - unsigned i...
52ee2dfdd4f51cf422ea6a96a0846dc94244aa37
Analyze and fix the following issue in the Linux kernel code: pids: refactor vnr/nr_ns helpers to make them safe
Problem Details: Inho, the safety rules for vnr/nr_ns helpers are horrible and buggy. task_pid_nr_ns(task) needs rcu/tasklist depending on task == current. As for "special" pids, vnr/nr_ns helpers always need rcu. However, if task != current, they are unsafe even under rcu lock, we can't trust task->group_leader wit...
```diff diff --git a/include/linux/sched.h b/include/linux/sched.h index 722dd313bf8a..49df878a0cad 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -1519,17 +1519,23 @@ struct pid_namespace; * * see also pid_nr() etc in include/linux/pid.h */ +pid_t __task_pid_nr_ns(struct task_struct *task, enu...
2ae448efc87df6d328f5835969076c7f9fce59c3
Analyze and fix the following issue in the Linux kernel code: pids: improve get_task_pid() to fix the unsafe sys_wait4()->task_pgrp()
Problem Details: sys_wait4() does get_pid(task_pgrp(current)), this is not safe. We can add rcu lock/unlock around, but we already have get_task_pid() which can be improved to handle the special pids in more reliable manner. Signed-off-by: Oleg Nesterov <oleg@redhat.com> Cc: Louis Rilling <Louis.Rilling@kerlabs.com> ...
```diff diff --git a/kernel/exit.c b/kernel/exit.c index 029415d9f82e..384f09caf2ef 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -1737,7 +1737,7 @@ SYSCALL_DEFINE4(wait4, pid_t, upid, int __user *, stat_addr, pid = find_get_pid(-upid); } else if (upid == 0) { type = PIDTYPE_PGID; - pid = get_pid(task_pgrp...
6dda81f4384b94930826eded254d8c16f89a9248
Analyze and fix the following issue in the Linux kernel code: pids: document task_pgrp/task_session is not safe without tasklist/rcu
Problem Details: Even if task == current, it is not safe to dereference the result of task_pgrp/task_session. We can race with another thread which changes the special pid via setpgid/setsid. Document this. The next 2 patches give an example of the unsafe usage, we have more bad users. [akpm@linux-foundation.org: c...
```diff diff --git a/include/linux/sched.h b/include/linux/sched.h index b47c94e7560b..722dd313bf8a 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -1489,6 +1489,11 @@ static inline struct pid *task_tgid(struct task_struct *task) return task->group_leader->pids[PIDTYPE_PID].pid; } +/* + * Without...
8e654fba4a376f436bdfe361fc5cdbc87ac09b35
Analyze and fix the following issue in the Linux kernel code: sysctl: fix suid_dumpable and lease-break-time sysctls
Problem Details: Arne de Bruijn points out that commit 76fdbb25f963de5dc1e308325f0578a2f92b1c2d ("coredump masking: bound suid_dumpable sysctl") mistakenly limits lease-break-time instead of suid_dumpable. Signed-off-by: Matthew Wilcox <matthew@wil.cx> Reported-by: Arne de Bruijn <kernelbt@arbruijn.dds.nl> Cc: Kawai, ...
```diff diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 2e490a389dd2..5ec4543dfc06 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -95,12 +95,9 @@ static int sixty = 60; static int neg_one = -1; #endif -#if defined(CONFIG_MMU) && defined(CONFIG_FILE_LOCKING) -static int two = 2; -#endif - static int zer...
303d379c54fc9ed553562e36c1cbd1791a3f5d17
Analyze and fix the following issue in the Linux kernel code: hpet: fix the possibility of insane return value of hpet_calibrate() against SMI
Problem Details: hpet_calibrate() has a possibility of miss-calibration due to SMI. If SMI interrupts in the while loop of calibration, then return value will be big. This change calibrates until stabilizing by the return value with a small value. [akpm@linux-foundation.org: trivial style tweaks] Signed-off-by: Yasu...
```diff diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c index 32b8bbf5003e..50dfa3bc71ce 100644 --- a/drivers/char/hpet.c +++ b/drivers/char/hpet.c @@ -713,7 +713,7 @@ static struct ctl_table_header *sysctl_header; */ #define TICK_CALIBRATE (1000UL) -static unsigned long hpet_calibrate(struct hpets *hpetp) ...
2355b70fd59cb5be7de2052a9edeee7afb7ff099
Analyze and fix the following issue in the Linux kernel code: workqueue: avoid recursion in run_workqueue()
Problem Details: 1) lockdep will complain when run_workqueue() performs recursion. 2) The recursive implementation of run_workqueue() means that flush_workqueue() and its documentation are inconsistent. This may hide deadlocks and other bugs. 3) The recursion in run_workqueue() will poison cwq->current_work, b...
```diff diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 9aedd9fd825b..32f8e0d2bf5a 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -48,8 +48,6 @@ struct cpu_workqueue_struct { struct workqueue_struct *wq; struct task_struct *thread; - - int run_depth; /* Detect run_workqueue() recursion de...
1ee1184485df9c9a3503d3a684b911fb7c73d259
Analyze and fix the following issue in the Linux kernel code: ptrace_untrace: fix the SIGNAL_STOP_STOPPED check
Problem Details: This bug is ancient too. ptrace_untrace() must not resume the task if the group stop in progress, we should set TASK_STOPPED instead. Unfortunately, we still have problems here: - if the process/thread was traced, SIGNAL_STOP_STOPPED does not necessary means this thread group is stopped. - ptra...
```diff diff --git a/kernel/ptrace.c b/kernel/ptrace.c index 296e8105863a..5105f5a6a2ce 100644 --- a/kernel/ptrace.c +++ b/kernel/ptrace.c @@ -60,11 +60,15 @@ static void ptrace_untrace(struct task_struct *child) { spin_lock(&child->sighand->siglock); if (task_is_traced(child)) { - if (child->signal->flags & SIGN...
95a3540da9c81a5987be810e1d9a83640a366bd5
Analyze and fix the following issue in the Linux kernel code: ptrace_detach: the wrong wakeup breaks the ERESTARTxxx logic
Problem Details: Another ancient bug. Consider this trivial test-case, int main(void) { int pid = fork(); if (pid) { ptrace(PTRACE_ATTACH, pid, NULL, NULL); wait(NULL); ptrace(PTRACE_DETACH, pid, NULL, NULL); } else { pause(); printf("WE HAVE A KERNEL BUG!!!\n"); } return 0; } the child ...
```diff diff --git a/kernel/ptrace.c b/kernel/ptrace.c index f5a9fa5aafa1..296e8105863a 100644 --- a/kernel/ptrace.c +++ b/kernel/ptrace.c @@ -301,11 +301,7 @@ int ptrace_detach(struct task_struct *child, unsigned int data) */ if (child->ptrace) { child->exit_code = data; - dead = __ptrace_detach(current, ch...
7f5d3652d469cdf9eb2365dfea7ce3fb9e1409cc
Analyze and fix the following issue in the Linux kernel code: reparent_thread: fix a zombie leak if /sbin/init ignores SIGCHLD
Problem Details: If /sbin/init ignores SIGCHLD and we re-parent a zombie, it is leaked. reparent_thread() does do_notify_parent() which sets ->exit_signal = -1 in this case. This means that nobody except us can reap it, the detached task is not visible to do_wait(). Change reparent_thread() to return a boolean (like ...
```diff diff --git a/kernel/exit.c b/kernel/exit.c index 5be0a406faeb..3e09b7cb3b20 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -810,8 +810,11 @@ static void ptrace_exit_finish(struct task_struct *parent, } } -static void reparent_thread(struct task_struct *p, struct task_struct *father) +/* Returns nonzero ...
b1442b055c154699a6a2c436f3352f71b6beede3
Analyze and fix the following issue in the Linux kernel code: reparent_thread: fix the "is it traced" check
Problem Details: reparent_thread() uses ptrace_reparented() to check whether this thread is ptraced, in that case we should not notify the new parent. But ptrace_reparented() is not exactly correct when the reparented thread is traced by /sbin/init, because forget_original_parent() has already changed ->real_parent. ...
```diff diff --git a/kernel/exit.c b/kernel/exit.c index 405e6877168b..5be0a406faeb 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -832,7 +832,7 @@ static void reparent_thread(struct task_struct *p, struct task_struct *father) /* If we'd notified the old parent about this child's death, * also notify the new pa...
4576145c1ecdaaea9ef8976a48335206aa1ebf91
Analyze and fix the following issue in the Linux kernel code: ptrace: fix possible zombie leak on PTRACE_DETACH
Problem Details: When ptrace_detach() takes tasklist, the tracee can be SIGKILL'ed. If it has already passed exit_notify() we can leak a zombie, because a) ptracing disables the auto-reaping logic, and b) ->real_parent was not notified about the child's death. ptrace_detach() should follow the ptrace_exit's logic, ch...
```diff diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h index 98b93ca4db06..1a2b0cb55535 100644 --- a/include/linux/ptrace.h +++ b/include/linux/ptrace.h @@ -94,6 +94,7 @@ extern void ptrace_notify(int exit_code); extern void __ptrace_link(struct task_struct *child, struct task_struct *new_parent); ...
95c3eb76dc07fd81289888ffc42948196b34b444
Analyze and fix the following issue in the Linux kernel code: ptrace: kill __ptrace_detach(), fix ->exit_state check
Problem Details: Move the code from __ptrace_detach() to its single caller and kill this helper. Also, fix the ->exit_state check, we shouldn't wake up EXIT_DEAD tasks. Actually, I think task_is_stopped_or_traced() makes more sense, but this needs another patch. Signed-off-by: Oleg Nesterov <oleg@redhat.com> Cc: Jero...
```diff diff --git a/kernel/ptrace.c b/kernel/ptrace.c index c9cf48b21f05..f62a568e84ec 100644 --- a/kernel/ptrace.c +++ b/kernel/ptrace.c @@ -235,16 +235,6 @@ out: return retval; } -static inline void __ptrace_detach(struct task_struct *child, unsigned int data) -{ - child->exit_code = data; - /* .. re-parent .. ...
90bc8d8b1a38f1ab131a2399a202e1889db95de8
Analyze and fix the following issue in the Linux kernel code: do_wait: fix waiting for the group stop with the dead leader
Problem Details: do_wait(WSTOPPED) assumes that p->state must be == TASK_STOPPED, this is not true if the leader is already dead. Check SIGNAL_STOP_STOPPED instead and use signal->group_exit_code. Trivial test-case: void *tfunc(void *arg) { pause(); return NULL; } int main(void) { pthread_t thr; pthrea...
```diff diff --git a/kernel/exit.c b/kernel/exit.c index 167e1e3ad7c6..0c06b9efae3b 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -1417,6 +1417,18 @@ static int wait_task_zombie(struct task_struct *p, int options, return retval; } +static int *task_stopped_code(struct task_struct *p, bool ptrace) +{ + if (ptra...
0b4217b3fdddc4a58939720d3ed809537577d48b
Analyze and fix the following issue in the Linux kernel code: cpuset: fix possible races in cpu/memory hotplug
Problem Details: Change to cpuset->cpus_allowed and cpuset->mems_allowed should be protected by callback_mutex, otherwise the reader may read wrong cpus/mems. This is cpuset's lock rule. Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Cc: Paul Menage <menage@google.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Peter Zijlstra...
```diff diff --git a/kernel/cpuset.c b/kernel/cpuset.c index ee5ec386aa8b..31737957cb62 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c @@ -2070,7 +2070,9 @@ static int cpuset_track_online_cpus(struct notifier_block *unused_nb, } cgroup_lock(); + mutex_lock(&callback_mutex); cpumask_copy(top_cpuset.cpus_allo...
a3b2d692690aef228e493b1beaafe5364cab3237
Analyze and fix the following issue in the Linux kernel code: cgroups: use css id in swap cgroup for saving memory v5
Problem Details: Try to use CSS ID for records in swap_cgroup. By this, on 64bit machine, size of swap_cgroup goes down to 2 bytes from 8bytes. This means, when 2GB of swap is equipped, (assume the page size is 4096bytes) From size of swap_cgroup = 2G/4k * 8 = 4Mbytes. To size of swap_cgroup = 2G/4k * 2 = 1Mbyte...
```diff diff --git a/include/linux/page_cgroup.h b/include/linux/page_cgroup.h index 602cc1fdee90..7339c7bf7331 100644 --- a/include/linux/page_cgroup.h +++ b/include/linux/page_cgroup.h @@ -91,24 +91,23 @@ static inline void page_cgroup_init(void) #ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP #include <linux/swap.h> -ext...
3c776e64660028236313f0e54f3a9945764422df
Analyze and fix the following issue in the Linux kernel code: memcg: charge swapcache to proper memcg
Problem Details: memcg_test.txt says at 4.1: This swap-in is one of the most complicated work. In do_swap_page(), following events occur when pte is unchanged. (1) the page (SwapCache) is looked up. (2) lock_page() (3) try_charge_swapin() (4) reuse_swap_page() (may call delete_swap_cache()) (5) commit_charge_s...
```diff diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 7bb14fdc780c..81b0ae8183d0 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -994,13 +994,24 @@ nomem: static struct mem_cgroup *try_get_mem_cgroup_from_swapcache(struct page *page) { struct mem_cgroup *mem; + struct page_cgroup *pc; swp_entry_t ent...
e222432bfa7dcf6ec008622a978c9f284ed5e3a9
Analyze and fix the following issue in the Linux kernel code: memcg: show memcg information during OOM
Problem Details: Add RSS and swap to OOM output from memcg Display memcg values like failcnt, usage and limit when an OOM occurs due to memcg. Thanks to Johannes Weiner, Li Zefan, David Rientjes, Kamezawa Hiroyuki, Daisuke Nishimura and KOSAKI Motohiro for review. Sample output ------------- Task in /a/x killed as ...
```diff diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 326f45c86530..7aba9f264622 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -104,6 +104,8 @@ struct zone_reclaim_stat *mem_cgroup_get_reclaim_stat(struct mem_cgroup *memcg, struct zone *zone); str...
0b7f569e45bb6be142d87017030669a6a7d327a1
Analyze and fix the following issue in the Linux kernel code: memcg: fix OOM killer under memcg
Problem Details: This patch tries to fix OOM Killer problems caused by hierarchy. Now, memcg itself has OOM KILL function (in oom_kill.c) and tries to kill a task in memcg. But, when hierarchy is used, it's broken and correct task cannot be killed. For example, in following cgroup /groupA/ hierarchy=1, limit=1G, 0...
```diff diff --git a/Documentation/cgroups/memcg_test.txt b/Documentation/cgroups/memcg_test.txt index 523a9c16c400..8a11caf417a0 100644 --- a/Documentation/cgroups/memcg_test.txt +++ b/Documentation/cgroups/memcg_test.txt @@ -1,5 +1,5 @@ Memory Resource Controller(Memcg) Implementation Memo. -Last Updated: 2009/1/19...
81d39c20f5ee2437d71709beb82597e2a38efbbc
Analyze and fix the following issue in the Linux kernel code: memcg: fix shrinking memory to return -EBUSY by fixing retry algorithm
Problem Details: As pointed out, shrinking memcg's limit should return -EBUSY after reasonable retries. This patch tries to fix the current behavior of shrink_usage. Before looking into "shrink should return -EBUSY" problem, we should fix hierarchical reclaim code. It compares current usage and current limit, but it...
```diff diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 33fc0302e29e..6f6a575e77ad 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -702,6 +702,23 @@ static unsigned int get_swappiness(struct mem_cgroup *memcg) return swappiness; } +static int mem_cgroup_count_children_cb(struct mem_cgroup *mem, void *da...
d969fbe69e07fcceb0558b35d4c75eb046041c5e
Analyze and fix the following issue in the Linux kernel code: debug cgroup: remove unneeded cgroup_lock
Problem Details: Since we are in cgroup write handler, so the cgrp is valid, so we don't have to hold cgroup_mutex when calling cgroup_task_count(). One similar example is in cgroup_tasks_open(). Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Acked-by: Paul Menage <menage@google.com> Signed-off-by: Andrew Morton <akpm...
```diff diff --git a/kernel/cgroup_debug.c b/kernel/cgroup_debug.c index daca6209202d..0c92d797baa6 100644 --- a/kernel/cgroup_debug.c +++ b/kernel/cgroup_debug.c @@ -40,9 +40,7 @@ static u64 taskcount_read(struct cgroup *cont, struct cftype *cft) { u64 count; - cgroup_lock(); count = cgroup_task_count(cont); - ...
0670e08bdfc67272f8c3087030417465629b8073
Analyze and fix the following issue in the Linux kernel code: cgroups: don't change release_agent when remount failed
Problem Details: Remount can fail in either case: - wrong mount options is specified, or option 'noprefix' is changed. - a to-be-added subsys is already mounted/active. When using remount to change 'release_agent', for the above former failure case, remount will return errno with release_agent unchanged, but for t...
```diff diff --git a/kernel/cgroup.c b/kernel/cgroup.c index fea11c5c990c..f2a3f5c9936c 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c @@ -915,10 +915,11 @@ static int cgroup_remount(struct super_block *sb, int *flags, char *data) } ret = rebind_subsystems(root, opts.subsys_bits); + if (ret) + goto out_unloc...
ec64f51545fffbc4cb968f0cea56341a4b07e85a
Analyze and fix the following issue in the Linux kernel code: cgroup: fix frequent -EBUSY at rmdir
Problem Details: In following situation, with memory subsystem, /groupA use_hierarchy==1 /01 some tasks /02 some tasks /03 some tasks /04 empty When tasks under 01/02/03 hit limit on /groupA, hierarchical reclaim is triggered and the kernel walks tree under groupA. In this case, rmdir /groupA/04 fails with -...
```diff diff --git a/Documentation/cgroups/cgroups.txt b/Documentation/cgroups/cgroups.txt index 93feb8444489..cdc46a501b85 100644 --- a/Documentation/cgroups/cgroups.txt +++ b/Documentation/cgroups/cgroups.txt @@ -476,11 +476,13 @@ cgroup->parent is still valid. (Note - can also be called for a newly-created cgroup i...
d20a390a0ee2bf2f692c539c6ce1c829e1080bb5
Analyze and fix the following issue in the Linux kernel code: cgroups: fix cgroup.h comments
Problem Details: Fix the style of some multi-line comments in cgroup.h to match Documentation/CodingStyle Signed-off-by: Paul Menage <menage@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 499900d0cee7..bb8feb9feccd 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h @@ -47,14 +47,18 @@ enum cgroup_subsys_id { /* Per-subsystem/per-cgroup state maintained by the system. */ struct cgroup_subsys_state { - /* The cgro...
45dad7bd9d9b65a30d6e790b111f6f2d8f746d22
Analyze and fix the following issue in the Linux kernel code: documentation: fix unix_dgram_qlen description
Problem Details: Previous description about system parameter in /proc/sys/net/unix/ is wrong (or missed). Simply add a new description about unix_dgram_qlen according to latest kernel. Signed-off-by: Li Xiaodong <lixd@cn.fujitsu.com> Cc: "David S. Miller" <davem@davemloft.net> Signed-off-by: Andrew Morton <akpm@linux...
```diff diff --git a/Documentation/sysctl/net.txt b/Documentation/sysctl/net.txt index 995c2257b3e7..a34d55b65441 100644 --- a/Documentation/sysctl/net.txt +++ b/Documentation/sysctl/net.txt @@ -93,8 +93,9 @@ of struct cmsghdr structures with appended data. 2. /proc/sys/net/unix - Parameters for Unix domain sockets -...
695f6ae0dcea3dd83bfbb9634ff067f780649ba8
Analyze and fix the following issue in the Linux kernel code: ext3: avoid false EIO errors
Problem Details: Sometimes block_write_begin() can map buffers in a page but later we fail to copy data into those buffers (because the source page has been paged out in the mean time). We then end up with !uptodate mapped buffers. To add a bit more to the confusion, block_write_end() does not commit any data (and th...
```diff diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c index 4a09ff169870..d3ef6566b019 100644 --- a/fs/ext3/inode.c +++ b/fs/ext3/inode.c @@ -1149,12 +1149,15 @@ static int ext3_write_begin(struct file *file, struct address_space *mapping, struct page **pagep, void **fsdata) { struct inode *inode = mapping->ho...
de18f3b2d68c1f3481839be760a5ff93f6a9a5e5
Analyze and fix the following issue in the Linux kernel code: ext3: return -EIO not -ESTALE on directory traversal through deleted inode
Problem Details: ext3_iget() returns -ESTALE if invoked on a deleted inode, in order to report errors to NFS properly. However, in ext[234]_lookup(), this -ESTALE can be propagated to userspace if the filesystem is corrupted such that a directory entry references a deleted inode. This leads to a misleading error mess...
```diff diff --git a/fs/ext3/namei.c b/fs/ext3/namei.c index bd87a6077536..6ddaa0a42b24 100644 --- a/fs/ext3/namei.c +++ b/fs/ext3/namei.c @@ -1047,8 +1047,16 @@ static struct dentry *ext3_lookup(struct inode * dir, struct dentry *dentry, str return ERR_PTR(-EIO); } inode = ext3_iget(dir->i_sb, ino); - if (I...
45f902178022439795a21e14f886b8ccb49a75d2
Analyze and fix the following issue in the Linux kernel code: ext3: use unsigned instead of int for type of blocksize in fs/ext3/namei.c
Problem Details: Use unsigned instead of int for the parameter which carries a blocksize. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com> Cc: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@...
```diff diff --git a/fs/ext3/namei.c b/fs/ext3/namei.c index e2fc63cbba8b..bd87a6077536 100644 --- a/fs/ext3/namei.c +++ b/fs/ext3/namei.c @@ -161,12 +161,12 @@ static struct dx_frame *dx_probe(struct qstr *entry, struct dx_frame *frame, int *err); static void dx_release (struct dx_frame *frames); -static ...
ecca9af0a98fdacfcdc73979d08481d7b27ff986
Analyze and fix the following issue in the Linux kernel code: jbd: fix oops in jbd_journal_init_inode() on corrupted fs
Problem Details: On 32-bit system with CONFIG_LBD getblk can fail because provided block number is too big. Make JBD gracefully handle that. Signed-off-by: Jan Kara <jack@suse.cz> Cc: <dmaciejak@fortinet.com> Cc: <linux-ext4@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus...
```diff diff --git a/fs/jbd/journal.c b/fs/jbd/journal.c index e79c07812afa..737f7246a4b5 100644 --- a/fs/jbd/journal.c +++ b/fs/jbd/journal.c @@ -637,6 +637,8 @@ struct journal_head *journal_get_descriptor_buffer(journal_t *journal) return NULL; bh = __getblk(journal->j_dev, blocknr, journal->j_blocksize); + if...
8c655918b15691d3a97f4e9a7c3c0a6ac992e297
Analyze and fix the following issue in the Linux kernel code: pnpbios: fix warning if CONFIG_HOTPLUG=n
Problem Details: drivers/pnp/pnpbios/core.c: In function 'pnpbios_thread_init': drivers/pnp/pnpbios/core.c:578: warning: unused variable 'task' Signed-off-by: Erik Ekman <erik@kryo.se> Cc: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torva...
```diff diff --git a/drivers/pnp/pnpbios/core.c b/drivers/pnp/pnpbios/core.c index 996f64838079..e706d22b6dd1 100644 --- a/drivers/pnp/pnpbios/core.c +++ b/drivers/pnp/pnpbios/core.c @@ -575,8 +575,6 @@ fs_initcall(pnpbios_init); static int __init pnpbios_thread_init(void) { - struct task_struct *task; - #if defin...
96615841e170f0108832e64a90d51b469573a472
Analyze and fix the following issue in the Linux kernel code: rtc-v3020: add ability to access v3020 chip with GPIOs
Problem Details: The v3020 RTC can be connected to GPIOs as well as to memory-like interface. Add ability to use GPIO bit-bang for v3020 read-write access. [akpm@linux-foundation.org: fix off-by-one in error path] Signed-off-by: Mike Rapoport <mike@compulab.co.il> Acked-by: Alessandro Zummo <a.zummo@towertech.it> Cc:...
```diff diff --git a/drivers/rtc/rtc-v3020.c b/drivers/rtc/rtc-v3020.c index 66955cc9c746..ad164056feb6 100644 --- a/drivers/rtc/rtc-v3020.c +++ b/drivers/rtc/rtc-v3020.c @@ -27,17 +27,162 @@ #include <linux/bcd.h> #include <linux/rtc-v3020.h> #include <linux/delay.h> +#include <linux/gpio.h> #include <linux/io.h...
c1c490e017b66b31f6559db9cbb51a3ce00cf639
Analyze and fix the following issue in the Linux kernel code: initramfs: prevent initramfs printk message being split by messages from other code.
Problem Details: initramfs uses printk without a linefeed, then does some work, then uses printk to finish the message off. However if some other code does a printk in between, then the messages get mixed together. Better for each message to be an independent line... Example of problem that this fixes: checking...
```diff diff --git a/init/initramfs.c b/init/initramfs.c index 619c1baf7701..80cd713f6cc5 100644 --- a/init/initramfs.c +++ b/init/initramfs.c @@ -571,11 +571,11 @@ static int __init populate_rootfs(void) if (initrd_start) { #ifdef CONFIG_BLK_DEV_RAM int fd; - printk(KERN_INFO "checking if image is initramfs..."...
6f2c55b843836d26528c56a0968689accaedbc67
Analyze and fix the following issue in the Linux kernel code: Simplify copy_thread()
Problem Details: First argument unused since 2.3.11. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Cc: <linux-arch@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c index 8d0097f10208..3a2fb7a02db4 100644 --- a/arch/alpha/kernel/process.c +++ b/arch/alpha/kernel/process.c @@ -272,7 +272,7 @@ alpha_vfork(struct pt_regs *regs) */ int -copy_thread(int nr, unsigned long clone_flags, unsigned long usp, ...
bf6aede712334d7338d5c47a5ee5ba3883c82a61
Analyze and fix the following issue in the Linux kernel code: workqueue: add to_delayed_work() helper function
Problem Details: It is a fairly common operation to have a pointer to a work and to need a pointer to the delayed work it is contained in. In particular, all delayed works which want to rearm themselves will have to do that. So it would seem fair to offer a helper function for this operation. [akpm@linux-foundation....
```diff diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c index d3694498f3af..819e59f6f7c7 100644 --- a/arch/powerpc/kernel/vio.c +++ b/arch/powerpc/kernel/vio.c @@ -482,7 +482,7 @@ static void vio_cmo_balance(struct work_struct *work) cmo->excess.size = cmo->entitled - cmo->reserve.size; cmo->exce...
e4c2ff1cf2d7fc65d0fc6f88bc98338e0212ad52
Analyze and fix the following issue in the Linux kernel code: uml: fix warnings in kernel_execve
Problem Details: Fix the following warnings: arch/um/kernel/syscall.c: In function 'kernel_execve': arch/um/kernel/syscall.c:130: warning: passing argument 1 of 'um_execve' discards qualifiers from pointer target type arch/um/kernel/syscall.c:130: warning: passing argument 2 of 'um_execve' discards qualifiers from poi...
```diff diff --git a/arch/um/kernel/syscall.c b/arch/um/kernel/syscall.c index c4df705b8359..a4625c7b2bf9 100644 --- a/arch/um/kernel/syscall.c +++ b/arch/um/kernel/syscall.c @@ -127,7 +127,8 @@ int kernel_execve(const char *filename, char *const argv[], char *const envp[]) fs = get_fs(); set_fs(KERNEL_DS); - ret...
7130f2f5528fd9df8f18790730e39dff9136ee33
Analyze and fix the following issue in the Linux kernel code: uml: fix link error from prefixing of i386 syscalls with ptregs_
Problem Details: Fix the following link error: arch/um/sys-i386/built-in.o: In function `sys_call_table': (.rodata+0x11c): undefined reference to `ptregs_fork' arch/um/sys-i386/built-in.o: In function `sys_call_table': (.rodata+0x140): undefined reference to `ptregs_execve' arch/um/sys-i386/built-in.o: In function `sy...
```diff diff --git a/arch/um/sys-i386/sys_call_table.S b/arch/um/sys-i386/sys_call_table.S index 00e5f5203eea..c6260dd6ebb9 100644 --- a/arch/um/sys-i386/sys_call_table.S +++ b/arch/um/sys-i386/sys_call_table.S @@ -9,6 +9,17 @@ #define old_mmap old_mmap_i386 +#define ptregs_fork sys_fork +#define ptregs_execve sys...
ebe28bb41573502518805d0c9b39fc6426008fd1
Analyze and fix the following issue in the Linux kernel code: uml: fix compile error from net_device_ops conversion
Problem Details: Fix the following compile error: arch/um/drivers/net_kern.c: In function 'uml_inetaddr_event': arch/um/drivers/net_kern.c:760: error: 'struct net_device' has no member named 'open' This was introduced by commit 8bb95b39, "uml: convert network device to netdevice ops". Signed-off-by: Miklos Szeredi <...
```diff diff --git a/arch/um/drivers/net_kern.c b/arch/um/drivers/net_kern.c index 434224e2229f..434ba121e3c5 100644 --- a/arch/um/drivers/net_kern.c +++ b/arch/um/drivers/net_kern.c @@ -757,7 +757,7 @@ static int uml_inetaddr_event(struct notifier_block *this, unsigned long event, void (*proc)(unsigned char *, unsig...
58984ce21d315b70df1a43644df7416ea7c9bfd8
Analyze and fix the following issue in the Linux kernel code: mm: do_xip_mapping_read: fix length calculation
Problem Details: The calculation of the value nr in do_xip_mapping_read is incorrect. If the copy required more than one iteration in the do while loop the copies variable will be non-zero. The maximum length that may be passed to the call to copy_to_user(buf+copied, xip_mem+offset, nr) is len-copied but the check on...
```diff diff --git a/mm/filemap_xip.c b/mm/filemap_xip.c index 0c04615651b7..427dfe3ce78c 100644 --- a/mm/filemap_xip.c +++ b/mm/filemap_xip.c @@ -89,8 +89,8 @@ do_xip_mapping_read(struct address_space *mapping, } } nr = nr - offset; - if (nr > len) - nr = len; + if (nr > len - copied) + nr = len - copi...
d2caa3c549c74d6476e2c29e13bd4d0e7d21c7fe
Analyze and fix the following issue in the Linux kernel code: writeback: guard against jiffies wraparound on inode->dirtied_when checks (try #3)
Problem Details: The dirtied_when value on an inode is supposed to represent the first time that an inode has one of its pages dirtied. This value is in units of jiffies. It's used in several places in the writeback code to determine when to write out an inode. The problem is that these checks assume that dirtied_wh...
```diff diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index f81f9e71871e..eed480639902 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c @@ -196,7 +196,7 @@ static void redirty_tail(struct inode *inode) struct inode *tail_inode; tail_inode = list_entry(sb->s_dirty.next, struct inode, i_list); - if (!...
b6fac63cc1f52ec27f29fe6c6c8494a2ffac33fd
Analyze and fix the following issue in the Linux kernel code: vfs: skip I_CLEAR state inodes
Problem Details: clear_inode() will switch inode state from I_FREEING to I_CLEAR, and do so _outside_ of inode_lock. So any I_FREEING testing is incomplete without a coupled testing of I_CLEAR. So add I_CLEAR tests to drop_pagecache_sb(), generic_sync_sb_inodes() and add_dquot_ref(). Masayoshi MIZUMA discovered the ...
```diff diff --git a/fs/drop_caches.c b/fs/drop_caches.c index 44d725f612cf..b6a719a909f8 100644 --- a/fs/drop_caches.c +++ b/fs/drop_caches.c @@ -18,7 +18,7 @@ static void drop_pagecache_sb(struct super_block *sb) spin_lock(&inode_lock); list_for_each_entry(inode, &sb->s_inodes, i_sb_list) { - if (inode->i_stat...
33e5d76979cf01e3834814fe0aea569d1d602c1a
Analyze and fix the following issue in the Linux kernel code: nommu: fix a number of issues with the per-MM VMA patch
Problem Details: Fix a number of issues with the per-MM VMA patch: (1) Make mmap_pages_allocated an atomic_long_t, just in case this is used on a NOMMU system with more than 2G pages. Makes no difference on a 32-bit system. (2) Report vma->vm_pgoff * PAGE_SIZE as a 64-bit value, not a 32-bit value, ...
```diff diff --git a/fs/proc/meminfo.c b/fs/proc/meminfo.c index 43d23948384a..74ea974f5ca6 100644 --- a/fs/proc/meminfo.c +++ b/fs/proc/meminfo.c @@ -120,7 +120,7 @@ static int meminfo_proc_show(struct seq_file *m, void *v) K(i.freeram-i.freehigh), #endif #ifndef CONFIG_MMU - K((unsigned long) atomic_read(&mmap_...
ee3b4290aec03022cfb67c9adba9f1b3215245f0
Analyze and fix the following issue in the Linux kernel code: generic debug pagealloc: build fix
Problem Details: This fixes a build failure with generic debug pagealloc: mm/debug-pagealloc.c: In function 'set_page_poison': mm/debug-pagealloc.c:8: error: 'struct page' has no member named 'debug_flags' mm/debug-pagealloc.c: In function 'clear_page_poison': mm/debug-pagealloc.c:13: error: 'struct page' has ...
```diff diff --git a/arch/powerpc/Kconfig.debug b/arch/powerpc/Kconfig.debug index 6aa0b5e087cd..a1098e23221f 100644 --- a/arch/powerpc/Kconfig.debug +++ b/arch/powerpc/Kconfig.debug @@ -27,16 +27,6 @@ config DEBUG_STACK_USAGE This option will slow down process creation somewhat. -config DEBUG_PAGEALLOC - ...
b5f22a59c0356655a501190959db9f7f5dd07e3f
Analyze and fix the following issue in the Linux kernel code: don't raise all privs on setuid-root file with fE set (v2)
Problem Details: Distributions face a backward compatibility problem with starting to use file capabilities. For instance, removing setuid root from ping and doing setcap cap_net_raw=pe means that booting with an older kernel or one compiled without file capabilities means ping won't work for non-root users. In order...
```diff diff --git a/security/commoncap.c b/security/commoncap.c index 7cd61a5f5205..97ac1f167717 100644 --- a/security/commoncap.c +++ b/security/commoncap.c @@ -28,6 +28,28 @@ #include <linux/prctl.h> #include <linux/securebits.h> +/* + * If a non-root user executes a setuid-root binary in + * !secure(SECURE_NORO...
797108d134a91afca9fa59c572336b279bc66afb
Analyze and fix the following issue in the Linux kernel code: tcp: add helper for counter tweaking due mid-wq change
Problem Details: We need full-scale adjustment to fix a TCP miscount in the next patch, so just move it into a helper and call for that from the other places. Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/include/net/tcp.h b/include/net/tcp.h index e54c76d75495..1b94b9bfe2dc 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -616,21 +616,6 @@ static inline int tcp_skb_mss(const struct sk_buff *skb) return skb_shinfo(skb)->gso_size; } -static inline void tcp_dec_pcount_approx_int(__u32 *c...
0de8ca597d7b449e9e7ce7af138944acf06c8f05
Analyze and fix the following issue in the Linux kernel code: hso: fix for the 'invalid frame length' messages
Problem Details: Some devices cannot send very short usb transfers. To get around this the firmware adds a known pattern and flags the driver that it should check for this pattern on short transfers. This flag was not taken into account by the driver. Signed-off-by: Jan Dumon <j.dumon@option.com> Signed-off-by: David ...
```diff diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c index 779a0078fcde..f84b78d94c40 100644 --- a/drivers/net/usb/hso.c +++ b/drivers/net/usb/hso.c @@ -2536,14 +2536,15 @@ static void hso_create_rfkill(struct hso_device *hso_dev, } /* Creates our network device */ -static struct hso_device *hso_creat...
3b7d2b319db0ba1f6208ca58b297fb419301f85a
Analyze and fix the following issue in the Linux kernel code: hso: fix for crash when unplugging the device
Problem Details: Changed the order in which things are freed. This fixes an oops when unplugging the device while network traffic is ongoing. Signed-off-by: Jan Dumon <j.dumon@option.com> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c index 28d1424a3110..779a0078fcde 100644 --- a/drivers/net/usb/hso.c +++ b/drivers/net/usb/hso.c @@ -5,6 +5,7 @@ * Copyright (C) 2008 Option International * Filip Aben <f.aben@option.com> * Denis Joseph Barr...
b94ee6528954b6838e88aa8cf74ed75acf8dfcff
Analyze and fix the following issue in the Linux kernel code: drm: fix EDID backward compat check
Problem Details: EDIDs should be backward compatible, so don't bail if we see a version of 3 (which is out there now) and print a message if we see something newer, but allow it to be parsed. Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
```diff diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 2c4a340e682f..ca9c61656714 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -125,10 +125,8 @@ static bool edid_is_valid(struct edid *edid) DRM_ERROR("EDID has major version %d, instead of 1\n", edid->version...
16456c872e4e3d674dde73f9bdf3f69c0d95e070
Analyze and fix the following issue in the Linux kernel code: drm: fix typo in edid vendor parsing.
Problem Details: Should be, edid_vendor[2] = (edid->mfg_id[1] & 0x1f) + '@'; Since vendor ID has only two bytes only, I am somewhat surprised why gcc doesn't complain this. Reported-by: Guo, Chaohong <chaohong.guo@intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
```diff diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index c67400067b85..2c4a340e682f 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -162,7 +162,7 @@ static bool edid_vendor(struct edid *edid, char *vendor) edid_vendor[0] = ((edid->mfg_id[0] & 0x7c) >> 2) + '@'; ...
522b5cc7cec124e06629c0702ffab1307416aec7
Analyze and fix the following issue in the Linux kernel code: drm: fix missing inline function on 32-bit powerpc.
Problem Details: The readq/writeq really need to be static inline on the arches which don't provide them. Reported-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
```diff diff --git a/include/drm/drm_os_linux.h b/include/drm/drm_os_linux.h index 013551d03c03..26641e95e0a4 100644 --- a/include/drm/drm_os_linux.h +++ b/include/drm/drm_os_linux.h @@ -7,12 +7,12 @@ #include <linux/delay.h> #ifndef readq -static u64 readq(void __iomem *reg) +static inline u64 readq(void __iomem *...
7e90560c50f754d65884e251e94c1efa2a4b5784
Analyze and fix the following issue in the Linux kernel code: ACPI: acpi_enforce_resource=strict by default
Problem Details: Enforce strict resource checking - disallowing access by native drivers to IO ports and memory regions claimed by ACPI firmware. The patch is mainly aimed to block native hwmon drivers from touching monitoring chips that ACPI thinks it own. If this causes a regression, boot with "acpi_enforce_resourc...
```diff diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 54f21a5c262b..7068d0bc47c5 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt @@ -258,6 +258,22 @@ and is between 256 and 4096 characters. It is defined in the file to assume ...
67a52bb90b515c2a96ec51a3571bcd70a2fadb50
Analyze and fix the following issue in the Linux kernel code: [ARM] fix build-breaking 7a192ec commit
Problem Details: The commit: platform driver: fix incorrect use of 'platform_bus_type' with 'struct device_driver' contains this: -static int __exit pxa2xx_flash_remove(struct device *dev) +static int __exit pxa2xx_flash_remove(struct platform_device *dev) ... - .remove = __exit_p(pxa2xx_flash_remo...
```diff diff --git a/drivers/mtd/maps/pxa2xx-flash.c b/drivers/mtd/maps/pxa2xx-flash.c index e9026cb1c5b2..572d32fdf38a 100644 --- a/drivers/mtd/maps/pxa2xx-flash.c +++ b/drivers/mtd/maps/pxa2xx-flash.c @@ -117,7 +117,7 @@ static int __init pxa2xx_flash_probe(struct platform_device *pdev) return 0; } -static int _...
c293498be69816087746161338de4b81efdf69fc
Analyze and fix the following issue in the Linux kernel code: Btrfs: BUG to BUG_ON changes
Problem Details: Signed-off-by: Chris Mason <chris.mason@oracle.com>
```diff diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index b8082762ca78..e5b2533b691a 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c @@ -2157,8 +2157,7 @@ static int insert_ptr(struct btrfs_trans_handle *trans, struct btrfs_root BUG_ON(!path->nodes[level]); lower = path->nodes[level]; nritems = btrfs_he...
b6bc978b361bb9da7526a78b0a247bdd34984282
Analyze and fix the following issue in the Linux kernel code: fsl_pq_mdio: Fix compile failure
Problem Details: Add EXPORT_SYMBOL_GPL(fsl_pq_mdio_bus_name) for module builds Signed-off-by: Segher Boessenkool <segher@kernel.crashing.org> Signed-off-by: Kumar Gala <galak@kernel.crashing.org> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/drivers/net/fsl_pq_mdio.c b/drivers/net/fsl_pq_mdio.c index d9e1ecfbf360..aa1eb88c21fc 100644 --- a/drivers/net/fsl_pq_mdio.c +++ b/drivers/net/fsl_pq_mdio.c @@ -204,6 +204,7 @@ void fsl_pq_mdio_bus_name(char *name, struct device_node *np) snprintf(name, MII_BUS_ID_SIZE, "%s@%llx", np->name, (...
d4a789474a6213d1b55b363fb1787b0abf877bba
Analyze and fix the following issue in the Linux kernel code: Btrfs: fix typos in comments
Problem Details: Signed-off-by: Chris Mason <chris.mason@oracle.com>
```diff diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index bb6ac5b87652..8f4e152bb11b 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -143,12 +143,15 @@ static int btrfs_csum_sizes[] = { 4, 0 }; #define BTRFS_FT_MAX 9 /* - * the key defines the order in the tree, and so it also defines (optimal) - * bl...
93dbfad7ac647d4f00354893fe93e8a55be114d5
Analyze and fix the following issue in the Linux kernel code: Btrfs: fix __ucmpdi2 compile bug on 32 bit builds
Problem Details: We get this on 32 builds: fs/built-in.o: In function `extent_fiemap': (.text+0x1019f2): undefined reference to `__ucmpdi2' Happens because of a switch statement with a 64 bit argument. Convert this to an if statement to fix this. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-b...
```diff diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 08085af089e2..eb2bee8b7fbf 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -2884,25 +2884,19 @@ int extent_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, disko = 0; flags = 0; - switch (em->block_start) { - ...
b5555f77115bfba3630fefff2d4e68140b644171
Analyze and fix the following issue in the Linux kernel code: Btrfs: fix race in worker_loop
Problem Details: Need to check kthread_should_stop after schedule_timeout() before calling schedule(). This causes threads to sleep with potentially no one to wake them up causing mount(2) to hang in btrfs_stop_workers waiting for threads to stop. Signed-off-by: Amit Gud <gud@ksu.edu> Signed-off-by: Chris Mason <chris...
```diff diff --git a/fs/btrfs/async-thread.c b/fs/btrfs/async-thread.c index c84ca1f5259a..cba701dba350 100644 --- a/fs/btrfs/async-thread.c +++ b/fs/btrfs/async-thread.c @@ -195,6 +195,9 @@ again_locked: if (!list_empty(&worker->pending)) continue; + if (kthread_should_stop()) + break; + /* st...
bedf762ba3a4b70295661fa70c29c1f18fe0f351
Analyze and fix the following issue in the Linux kernel code: Btrfs: unplug in the async bio submission threads
Problem Details: Btrfs pages being written get set to writeback, and then may go through a number of steps before they hit the block layer. This includes compression, checksumming and async bio submission. The end result is that someone who writes a page and then does wait_on_page_writeback is likely to unplug the qu...
```diff diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index cc01abff03d9..e0913e469728 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -148,7 +148,7 @@ static noinline int run_scheduled_bios(struct btrfs_device *device) unsigned long limit; unsigned long last_waited = 0; - bdi = device->bdev->b...
5b5d9117407e790ade594687010343c5d559a1f4
Analyze and fix the following issue in the Linux kernel code: ACPI: simplify module_param namespace
Problem Details: Impact: cleanup Rather than overriding MODULE_PARAM_PREFIX, build via acpi.o so KBUILD_MODNAME is set to "acpi". This is the logical way to do it, even though acpi cannot be a module due to these config options being bool. Those parts of ACPI which can be modular are not built into the acpi "module"...
```diff diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile index b130ea0d0759..13b611e7eade 100644 --- a/drivers/acpi/Makefile +++ b/drivers/acpi/Makefile @@ -14,48 +14,52 @@ obj-$(CONFIG_X86) += blacklist.o # # ACPI Core Subsystem (Interpreter) # -obj-y += osl.o utils.o reboot.o\ +obj-y += acpi.o \ ...
b44ebeb017b8a5fe5439e1259708b68cf83a8921
Analyze and fix the following issue in the Linux kernel code: dm: move wait queue declaration
Problem Details: Move wait queue declaration and unplug to dm_wait_for_completion. The purpose is to minimize duplicate code in the further patches. The patch reorders functions a little bit. It doesn't change any functionality. For proper non-deadlock operation, add_wait_queue must happen before set_current_state(in...
```diff diff --git a/drivers/md/dm.c b/drivers/md/dm.c index f5703727d974..7867d905ff89 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -1377,6 +1377,11 @@ EXPORT_SYMBOL_GPL(dm_put); static int dm_wait_for_completion(struct mapped_device *md, int interruptible) { int r = 0; + DECLARE_WAITQUEUE(wait, current);...
a32079ce17899192a7b98a42753be467605a8b2f
Analyze and fix the following issue in the Linux kernel code: dm snapshot: persistent fix dtr cleanup
Problem Details: The persistent exception store destructor does not properly account for all conditions in which it can be called. If it is called after 'ctr' but before 'read_metadata' (e.g. if something else in 'snapshot_ctr' fails) then it will attempt to free areas of memory that haven't been allocated yet. Signe...
```diff diff --git a/drivers/md/dm-snap-persistent.c b/drivers/md/dm-snap-persistent.c index 1799205cd945..e75c6dd76a9a 100644 --- a/drivers/md/dm-snap-persistent.c +++ b/drivers/md/dm-snap-persistent.c @@ -162,9 +162,12 @@ static int alloc_area(struct pstore *ps) static void free_area(struct pstore *ps) { - vfree(...
570b9d968bf9b16974252ef7cbce73fa6dac34f3
Analyze and fix the following issue in the Linux kernel code: dm table: fix upgrade mode race
Problem Details: upgrade_mode() sets bdev to NULL temporarily, and does not have any locking to exclude anything from seeing that NULL. In dm_table_any_congested() bdev_get_queue() can dereference that NULL and cause a reported oops. Fix this by not changing that field during the mode upgrade. Cc: stable@kernel.org ...
```diff diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c index 2fd66c30f7f8..e8361b191b9b 100644 --- a/drivers/md/dm-table.c +++ b/drivers/md/dm-table.c @@ -399,28 +399,30 @@ static int check_device_area(struct dm_dev_internal *dd, sector_t start, } /* - * This upgrades the mode on an already open dm_dev....
aea9058801c0acfa2831af1714da412dfb0018c2
Analyze and fix the following issue in the Linux kernel code: dm: path selector use module refcount directly
Problem Details: Fix refcount corruption in dm-path-selector Refcounting with non-atomic ops under shared lock will corrupt the counter in multi-processor system and may trigger BUG_ON(). Use module refcount. # same approach as dm-target-use-module-refcount-directly.patch here # https://www.redhat.com/archives/dm-deve...
```diff diff --git a/drivers/md/dm-path-selector.c b/drivers/md/dm-path-selector.c index 96ea226155b1..42c04f04a0c4 100644 --- a/drivers/md/dm-path-selector.c +++ b/drivers/md/dm-path-selector.c @@ -17,9 +17,7 @@ struct ps_internal { struct path_selector_type pst; - struct list_head list; - long use; }; #def...
c66213921c816f6b1b16a84911618ba9a363b134
Analyze and fix the following issue in the Linux kernel code: dm snapshot: avoid dropping lock in __find_pending_exception
Problem Details: It is uncommon and bug-prone to drop a lock in a function that is called with the lock held, so this is moved to the caller. Cc: stable@kernel.org Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
```diff diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c index 87a2803ba6bd..eb7291a84203 100644 --- a/drivers/md/dm-snap.c +++ b/drivers/md/dm-snap.c @@ -992,23 +992,10 @@ __lookup_pending_exception(struct dm_snapshot *s, chunk_t chunk) * this. */ static struct dm_snap_pending_exception * -__find_pending_...
057de50c0d34b4ef7e15b7a8442a36a396d99c00
Analyze and fix the following issue in the Linux kernel code: pxa2xx-ac97: fix displaying GSR after reset timeout
Problem Details: the variable gsr_bit is set in isr. It is however set to 0 and interrupts are disabled prior to reset. Hence it doesn't make a lot of sense to show the content of gsr_bit in case of a reset timeout. Signed-off-by: Luotao Fu <l.fu@pengutronix.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmic...
```diff diff --git a/sound/arm/pxa2xx-ac97-lib.c b/sound/arm/pxa2xx-ac97-lib.c index 2e6355f4cbb9..71bef45e9d31 100644 --- a/sound/arm/pxa2xx-ac97-lib.c +++ b/sound/arm/pxa2xx-ac97-lib.c @@ -239,6 +239,8 @@ static inline void pxa_ac97_cold_pxa3xx(void) bool pxa2xx_ac97_try_warm_reset(struct snd_ac97 *ac97) { + unsi...
9d681f3a1b27fdfc17ea251cf8d5f627dab34670
Analyze and fix the following issue in the Linux kernel code: [ARM] 5444/1: ARM: Realview: Fix event-device multiplicators in localtimer.c
Problem Details: Set the "mult" to finite value in the local_timer_setup in case of CONFIG_LOCAL_TIMERS not enabled. Othewise this throws warning in the boot log because of detect zero event-device multiplicators. This can cause division-by-zero crashes. Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Sign...
```diff diff --git a/arch/arm/mach-realview/localtimer.c b/arch/arm/mach-realview/localtimer.c index 67d6d9cc68b2..d0d39adf6407 100644 --- a/arch/arm/mach-realview/localtimer.c +++ b/arch/arm/mach-realview/localtimer.c @@ -191,6 +191,7 @@ void __cpuinit local_timer_setup(void) clk->name = "dummy_timer"; clk->featu...
a7f8c50d90a4e983c456ae75e534b5cd6c03674b
Analyze and fix the following issue in the Linux kernel code: x86, mm: fix misuse of debug_kmap_atomic
Problem Details: Impact: fix CONFIG_DEBUG_HIGHMEM=y breakage Commit 7ca43e756 ("mm: use debug_kmap_atomic") introduced some debug_kmap_atomic() calls in the wrong places. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Linus Torvalds <torvalds@linux-foundation.or...
```diff diff --git a/arch/x86/mm/highmem_32.c b/arch/x86/mm/highmem_32.c index 5bc5d1688c1c..8126e8d1a2a4 100644 --- a/arch/x86/mm/highmem_32.c +++ b/arch/x86/mm/highmem_32.c @@ -40,7 +40,6 @@ void *kmap_atomic_prot(struct page *page, enum km_type type, pgprot_t prot) debug_kmap_atomic(type); - debug_kmap_atomic(...
3b5a53689730bef6cb4dfde1de53e836e5299547
Analyze and fix the following issue in the Linux kernel code: CRISv32: Remove extraneous space between -I and the path.
Problem Details: Fixes build error: LD init/built-in.o LD vmlinux SYSMAP System.map OBJCOPY arch/cris/arch-v32/boot/Image Kernel: arch/cris/arch-v32/boot/Image is ready GZIP arch/cris/arch-v32/boot/compressed/piggy.gz AS arch/cris/arch-v32/boot/compressed/head.o crisv32-axis-linux-gnu-...
```diff diff --git a/arch/cris/arch-v32/boot/compressed/Makefile b/arch/cris/arch-v32/boot/compressed/Makefile index 5a1b31c99eaa..e176b8b69d92 100644 --- a/arch/cris/arch-v32/boot/compressed/Makefile +++ b/arch/cris/arch-v32/boot/compressed/Makefile @@ -2,9 +2,9 @@ # arch/cris/arch-v32/boot/compressed/Makefile # -...
59b97760771143a2e4221df1c517f915cdb303f7
Analyze and fix the following issue in the Linux kernel code: BUG to BUG_ON changes
Problem Details: Signed-off-by: Stoyan Gaydarov <stoyboyker@gmail.com> Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com>
```diff diff --git a/arch/cris/mm/init.c b/arch/cris/mm/init.c index 2fdd212eb250..514f46a4b230 100644 --- a/arch/cris/mm/init.c +++ b/arch/cris/mm/init.c @@ -25,8 +25,7 @@ mem_init(void) int codesize, reservedpages, datasize, initsize; unsigned long tmp; - if(!mem_map) - BUG(); + BUG_ON(!mem_map); /* max/mi...
225feded89d447c2ab76e38e67ef56860c5bb60f
Analyze and fix the following issue in the Linux kernel code: udf: Some type fixes and cleanups
Problem Details: Make udf_check_valid() return 1 if the validity check passed and 0 otherwise. So far it was the other way around which was a bit confusing. Also make udf_vrs() return loff_t which is really the type it should return (not int). Signed-off-by: Jan Kara <jack@suse.cz>
```diff diff --git a/fs/udf/super.c b/fs/udf/super.c index f8fece43f6c6..f4ef5560675f 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c @@ -83,8 +83,6 @@ static int udf_fill_super(struct super_block *, void *, int); static void udf_put_super(struct super_block *); static void udf_write_super(struct super_block *); st...
1197e4dfcf4ac17d763a59e5de1d4d4b9781a555
Analyze and fix the following issue in the Linux kernel code: udf: use hardware sector size
Problem Details: This patch makes the UDF FS driver use the hardware sector size as the default logical block size, which is required by the UDF specifications. While the previous default of 2048 bytes was correct for optical disks, it was not for hard disks or USB storage devices, and made it impossible to use such a ...
```diff diff --git a/fs/udf/super.c b/fs/udf/super.c index 36a467ca1622..f8fece43f6c6 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c @@ -86,7 +86,6 @@ static int udf_remount_fs(struct super_block *, int *, char *); static int udf_check_valid(struct super_block *, int, int); static int udf_vrs(struct super_block *sb...