id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
59cd0cbc75367b82f704f63b104117462275060d
Analyze and fix the following issue in the Linux kernel code: Fix race between proc_readdir and remove_proc_entry
Problem Details: Fix the following race: proc_readdir remove_proc_entry ============ ================= spin_lock(&proc_subdir_lock); [choose PDE to start filldir from] spin_unlock(&proc_subdir_lock); spin_lock(&proc_subdir_lock); [find PDE] [free PDE, refcount is 0] spin_unlock(&proc_subdir_...
```diff diff --git a/fs/proc/generic.c b/fs/proc/generic.c index 22a08ff3475d..8a40e15f5ecb 100644 --- a/fs/proc/generic.c +++ b/fs/proc/generic.c @@ -478,14 +478,21 @@ int proc_readdir(struct file * filp, } do { + struct proc_dir_entry *next; + /* filldir passes info to user space */ + de_get(de);...
7695650a924a6859910c8c19dfa43b4d08224d66
Analyze and fix the following issue in the Linux kernel code: Fix race between proc_get_inode() and remove_proc_entry()
Problem Details: proc_lookup remove_proc_entry =========== ================= lock_kernel(); spin_lock(&proc_subdir_lock); [find PDE with refcount 0] spin_unlock(&proc_subdir_lock); spin_lock(&proc_subdir_lock); [find PDE with refcount 0] [check refcount and free PDE] spin_unlock(&proc_subdir_...
```diff diff --git a/fs/proc/generic.c b/fs/proc/generic.c index 775fb21294d8..22a08ff3475d 100644 --- a/fs/proc/generic.c +++ b/fs/proc/generic.c @@ -398,6 +398,7 @@ struct dentry *proc_lookup(struct inode * dir, struct dentry *dentry, struct nam if (!memcmp(dentry->d_name.name, de->name, de->namelen)) { unsi...
fedee54d8f12cdfde299f181fec5c62b0c647ad6
Analyze and fix the following issue in the Linux kernel code: ext3: dirindex error pointer issues
Problem Details: - ext3_dx_find_entry() exit with out setting proper error pointer - do_split() exit with out setting proper error pointer it is realy painful because many callers contain folowing code: de = do_split(handle,dir, &bh, frame, &hinfo, &retval); if (!(de)) ret...
```diff diff --git a/fs/ext3/namei.c b/fs/ext3/namei.c index 49159f13cc1f..7edb617fd33d 100644 --- a/fs/ext3/namei.c +++ b/fs/ext3/namei.c @@ -969,6 +969,7 @@ static struct buffer_head * ext3_dx_find_entry(struct dentry *dentry, (block<<EXT3_BLOCK_SIZE_BITS(sb)) +((char *)de - bh->b_data))) { brelse...
e3222c4ecc649c4ae568e61dda9349482401b501
Analyze and fix the following issue in the Linux kernel code: Merge sys_clone()/sys_unshare() nsproxy and namespace handling
Problem Details: sys_clone() and sys_unshare() both makes copies of nsproxy and its associated namespaces. But they have different code paths. This patch merges all the nsproxy and its associated namespace copy/clone handling (as much as possible). Posted on container list earlier for feedback. - Create a new nspro...
```diff diff --git a/fs/namespace.c b/fs/namespace.c index fd999cab7b57..be5e56bfb73e 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -1441,10 +1441,9 @@ dput_out: * Allocate a new namespace structure and populate it with contents * copied from the namespace of the passed in task structure. */ -struct mnt_nam...
4fc75ff4816c3483b4b772b2f6cb3d8fd88ca547
Analyze and fix the following issue in the Linux kernel code: exec: fix remove_arg_zero
Problem Details: Petr Tesarik discovered a problem in remove_arg_zero(). He writes: When a script is loaded, load_script() replaces argv[0] with the name of the interpreter and the filename passed to the exec syscall. However, there is no guarantee that the length of the interpreter name plus the length of the fil...
```diff diff --git a/fs/exec.c b/fs/exec.c index 3155e915307a..f1691cd0c9d2 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -982,33 +982,51 @@ void compute_creds(struct linux_binprm *bprm) task_unlock(current); security_bprm_post_apply_creds(bprm); } - EXPORT_SYMBOL(compute_creds); +/* + * Arguments are '\0' separate...
ee527cd3a20c2aeaac17d939e5d011f7a76d69f5
Analyze and fix the following issue in the Linux kernel code: Use stop_machine_run in the Intel RNG driver
Problem Details: Replace call_smp_function with stop_machine_run in the Intel RNG driver. CPU A has done read_lock(&lock) CPU B has done write_lock_irq(&lock) and is waiting for A to release the lock. A third CPU calls call_smp_function and issues the IPI. CPU A takes CPU C's IPI. CPU B is waiting with interrupts d...
```diff diff --git a/drivers/char/hw_random/intel-rng.c b/drivers/char/hw_random/intel-rng.c index cc1046e6ee02..4ae9811d1a6c 100644 --- a/drivers/char/hw_random/intel-rng.c +++ b/drivers/char/hw_random/intel-rng.c @@ -24,10 +24,11 @@ * warranty of any kind, whether express or implied. */ -#include <linux/module....
c761c84154dcd952182e4867d841298c9eb0b14b
Analyze and fix the following issue in the Linux kernel code: kconfig: centralize the selection of semaphore debugging in lib/Kconfig.debug
Problem Details: Remove the Kconfig selection of semaphore debugging from the ALPHA and FRV Kconfig files, and centralize it in lib/Kconfig.debug. There doesn't seem to be much point in letting individual architectures independently define the same Kconfig option when it can just as easily be put in a single Kconfig f...
```diff diff --git a/arch/alpha/Kconfig.debug b/arch/alpha/Kconfig.debug index 36d0106c32eb..f45f28cc10da 100644 --- a/arch/alpha/Kconfig.debug +++ b/arch/alpha/Kconfig.debug @@ -16,14 +16,6 @@ config DEBUG_RWLOCK too many attempts. If you suspect a rwlock problem or a kernel hacker asks for this option then s...
ee7b9e3706b9c5f90113eb16a1a84a1c01e09f95
Analyze and fix the following issue in the Linux kernel code: Fix compilation of drivers with -O0
Problem Details: It is sometimes useful to compile individual drivers with optimization disabled for easier debugging. Currently drivers which use htonl() and similar functions don't compile with -O0. This patch fixes it. It also removes obsolete and misleading comments. This header is not for userspace, so we don'...
```diff diff --git a/include/linux/byteorder/generic.h b/include/linux/byteorder/generic.h index e86e4a938373..3dc715b02500 100644 --- a/include/linux/byteorder/generic.h +++ b/include/linux/byteorder/generic.h @@ -124,19 +124,8 @@ #define be32_to_cpus __be32_to_cpus #define cpu_to_be16s __cpu_to_be16s #define be16_...
b2ead6e012e2b2ab31851c288e0dd7872884a8a3
Analyze and fix the following issue in the Linux kernel code: fix section mismatch warning in lib/swiotlb.c
Problem Details: kbuild spits outs following warning on a defconfig x86_64 build: WARNING: swiotlb.o - Section mismatch: reference to .init.text:swiotlb_init from __ksymtab between '__ksymtab_swiotlb_init' (at offset 0xa0) and '__ksymtab_swiotlb_free_coherent' This warning happens because the function swiotlb_init is ...
```diff diff --git a/lib/swiotlb.c b/lib/swiotlb.c index 9970e55c90bd..10c13ad0d82d 100644 --- a/lib/swiotlb.c +++ b/lib/swiotlb.c @@ -778,7 +778,6 @@ swiotlb_dma_supported(struct device *hwdev, u64 mask) return virt_to_bus(io_tlb_end - 1) <= mask; } -EXPORT_SYMBOL(swiotlb_init); EXPORT_SYMBOL(swiotlb_map_single)...
2d3466a348a61c4d7f958ce80020eba17c09d7f7
Analyze and fix the following issue in the Linux kernel code: reiserfs: possible null pointer dereference during resize
Problem Details: sb_read may return NULL, let's explicitly check it. If so free new bitmap blocks array, after this we may safely exit as it done above during bitmap allocation. Signed-off-by: Dmitriy Monakhov <dmonakhov@openvz.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvald...
```diff diff --git a/fs/reiserfs/resize.c b/fs/reiserfs/resize.c index 315684793d1d..976cc7887a0d 100644 --- a/fs/reiserfs/resize.c +++ b/fs/reiserfs/resize.c @@ -131,6 +131,10 @@ int reiserfs_resize(struct super_block *s, unsigned long block_count_new) /* don't use read_bitmap_block since it will cache * the ...
82f703bb8cb2732b4437a9f555a1be564e9e71c2
Analyze and fix the following issue in the Linux kernel code: freevxfs: possible null pointer dereference fix
Problem Details: sb_read may return NULL, so let's explicitly check it. Signed-off-by: Dmitriy Monakhov <dmonakhov@openvz.org> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/fs/freevxfs/vxfs_bmap.c b/fs/freevxfs/vxfs_bmap.c index 2d71128bd8d6..f86fd3cacd5a 100644 --- a/fs/freevxfs/vxfs_bmap.c +++ b/fs/freevxfs/vxfs_bmap.c @@ -137,7 +137,7 @@ vxfs_bmap_indir(struct inode *ip, long indir, int size, long block) bp = sb_bread(ip->i_sb, indir + (i / VXFS_TYPED_PER...
8e2c20023f34b652605a5fb7c68bb843d2b100a8
Analyze and fix the following issue in the Linux kernel code: Fix constant folding and poor optimization in byte swapping code
Problem Details: Constant folding does not work for the swabXX() byte swapping functions, and the C versions optimize poorly. Attempting to initialize a global variable to swab16(0x1234) or put something like "case swab32(42):" in a switch statement will not compile. It can work, swab.h just isn't doing it correctly. ...
```diff diff --git a/include/linux/byteorder/swab.h b/include/linux/byteorder/swab.h index 25f7f32883ec..142134ff1645 100644 --- a/include/linux/byteorder/swab.h +++ b/include/linux/byteorder/swab.h @@ -10,6 +10,10 @@ * separated swab functions from cpu_to_XX, * to clean up support for bizarre-endian architec...
d52b908646b88cb1952ab8c9b2d4423908a23f11
Analyze and fix the following issue in the Linux kernel code: fix quadratic behavior of shrink_dcache_parent()
Problem Details: The time shrink_dcache_parent() takes, grows quadratically with the depth of the tree under 'parent'. This starts to get noticable at about 10,000. These kinds of depths don't occur normally, and filesystems which invoke shrink_dcache_parent() via d_invalidate() seem to have other depth dependent tim...
```diff diff --git a/fs/dcache.c b/fs/dcache.c index d1bf5d8aeb5a..681cab81b454 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -121,6 +121,28 @@ static void dentry_iput(struct dentry * dentry) } } +/** + * d_kill - kill dentry and return parent + * @dentry: dentry to kill + * + * Called with dcache_lock and d_lock,...
97dc32cdb1b53832801159d5f634b41aad9d0a23
Analyze and fix the following issue in the Linux kernel code: reduce size of task_struct on 64-bit machines
Problem Details: This past week I was playing around with that pahole tool (http://oops.ghostprotocols.net:81/acme/dwarves/) and looking at the size of various struct in the kernel. I was surprised by the size of the task_struct on x86_64, approaching 4K. I looked through the fields in task_struct and found that a nu...
```diff diff --git a/fs/proc/array.c b/fs/proc/array.c index 07c9cdbcdcac..74f30e0c0381 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c @@ -410,9 +410,9 @@ static int do_task_stat(struct task_struct *task, char * buffer, int whole) /* convert nsec -> ticks */ start_time = nsec_to_clock_t(start_time); - res = s...
4d7bf11d649c72621ca31b8ea12b9c94af380e63
Analyze and fix the following issue in the Linux kernel code: ext2/3/4: fix file date underflow on ext2 3 filesystems on 64 bit systems
Problem Details: Taken from http://bugzilla.kernel.org/show_bug.cgi?id=5079 signed long ranges from -2.147.483.648 to 2.147.483.647 on x86 32bit 10000011110110100100111110111101 .. -2,082,844,739 10000011110110100100111110111101 .. 2,212,122,557 <- this currently gets stored on the disk but when converting it to a 6...
```diff diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c index dd4e14c221e0..9fa1bd65a028 100644 --- a/fs/ext2/inode.c +++ b/fs/ext2/inode.c @@ -1079,9 +1079,9 @@ void ext2_read_inode (struct inode * inode) } inode->i_nlink = le16_to_cpu(raw_inode->i_links_count); inode->i_size = le32_to_cpu(raw_inode->i_size); - i...
f1adc05e77383017bc63ea9c48ba217da76682b8
Analyze and fix the following issue in the Linux kernel code: uml: hostfs style fixes
Problem Details: hostfs needed some style goodness. Signed-off-by: Jeff Dike <jdike@linux.intel.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/fs/hostfs/hostfs.h b/fs/hostfs/hostfs.h index d8850c701564..06e5930515fe 100644 --- a/fs/hostfs/hostfs.h +++ b/fs/hostfs/hostfs.h @@ -87,14 +87,3 @@ extern int do_statfs(char *root, long *bsize_out, long long *blocks_out, long *spare_out); #endif - -/* - * Overrides for Emacs so that we ...
72280ede316911fd5a82ef78d12a6705b1007d36
Analyze and fix the following issue in the Linux kernel code: Add white list into modpost.c for memory hotplug code and ia64's machvec section
Problem Details: This patch is add white list into modpost.c for some functions and ia64's section to fix section mismatchs. sparse_index_alloc() and zone_wait_table_init() calls bootmem allocator at boot time, and kmalloc/vmalloc at hotplug time. If config memory hotplug is on, there are references of bootmem a...
```diff diff --git a/mm/page_alloc.c b/mm/page_alloc.c index fd7745111e16..6fd0b7455b0b 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -2179,7 +2179,7 @@ void __init setup_per_cpu_pageset(void) #endif -static __meminit +static __meminit noinline int zone_wait_table_init(struct zone *zone, unsigned long zon...
a3142c8e1dd57ff48040bdb3478cff9312543dc3
Analyze and fix the following issue in the Linux kernel code: Fix section mismatch of memory hotplug related code.
Problem Details: This is to fix many section mismatches of code related to memory hotplug. I checked compile with memory hotplug on/off on ia64 and x86-64 box. Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-fou...
```diff diff --git a/arch/ia64/mm/discontig.c b/arch/ia64/mm/discontig.c index 872da7a2accd..94844442812a 100644 --- a/arch/ia64/mm/discontig.c +++ b/arch/ia64/mm/discontig.c @@ -693,6 +693,7 @@ void __init paging_init(void) zero_page_memmap_ptr = virt_to_page(ia64_imva(empty_zero_page)); } +#ifdef CONFIG_MEMORY_H...
b46b8f19c9cd435ecac4d9d12b39d78c137ecd66
Analyze and fix the following issue in the Linux kernel code: Increase slab redzone to 64bits
Problem Details: There are two problems with the existing redzone implementation. Firstly, it's causing misalignment of structures which contain a 64-bit integer, such as netfilter's 'struct ipt_entry' -- causing netfilter modules to fail to load because of the misalignment. (In particular, the first check in net/ipv...
```diff diff --git a/include/linux/poison.h b/include/linux/poison.h index 95f518b17684..d93c300a3449 100644 --- a/include/linux/poison.h +++ b/include/linux/poison.h @@ -15,8 +15,8 @@ * Magic nums for obj red zoning. * Placed in the first word before and the first word after an obj. */ -#define RED_INACTIVE 0x5A...
0e17b560985afb5190e859d5d4609237a91bb732
Analyze and fix the following issue in the Linux kernel code: [IA64] - Altix: hotplug after intr redirect can crash system
Problem Details: When redirecting a device interrupt on SN, not all links between platform specific structures are being updated. This can result in a system crash if an interrupt redirection is followed by an unplug of that device. The complete fix also requires a prom update. Though, this patch is backward compatabl...
```diff diff --git a/arch/ia64/sn/kernel/irq.c b/arch/ia64/sn/kernel/irq.c index 8d2a1bfbfe7c..7f6d2360a262 100644 --- a/arch/ia64/sn/kernel/irq.c +++ b/arch/ia64/sn/kernel/irq.c @@ -59,6 +59,22 @@ void sn_intr_free(nasid_t local_nasid, int local_widget, (u64) sn_irq_info->irq_cookie, 0, 0); } +u64 sn_intr_redir...
821de3a27bf33f11ec878562577c586cd5f83c64
Analyze and fix the following issue in the Linux kernel code: [PATCH] ll_rw_blk: fix missing bounce in blk_rq_map_kern()
Problem Details: I think we might just need the blk_map_kern users now. For the async execute I added the bounce code already and the block SG_IO has it atleady. I think the blk_map_kern bounce code got dropped because we thought the correct gfp_t would be passed in. But I think all we need is the patch below and all t...
```diff diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c index 5873861e1dbb..d99d402953a3 100644 --- a/block/ll_rw_blk.c +++ b/block/ll_rw_blk.c @@ -2558,6 +2558,7 @@ int blk_rq_map_kern(request_queue_t *q, struct request *rq, void *kbuf, bio->bi_rw |= (1 << BIO_RW); blk_rq_bio_prep(q, rq, bio); + blk_queue_bo...
ca2d02c2f9ea476062ae181eec60b8bcd97857d6
Analyze and fix the following issue in the Linux kernel code: [SCSI] zfcp: rework request ID management.
Problem Details: Simplify request ID management and make sure that frequently used functions are inlined. Also fix a memory leak in zfcp_adapter_enqueue() which only gets hit in error handling. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Swen Schillig <swen@vnet.ibm.com> Signed-off-by: Jam...
```diff diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c index 49d5fc729bef..324899c96efe 100644 --- a/drivers/s390/scsi/zfcp_aux.c +++ b/drivers/s390/scsi/zfcp_aux.c @@ -118,97 +118,32 @@ _zfcp_hex_dump(char *addr, int count) #define ZFCP_LOG_AREA ZFCP_LOG_AREA_FSF -static int zfcp_reqli...
5f852be9e11d62223ea063f6ceed4f9677f54051
Analyze and fix the following issue in the Linux kernel code: [SCSI] zfcp: Fix deadlock between zfcp ERP and SCSI
Problem Details: The SCSI stack requires low level drivers to register and unregister devices. For zfcp this leads to the situation where zfcp calls the SCSI stack, the SCSI tries to scan the new device and the scan SCSI command fails. This would require the zfcp erp, but the erp thread is already blocked in the regist...
```diff diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c index ec3f664f6c80..49d5fc729bef 100644 --- a/drivers/s390/scsi/zfcp_aux.c +++ b/drivers/s390/scsi/zfcp_aux.c @@ -913,6 +913,8 @@ zfcp_unit_enqueue(struct zfcp_port *port, fcp_lun_t fcp_lun) unit->sysfs_device.release = zfcp_sysfs_unit_r...
801e0ced1891a2b8cad1a435c45234a719b3b6bf
Analyze and fix the following issue in the Linux kernel code: [SCSI] zfcp: Locking for req_no and req_seq_no
Problem Details: There is a possible race condition while generating the unique request ids and sequence numbers. Both might be read at the same time and have the same value. Fix this by serializing the access through the queue lock of the adapter: First call zfcp_fsf_req_sbal_get that acquires the lock, then read and ...
```diff diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index f120b16c77d5..07094c3dc341 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c @@ -4645,23 +4645,22 @@ zfcp_fsf_req_create(struct zfcp_adapter *adapter, u32 fsf_cmd, int req_flags, fsf_req->adapter = adapte...
84a3c97b93ec5b4509637801a703693bb710cd4c
Analyze and fix the following issue in the Linux kernel code: [SCSI] megaraid: fix warnings when CONFIG_PROC_FS=n
Problem Details: drivers/scsi/megaraid.c: In function 'megaraid_probe_one': drivers/scsi/megaraid.c:4893: warning: implicit declaration of function 'mega_create_proc_entry' drivers/scsi/megaraid.c: In function 'megaraid_remove_one': drivers/scsi/megaraid.c:4968: warning: unused variable 'buf' Fix by adding #defines S...
```diff diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c index 7fc6e06ea7e1..65bc130430e2 100644 --- a/drivers/scsi/megaraid.c +++ b/drivers/scsi/megaraid.c @@ -3177,7 +3177,10 @@ proc_rdrv(adapter_t *adapter, char *page, int start, int end ) return len; } - +#else +static inline void mega_create_pro...
474d00a8912f56241cec6e1832ce390e87bfb243
Analyze and fix the following issue in the Linux kernel code: hwmon/w83781d: Clean up conversion macros
Problem Details: * Fix voltage rounding * Drop useless macros * Drop useless casts * Turn macros evaluating their parameters more than once into inline functions * Use signed variables for temperatures Signed-off-by: Jean Delvare <khali@linux-fr.org>
```diff diff --git a/drivers/hwmon/w83781d.c b/drivers/hwmon/w83781d.c index 96338ddd74a7..4f93d79a4308 100644 --- a/drivers/hwmon/w83781d.c +++ b/drivers/hwmon/w83781d.c @@ -164,12 +164,9 @@ static const u8 BIT_SCFG2[] = { 0x10, 0x20, 0x40 }; #define W83781D_REG_RT_IDX 0x50 #define W83781D_REG_RT_VAL 0x51 -/* Co...
63232dcd555d60d70ce8e09b53c8ef8e4a49a3f9
Analyze and fix the following issue in the Linux kernel code: hwmon/ams: Fix I2C read retry logic
Problem Details: Fix sleep and retry logic in ams-i2c. Signed-off-by: Stelian Pop <stelian@popies.net> Signed-off-by: Jean Delvare <khali@linux-fr.org>
```diff diff --git a/drivers/hwmon/ams/ams-i2c.c b/drivers/hwmon/ams/ams-i2c.c index 485d333bcb3e..5c70f2e3022e 100644 --- a/drivers/hwmon/ams/ams-i2c.c +++ b/drivers/hwmon/ams/ams-i2c.c @@ -85,17 +85,17 @@ static int ams_i2c_write(u8 reg, u8 value) static int ams_i2c_cmd(enum ams_i2c_cmd cmd) { s32 result; - int r...
4efb4482729d2cc7926f49f997a28370e701073f
Analyze and fix the following issue in the Linux kernel code: [ARM] Shut up warning about init_thread_union
Problem Details: Fix false warning: WARNING: arch/arm/kernel/init_task.o - Section mismatch: reference to .init.task:init_thread_union from .data between 'init_task' (at offset 0x4) and 'init_sighand' caused by the section name starting with ".init". Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
```diff diff --git a/arch/arm/kernel/init_task.c b/arch/arm/kernel/init_task.c index a00cca0000bd..bd4ef53bc6b9 100644 --- a/arch/arm/kernel/init_task.c +++ b/arch/arm/kernel/init_task.c @@ -31,7 +31,7 @@ EXPORT_SYMBOL(init_mm); * The things we do for performance.. */ union thread_union init_thread_union - __attri...
9ae9d68cbf3fe0ec17c17c9ecaa2188ffb854a66
Analyze and fix the following issue in the Linux kernel code: [PATCH] splice(): fix interaction with readahead
Problem Details: Eric Dumazet, thank you for disclosing this bug. Readahead logic somehow fails to populate the page range with data. It can be because 1) the readahead routine is not always called in the following lines of fs/splice.c: if (!loff || nr_pages > 1) page_cache_readahead(mapping,...
```diff diff --git a/fs/splice.c b/fs/splice.c index 5428b0ff3b6f..2282650bdbe8 100644 --- a/fs/splice.c +++ b/fs/splice.c @@ -378,10 +378,11 @@ __generic_file_splice_read(struct file *in, loff_t *ppos, * If in nonblock mode then dont block on waiting * for an in-flight io page */ - if (flags & SPLICE_...
e824f7836de25b1c2f659a2412d32227f1f68bcb
Analyze and fix the following issue in the Linux kernel code: [netdrvr] atl1: fix build
Problem Details: We need linux/pci.h. Signed-off-by: Jeff Garzik <jeff@garzik.org>
```diff diff --git a/drivers/net/atl1/atl1_param.c b/drivers/net/atl1/atl1_param.c index 324f9f0ece99..4246bb9bd50e 100644 --- a/drivers/net/atl1/atl1_param.c +++ b/drivers/net/atl1/atl1_param.c @@ -23,6 +23,7 @@ #include <linux/types.h> #include <linux/moduleparam.h> +#include <linux/pci.h> #include "atl1.h" /...
ceb51361370c003e13f782edb7171a8383e5c849
Analyze and fix the following issue in the Linux kernel code: pasemi_mac: Add msglevel support and "debug" module param
Problem Details: Add msglevel support for pasemi_mac. Move the MODULE_* defines to the top to go together with the variable (similar to tg3). Signed-off-by: Olof Johansson <olof@lixom.net> Signed-off-by: Jeff Garzik <jeff@garzik.org>
```diff diff --git a/drivers/net/pasemi_mac.c b/drivers/net/pasemi_mac.c index 6b4e925aa7f1..4c6d34d6989c 100644 --- a/drivers/net/pasemi_mac.c +++ b/drivers/net/pasemi_mac.c @@ -53,6 +53,16 @@ #define RX_RING_SIZE 512 #define TX_RING_SIZE 512 +#define DEFAULT_MSG_ENABLE \ + (NETIF_MSG_DRV | \ + NETIF_MSG_PROBE...
cfa8007d5cee58d2c2121b7d00077c6f10969cb7
Analyze and fix the following issue in the Linux kernel code: pasemi_mac: Minor cleanup / define fixes
Problem Details: * Remove some unused defines * Fix a couple of wrong chip register defines, and add a few more fields that might be used in the near future. Signed-off-by: Olof Johansson <olof@lixom.net> Signed-off-by: Jeff Garzik <jeff@garzik.org>
```diff diff --git a/drivers/net/pasemi_mac.c b/drivers/net/pasemi_mac.c index 216bb4a2c633..f18fd07973b1 100644 --- a/drivers/net/pasemi_mac.c +++ b/drivers/net/pasemi_mac.c @@ -61,12 +61,6 @@ #define BUF_SIZE 1646 /* 1500 MTU + ETH_HLEN + VLAN_HLEN + 2 64B cachelines */ -/* XXXOJN these should come out of the de...
6dfa7522d8b08c887bf9f4cb2600b89232f132f5
Analyze and fix the following issue in the Linux kernel code: pasemi_mac: Timer and interrupt fixes
Problem Details: Timer and interrupt fixes: * Be pickier with what kind of interrupts are acked to avoid the device to get out of sync with the driver state * Set RX count threshhold to 1 (for NAPI interrupted mode), TX count threshold to 32. * Set timer thresholds to current max (~16ms). Signed-off-by: Olof Joha...
```diff diff --git a/drivers/net/pasemi_mac.c b/drivers/net/pasemi_mac.c index 73e79f35a428..2bf13cf55358 100644 --- a/drivers/net/pasemi_mac.c +++ b/drivers/net/pasemi_mac.c @@ -526,18 +526,28 @@ static irqreturn_t pasemi_mac_rx_intr(int irq, void *data) struct pasemi_mac *mac = netdev_priv(dev); unsigned int reg;...
1b0335ea30bf85eecffd21be64b7653407d6259a
Analyze and fix the following issue in the Linux kernel code: pasemi_mac: Abstract and fix up interrupt restart routines
Problem Details: Abstract out (and fix up) the interrupt restart routines, making sure we start out in a consistent state. Signed-off-by: Olof Johansson <olof@lixom.net> Signed-off-by: Jeff Garzik <jeff@garzik.org>
```diff diff --git a/drivers/net/pasemi_mac.c b/drivers/net/pasemi_mac.c index c7995d77ccfc..73e79f35a428 100644 --- a/drivers/net/pasemi_mac.c +++ b/drivers/net/pasemi_mac.c @@ -362,6 +362,42 @@ static void pasemi_mac_replenish_rx_ring(struct net_device *dev) mac->rx->next_to_fill += count; } +static void pasemi_...
771f7404a9deca902594823d616cd7a84f827982
Analyze and fix the following issue in the Linux kernel code: pasemi_mac: Move the IRQ mapping from the PCI layer to the driver
Problem Details: Fixes for ethernet IRQ mapping, to be done in the driver instead of in the platform setup code. Signed-off-by: Olof Johansson <olof@lixom.net> Signed-off-by: Jeff Garzik <jeff@garzik.org>
```diff diff --git a/arch/powerpc/platforms/pasemi/pci.c b/arch/powerpc/platforms/pasemi/pci.c index 056243da360b..bbc6dfcfaa91 100644 --- a/arch/powerpc/platforms/pasemi/pci.c +++ b/arch/powerpc/platforms/pasemi/pci.c @@ -173,19 +173,6 @@ static void __init pas_fixup_phb_resources(void) } -void __devinit pas_pci_...
d2ada5597d33a9108acb2caf912f85cbc9caab1e
Analyze and fix the following issue in the Linux kernel code: Input: i8042 - fix AUX port detection with some chips
Problem Details: The i8042 driver fails detection of the AUX port with some chips, because they apparently do not change the I8042_CTR_AUXDIS bit immediately. This is known to affect at least HP500/HP510 notebooks, consequently the built-in touchpad will not work. The patch will simply reread the value until it gets th...
```diff diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c index 7c17377a65b9..3888dc307e0c 100644 --- a/drivers/input/serio/i8042.c +++ b/drivers/input/serio/i8042.c @@ -526,6 +526,33 @@ static irqreturn_t __devinit i8042_aux_test_irq(int irq, void *dev_id) return IRQ_HANDLED; } +/* + * i8042_...
8bc354730bc877ebdf35c692460b01e624934aea
Analyze and fix the following issue in the Linux kernel code: AT91RM9200 Ethernet: Fix multicast addressing
Problem Details: The order that the two 32-bit words written to the Hash Address (Low, High) Registers for matching of multicast addresses is incorrect. Signed-off-by: Lars Reemts <Lars.Reemts@entwicklung.eq-3.de> Signed-off-by: Andrew Victor <andrew@sanpeople.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
```diff diff --git a/drivers/net/arm/at91_ether.c b/drivers/net/arm/at91_ether.c index b9cb5cb4d97f..ef2cc80256a3 100644 --- a/drivers/net/arm/at91_ether.c +++ b/drivers/net/arm/at91_ether.c @@ -571,8 +571,8 @@ static void at91ether_sethashtable(struct net_device *dev) mc_filter[bitnr >> 5] |= 1 << (bitnr & 31); }...
0b45d18643f0a3eab09616b8a1283b013a7417ea
Analyze and fix the following issue in the Linux kernel code: PCMCIA-NETDEV : xirc2ps_cs: bugfix of multicast code
Problem Details: Dear Jeff Subject: [PATCH] xirc2ps_cs: bugfix of multicast code Signed-off-by: Komuro <komurojun-mbn@nifty.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
```diff diff --git a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c index 809ec440b8eb..258d6f396186 100644 --- a/drivers/net/pcmcia/xirc2ps_cs.c +++ b/drivers/net/pcmcia/xirc2ps_cs.c @@ -1420,7 +1420,7 @@ set_addresses(struct net_device *dev) kio_addr_t ioaddr = dev->base_addr; local_info_...
44a1d2e5c5c935fff3a093a1bcede32912c76421
Analyze and fix the following issue in the Linux kernel code: sky2: re-enable 88E8056 for most motherboards
Problem Details: This fixes the regression in 2.6.21 for users with 88e8056 on motherboard. Allow all but the Gigabyte motherboard has some unresolved bus problems. Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
```diff diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index 238c2ca34da6..a307310f13f5 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c @@ -124,10 +124,7 @@ static const struct pci_device_id sky2_id_table[] = { { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4361) }, /* 88E8050 */ { PCI_DEVICE(PCI_VENDOR_ID_MA...
f0e93c10faf08e8840a0b7a44abccb520ead12df
Analyze and fix the following issue in the Linux kernel code: ne: Misc fixes for platform driver.
Problem Details: Miscellaneous fixes to make ne platform driver work properly. * Make ioaddr 'unsigned long'. * Move a printk down to show dev->name assigned in register_netdev. Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Signed-off-by: Jeff Garzik <jeff@garzik.org>
```diff diff --git a/drivers/net/ne.c b/drivers/net/ne.c index aef470d6b9ab..32ae91b0b611 100644 --- a/drivers/net/ne.c +++ b/drivers/net/ne.c @@ -147,7 +147,7 @@ bad_clone_list[] __initdata = { # define DCR_VAL 0x49 #endif -static int ne_probe1(struct net_device *dev, int ioaddr); +static int ne_probe1(struct net...
42b1c8cc25f6a5ecbd43f9d66e8b8b7ec25b7d9d
Analyze and fix the following issue in the Linux kernel code: libertas: fix for wireless Kconfig changes
Problem Details: Need to change the libertas Kconfig entry to match changes made for other wireless drivers. Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
```diff diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig index 0184614517f9..e273347dc606 100644 --- a/drivers/net/wireless/Kconfig +++ b/drivers/net/wireless/Kconfig @@ -267,7 +267,7 @@ config IPW2200_DEBUG config LIBERTAS_USB tristate "Marvell Libertas 8388 802.11a/b/g cards" - depends on...
ab13a18a3c8cc5a386ae8c74d53ed5ca0b0ec7bb
Analyze and fix the following issue in the Linux kernel code: atl1: fix whitespace damage
Problem Details: Remove trailing whitespace and spaces preceding tabs. Signed-off-by: Jay Cliburn <jacliburn@bellsouth.net> Signed-off-by: Jeff Garzik <jeff@garzik.org>
```diff diff --git a/drivers/net/atl1/atl1_hw.c b/drivers/net/atl1/atl1_hw.c index 5b9dd3c1e84b..ef886bdeac13 100644 --- a/drivers/net/atl1/atl1_hw.c +++ b/drivers/net/atl1/atl1_hw.c @@ -2,20 +2,20 @@ * Copyright(c) 2005 - 2006 Attansic Corporation. All rights reserved. * Copyright(c) 2006 Chris Snook <csnook@redha...
1e0063645ef1e89c63778fbb0417e79b7dc65b5f
Analyze and fix the following issue in the Linux kernel code: atl1: use dev_printk macros
Problem Details: Use dev_printk macros for PCI related errors, warnings, debug and info console messages. Signed-off-by: Jay Cliburn <jacliburn@bellsouth.net> Signed-off-by: Jeff Garzik <jeff@garzik.org>
```diff diff --git a/drivers/net/atl1/atl1_ethtool.c b/drivers/net/atl1/atl1_ethtool.c index c11c27798e5c..1f616c5c1473 100644 --- a/drivers/net/atl1/atl1_ethtool.c +++ b/drivers/net/atl1/atl1_ethtool.c @@ -156,8 +156,7 @@ static int atl1_set_settings(struct net_device *netdev, u16 old_media_type = hw->media_type; ...
88ca2d070c3a169611ec38f00e945a036564ca26
Analyze and fix the following issue in the Linux kernel code: ehea: Fix skb header access
Problem Details: Adapt to new skb header access functions. Signed-off-by: Thomas Klein <tklein@de.ibm.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
```diff diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c index c7a5614e66c0..721164874a80 100644 --- a/drivers/net/ehea/ehea_main.c +++ b/drivers/net/ehea/ehea_main.c @@ -1803,10 +1803,10 @@ static inline int ehea_hash_skb(struct sk_buff *skb, int num_qps) u32 tmp; if ((skb->protocol == ht...
0be4acec829ae37901aea7bd09aca1cea319833a
Analyze and fix the following issue in the Linux kernel code: s390: fix Oops when unloading module netiucv
Problem Details: don't remove an entry from iucv_connection_list in netiucv_exit(). netiucv_free_netdevice is called anyway, which takes care of entry removal. Signed-off-by: Ursula Braun <braunu@de.ibm.com> Signed-off-by: Frank Pavlic <fpavlic@de.ibm.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
```diff diff --git a/drivers/s390/net/netiucv.c b/drivers/s390/net/netiucv.c index e10e85e85c84..c358764f3264 100644 --- a/drivers/s390/net/netiucv.c +++ b/drivers/s390/net/netiucv.c @@ -1862,12 +1862,14 @@ static void netiucv_remove_connection(struct iucv_connection *conn) write_lock_bh(&iucv_connection_rwlock); l...
1a14780960888c97371a9918f42c4dbe6957efb4
Analyze and fix the following issue in the Linux kernel code: Subject: natsemi: Allow users to disable workaround for DspCfg reset
Problem Details: The natsemi driver contains a workaround for broken hardware which can partially reset the chip at unpredictable times, detected by checking for spontaneous changes in the DspCfg register. The effects of the hardware bug appear to be variable and can range from minor problems like small numbers of cor...
```diff diff --git a/drivers/net/natsemi.c b/drivers/net/natsemi.c index 109e80252488..223e0e6264ba 100644 --- a/drivers/net/natsemi.c +++ b/drivers/net/natsemi.c @@ -81,6 +81,8 @@ static const int multicast_filter_limit = 100; Setting to > 1518 effectively disables this feature. */ static int rx_copybreak; +sta...
9fd9f9b669ca71f7b3a7709d02d305c3d428d2fe
Analyze and fix the following issue in the Linux kernel code: DM9000: fix use of kfree() on net device
Problem Details: The DM9000 network driver is calling kfree() on an netdev causing the system to oops if the probe fails. The right thing to do is call free_netdev(). Thanks to Russell King for spotting this. Signed-off-by: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
```diff diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c index 8cc1174e7f64..0e338539b822 100644 --- a/drivers/net/dm9000.c +++ b/drivers/net/dm9000.c @@ -601,7 +601,7 @@ dm9000_probe(struct platform_device *pdev) printk("%s: not found (%d).\n", CARDNAME, ret); dm9000_release_board(pdev, db); - kfree(ndev...
2f76216fe071a67fc110a85a10b1eca038379e11
Analyze and fix the following issue in the Linux kernel code: myri10ge: fix restoring of multicast list after reset
Problem Details: Don't count on whatever implementation artifact preserves the multicast list across a reset cmd, and setup multicast filtering as part of our reset routine. The setting of allmulti when adopting firmware with the rx-filter broadcast bug is also moved into the multicast setup routine where it belongs. ...
```diff diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index b48b988cf87c..3245357a06f2 100644 --- a/drivers/net/myri10ge/myri10ge.c +++ b/drivers/net/myri10ge/myri10ge.c @@ -290,6 +290,8 @@ MODULE_PARM_DESC(myri10ge_wcfifo, "Enable WC Fifo when WC is enabled\n"); #define myri10ge_pio...
0ce68c74162ce288cfd214dd126b8d03b8b7a8ed
Analyze and fix the following issue in the Linux kernel code: pasemi_mac: A couple of minor bugfixes.
Problem Details: Bugfixes: * Move the wake_queue logic from tx_intr to clean_tx * Always do wake_queue even if queue wasn't full before clean since it's safe to do * Fix polarity in checks in pasemi_mac_close Signed-off-by: Olof Johansson <olof@lixom.net> Signed-off-by: Jeff Garzik <jeff@garzik.org>
```diff diff --git a/drivers/net/pasemi_mac.c b/drivers/net/pasemi_mac.c index 76fe9dd8e841..bde833542b6f 100644 --- a/drivers/net/pasemi_mac.c +++ b/drivers/net/pasemi_mac.c @@ -476,6 +476,8 @@ static int pasemi_mac_clean_tx(struct pasemi_mac *mac) mac->tx->next_to_clean += count; spin_unlock_irqrestore(&mac->tx->...
d9b55a03611ff2e2e54fb4e1ad2648d5eb870fa3
Analyze and fix the following issue in the Linux kernel code: [POWERPC] Early serial debug support for PPC44x
Problem Details: This adds support for early serial debugging via the built in port on IBM/AMCC PowerPC 44x CPUs. It uses a bolted TLB entry in address space 1 for the UART's mapping, allowing robust debugging both before and after the initialization of the MMU. Signed-off-by: David Gibson <dwg@au1.ibm.com> Signed-of...
```diff diff --git a/arch/powerpc/Kconfig.debug b/arch/powerpc/Kconfig.debug index 86aa3745af7f..f70e795c262e 100644 --- a/arch/powerpc/Kconfig.debug +++ b/arch/powerpc/Kconfig.debug @@ -139,10 +139,6 @@ config BOOTX_TEXT Say Y here to see progress messages from the boot firmware in text mode. Requires either B...
71dfd5a396d11512aa6c8ed0d35b268bc084bb9b
Analyze and fix the following issue in the Linux kernel code: [XFS] Fix race in xfs_write() b/w dmapi callout and direct I/O checks.
Problem Details: In xfs_write() the iolock is dropped and reacquired in XFS_SEND_DATA() which means that the file could change from not-cached to cached and we need to redo the direct I/O checks. We should also redo the direct I/O checks when the file size changes regardless if O_APPEND is set or not. SGI-PV: 963483 S...
```diff diff --git a/fs/xfs/linux-2.6/xfs_lrw.c b/fs/xfs/linux-2.6/xfs_lrw.c index 82ab792c7fc9..b2a1beb33888 100644 --- a/fs/xfs/linux-2.6/xfs_lrw.c +++ b/fs/xfs/linux-2.6/xfs_lrw.c @@ -724,34 +724,8 @@ start: goto out_unlock_mutex; } - if (ioflags & IO_ISDIRECT) { - xfs_buftarg_t *target = - (xip->i_d.di_fl...
ba87ea699ebd9dd577bf055ebc4a98200e337542
Analyze and fix the following issue in the Linux kernel code: [XFS] Fix to prevent the notorious 'NULL files' problem after a crash.
Problem Details: The problem that has been addressed is that of synchronising updates of the file size with writes that extend a file. Without the fix the update of a file's size, as a result of a write beyond eof, is independent of when the cached data is flushed to disk. Often the file size update would be written to...
```diff diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c index 143ffc851c9d..4475588e973a 100644 --- a/fs/xfs/linux-2.6/xfs_aops.c +++ b/fs/xfs/linux-2.6/xfs_aops.c @@ -140,10 +140,47 @@ xfs_destroy_ioend( mempool_free(ioend, xfs_ioend_pool); } +/* + * Update on-disk file size now that data h...
2a32963130aec5e157b58ff7dfa3dfa1afdf7ca1
Analyze and fix the following issue in the Linux kernel code: [XFS] Fix race condition in xfs_write().
Problem Details: This change addresses a race in xfs_write() where, for direct I/O, the flags need_i_mutex and need_flush are setup before the iolock is acquired. The logic used to setup the flags may change between setting the flags and acquiring the iolock resulting in these flags having incorrect values. For example...
```diff diff --git a/fs/xfs/linux-2.6/xfs_lrw.c b/fs/xfs/linux-2.6/xfs_lrw.c index 8e46c9798fbf..80fe31233471 100644 --- a/fs/xfs/linux-2.6/xfs_lrw.c +++ b/fs/xfs/linux-2.6/xfs_lrw.c @@ -649,7 +649,7 @@ xfs_write( bhv_vrwlock_t locktype; size_t ocount = 0, count; loff_t pos; - int need_i_mutex = 1, need_fl...
e6d29426bc8a5d07d0eebd0842fe0cf6ecc862cd
Analyze and fix the following issue in the Linux kernel code: [XFS] Fix uquota and oquota enforcement problems.
Problem Details: When uquota and oquota (gquota/pquota) are enabled for accounting both are enforced if ether has enforcement active. Conditions: - Both XFS_UQUOTA_ACCT and XFS_GQUOTA_ACCT are enabled. - Either XFS_UQUOTA_ENFD or XFS_OQUOTA_ENFD is enabled. - The usage without enforce is reached at the soft limit. ...
```diff diff --git a/fs/xfs/quota/xfs_qm_syscalls.c b/fs/xfs/quota/xfs_qm_syscalls.c index 22d853e77cda..2df67fd913e5 100644 --- a/fs/xfs/quota/xfs_qm_syscalls.c +++ b/fs/xfs/quota/xfs_qm_syscalls.c @@ -909,14 +909,19 @@ xfs_qm_export_dquot( * gets turned off. No need to confuse the user level code, * so return z...
424ea91ba61c1cdc2dac68576c97030cbf47d84f
Analyze and fix the following issue in the Linux kernel code: [XFS] Fix quotaon syscall failures for group enforcement requests.
Problem Details: xfs_qm_scall_quotaon was incorrectly failing requests to enable group quota enforcement. Fixes logic error in OQUOTA handling. SGI-PV: 961964 SGI-Modid: xfs-linux-melb:xfs-kern:28227a Signed-off-by: Donald Douwsma <donaldd@sgi.com> Signed-off-by: Tim Shimmin <tes@sgi.com>
```diff diff --git a/fs/xfs/quota/xfs_qm_syscalls.c b/fs/xfs/quota/xfs_qm_syscalls.c index 44ab68de971d..22d853e77cda 100644 --- a/fs/xfs/quota/xfs_qm_syscalls.c +++ b/fs/xfs/quota/xfs_qm_syscalls.c @@ -456,9 +456,7 @@ xfs_qm_scall_quotaon( || ((flags & XFS_PQUOTA_ACCT) == 0 && (mp->m_sb.sb_qflags & X...
11fbb00c67e19737757e747ec7dd3ba8d584f5d1
Analyze and fix the following issue in the Linux kernel code: [POWERPC] Cope with PCI host bridge I/O window not starting at 0
Problem Details: Currently our code to set up the data structures for a PCI host bridge and create the mapping for its I/O window assumes that the window starts at I/O port 0 on the PCI side. If this is not true, we can end up with I/O port numbers in the resources for PCI devices which will cause an oops if a driver ...
```diff diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c index 60d7d4baa227..706b7f3da5ff 100644 --- a/arch/powerpc/kernel/pci_64.c +++ b/arch/powerpc/kernel/pci_64.c @@ -1006,8 +1006,9 @@ void __devinit pci_process_bridge_OF_ranges(struct pci_controller *hose, switch ((pci_space >> 24) & 0...
d12db0b08f6c14dfd1438f6f6ad49dcd663c9ae5
Analyze and fix the following issue in the Linux kernel code: Fix bluetooth HCI sysfs compile
Problem Details: More fallout from the removal of "struct subsystem" from the core device model. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/net/bluetooth/hci_sysfs.c b/net/bluetooth/hci_sysfs.c index 359e3440cf29..25835403d659 100644 --- a/net/bluetooth/hci_sysfs.c +++ b/net/bluetooth/hci_sysfs.c @@ -322,7 +322,7 @@ int hci_register_sysfs(struct hci_dev *hdev) if (device_create_file(dev, bt_attrs[i]) < 0) BT_ERR("Failed to creat...
d679f805e7d16291f7671710dd42522561a46611
Analyze and fix the following issue in the Linux kernel code: [SCSI] esp_scsi: Fix section mismatch warnings.
Problem Details: Signed-off-by: Martin Habets <errandir_news@mph.eclipse.co.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/drivers/scsi/esp_scsi.c b/drivers/scsi/esp_scsi.c index 99ce03331b64..ec71061aef61 100644 --- a/drivers/scsi/esp_scsi.c +++ b/drivers/scsi/esp_scsi.c @@ -2212,7 +2212,7 @@ static void __devinit esp_init_swstate(struct esp *esp) } /* This places the ESP into a known state at boot time. */ -stati...
de9f0cf93fcbccc2de4e6bcb5ef90f997616be3b
Analyze and fix the following issue in the Linux kernel code: [VIDEO] sunxvr2500: Fix PCI device ID table.
Problem Details: Noticed by Meelis Roos. Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/drivers/video/sunxvr2500.c b/drivers/video/sunxvr2500.c index 4010492c6920..4316c7fe8e21 100644 --- a/drivers/video/sunxvr2500.c +++ b/drivers/video/sunxvr2500.c @@ -237,14 +237,14 @@ static void __devexit s3d_pci_unregister(struct pci_dev *pdev) } static struct pci_device_id s3d_pci_table[] = ...
0f7ac29e594808eaddb61f17dcd503ad36b3d769
Analyze and fix the following issue in the Linux kernel code: [IA64] Fix some section mismatch errors
Problem Details: Section mismatch: reference to ... .init.text:prefill_possible_map from .text between 'setup_per_cpu_areas' and 'cpu_init' .init.text:iosapic_override_isa_irq from .text between 'iosapic_init' and 'iosapic_remove' Signed-off-by: Tony Luck <tony.luck@intel.com>
```diff diff --git a/arch/ia64/kernel/iosapic.c b/arch/ia64/kernel/iosapic.c index dcfbf3e7a9ef..e87dd93d4db7 100644 --- a/arch/ia64/kernel/iosapic.c +++ b/arch/ia64/kernel/iosapic.c @@ -1013,7 +1013,7 @@ iosapic_register_platform_intr (u32 int_type, unsigned int gsi, /* * ACPI calls this when it finds an entry for ...
0f9008ef38d5a6305d94bbdd8f20d68fc75c63b6
Analyze and fix the following issue in the Linux kernel code: Fix up SLUB compile
Problem Details: The newly merged SLUB allocator patches had been generated before the removal of "struct subsystem", and ended up applying fine, but wouldn't build based on the current tree as a result. Fix up that merge error - not that SLUB is likely really ready for showtime yet, but at least I can fix the trivial...
```diff diff --git a/mm/slub.c b/mm/slub.c index a6323484dd3e..5db3da5a60bf 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -3418,7 +3418,7 @@ static int sysfs_slab_add(struct kmem_cache *s) * This is typically the case for debug situations. In that * case we can catch duplicate names easily. */ - sysfs_remove_l...
35c74823cb382c610be908f1b92f980b84e7c37c
Analyze and fix the following issue in the Linux kernel code: spi_s3c24xx.c: Fix build
Problem Details: Commit a836f5856ae46ccb2464ea76031ea05ae967b832 removes the shutdown member of the bitbang structure, breaking the build of spi_s3c24xx.c. Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Andrew Morton <akpm@linux-f...
```diff diff --git a/drivers/spi/spi_s3c24xx.c b/drivers/spi/spi_s3c24xx.c index b10211c420ef..d5a710f6e445 100644 --- a/drivers/spi/spi_s3c24xx.c +++ b/drivers/spi/spi_s3c24xx.c @@ -342,8 +342,6 @@ static int s3c24xx_spi_probe(struct platform_device *pdev) goto err_register; } - dev_dbg(hw->dev, "shutdown=%d\n"...
09762516761f9346ee521dcab45de0a543298410
Analyze and fix the following issue in the Linux kernel code: rename TANBAC TB0219 config
Problem Details: Rename config for TANBAC TB0219 GPIO support to something more appropriate. Fixes this: drivers/char/Kconfig:906:warning: type of 'TANBAC_TB0219' redefined from 'boolean' to 'tristate' drivers/char/Kconfig:907:warning: choice values currently only support a single prompt Signed-off-by: Yoichi Yuasa ...
```diff diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig index d0c978fbc204..a26d91743b24 100644 --- a/drivers/char/Kconfig +++ b/drivers/char/Kconfig @@ -905,8 +905,8 @@ config SONYPI To compile this driver as a module, choose M here: the module will be called sonypi. -config TANBAC_TB0219 - tristate...
2fda4c90f65fd96ef910ba285d66984caf600a08
Analyze and fix the following issue in the Linux kernel code: ehci-ps3, ohci-ps3: fix compilation
Problem Details: As seen on powerpc-cell et al: CC [M] drivers/usb/host/ehci-hcd.o In file included from drivers/usb/host/ehci-hcd.c:941: drivers/usb/host/ehci-ps3.c:79: error: conflicting types for 'dev_dbg' include/linux/device.h:576: error: previous definition of 'dev_dbg' was here make[4]: *** [drivers/usb/host...
```diff diff --git a/drivers/usb/host/ehci-ps3.c b/drivers/usb/host/ehci-ps3.c index 4d781a2a9807..93107453f124 100644 --- a/drivers/usb/host/ehci-ps3.c +++ b/drivers/usb/host/ehci-ps3.c @@ -73,13 +73,6 @@ static const struct hc_driver ps3_ehci_hc_driver = { #endif }; -#if !defined(DEBUG) -#undef dev_dbg -static in...
f0ac675806441d17303707856f4d23bd27092014
Analyze and fix the following issue in the Linux kernel code: Fix ppp_deflate issues with recent zlib_inflate changes
Problem Details: The last zlib_inflate update broke certain corner cases for ppp_deflate decompression handling. This patch fixes some logic to make things work properly again. Users other than ppp_deflate (the only Z_PACKET_FLUSH user) should be unaffected. Fixes bug 8405 (confirmed by Stefan) Signed-off-by: Richa...
```diff diff --git a/lib/zlib_inflate/inflate.c b/lib/zlib_inflate/inflate.c index fceb97c3aff7..7e1e3114a73e 100644 --- a/lib/zlib_inflate/inflate.c +++ b/lib/zlib_inflate/inflate.c @@ -743,12 +743,14 @@ int zlib_inflate(z_streamp strm, int flush) strm->data_type = state->bits + (state->last ? 64 : 0) + ...
c24228daa1e489721812815838220de607260df9
Analyze and fix the following issue in the Linux kernel code: cx88-video build fix
Problem Details: alpha: drivers/media/video/cx88/cx88-video.c: In function 'cx8800_initdev': drivers/media/video/cx88/cx88-video.c:1782: error: 'DMA_32BIT_MASK' undeclared (first use in this function) drivers/media/video/cx88/cx88-video.c:1782: error: (Each undeclared identifier is reported only once drivers/media/vid...
```diff diff --git a/drivers/media/video/cx88/cx88-alsa.c b/drivers/media/video/cx88/cx88-alsa.c index 3956c257556c..2d666b56020c 100644 --- a/drivers/media/video/cx88/cx88-alsa.c +++ b/drivers/media/video/cx88/cx88-alsa.c @@ -27,6 +27,8 @@ #include <linux/init.h> #include <linux/device.h> #include <linux/interrupt....
c2f239d93e8af991392871c57465cb2ac556b482
Analyze and fix the following issue in the Linux kernel code: uml: fix prototypes
Problem Details: Declare strlcpy and strlcat more correctly. Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Cc: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/arch/um/include/user.h b/arch/um/include/user.h index a6da62608254..d380e6d91a90 100644 --- a/arch/um/include/user.h +++ b/arch/um/include/user.h @@ -14,6 +14,11 @@ */ #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) +/* + * This will provide the size_t definition in both kernel and userspac...
b7ec15bd004f4524bf091f851348da2ccb519e4f
Analyze and fix the following issue in the Linux kernel code: uml: virtualized time fix
Problem Details: With the current timekeeping, !CONFIG_UML_REAL_TIME_CLOCK has inconsistent behavior. Previously, gettimeofday could be (and was) isolated from the clock ticking. Now, it's not, so when CONFIG_UML_REAL_TIME_CLOCK is disabled, gettimeofday must progress in lockstep with the clock, making it fully virtu...
```diff diff --git a/arch/um/kernel/time.c b/arch/um/kernel/time.c index 9fd80ee3eef6..cd7349de8ca6 100644 --- a/arch/um/kernel/time.c +++ b/arch/um/kernel/time.c @@ -34,8 +34,8 @@ unsigned long long sched_clock(void) return (unsigned long long)jiffies_64 * (1000000000 / HZ); } -static unsigned long long prev_nsec...
8603ec81487a5fefbc29611ff0d635b33b6da990
Analyze and fix the following issue in the Linux kernel code: uml: aIO deadlock avoidance
Problem Details: Allow deadlocks to be avoided in the AIO code by setting the pipe to the I/O thread non-blocking. Signed-off-by: Jeff Dike <jdike@linux.intel.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds...
```diff diff --git a/arch/um/os-Linux/aio.c b/arch/um/os-Linux/aio.c index 5d258eb4f506..9bf944f6a1db 100644 --- a/arch/um/os-Linux/aio.c +++ b/arch/um/os-Linux/aio.c @@ -221,6 +221,11 @@ static int init_aio_24(void) aio_req_fd_w = fds[0]; aio_req_fd_r = fds[1]; + + err = os_set_fd_block(aio_req_fd_w, 0); + if(er...
a6ea4cceed18edebe1eb6001cb9e0f88cd741a6c
Analyze and fix the following issue in the Linux kernel code: uml: rename os_{read_write}_file_k back to os_{read_write}_file
Problem Details: Rename os_{read_write}_file_k back to os_{read_write}_file, delete the originals and their bogus infrastructure, and fix all the callers. Signed-off-by: Jeff Dike <jdike@linux.intel.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>...
```diff diff --git a/arch/um/drivers/chan_kern.c b/arch/um/drivers/chan_kern.c index 92e069e8253f..3aa351611763 100644 --- a/arch/um/drivers/chan_kern.c +++ b/arch/um/drivers/chan_kern.c @@ -98,7 +98,7 @@ int generic_read(int fd, char *c_out, void *unused) { int n; - n = os_read_file_k(fd, c_out, sizeof(*c_out)); ...
dc764e5087bceeb26714bb7975b711062b39d804
Analyze and fix the following issue in the Linux kernel code: uml: formatting fixes around os_{read_write}_file callers
Problem Details: Formatting fixes ahead of renaming os_{read_write}_file_k to os_{read_write}_file and fixing all the callers. Signed-off-by: Jeff Dike <jdike@linux.intel.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torval...
```diff diff --git a/arch/um/drivers/chan_user.c b/arch/um/drivers/chan_user.c index d226f103462e..a15be1720e03 100644 --- a/arch/um/drivers/chan_user.c +++ b/arch/um/drivers/chan_user.c @@ -203,14 +203,3 @@ void register_winch(int fd, struct tty_struct *tty) } } } - -/* - * Overrides for Emacs so that we follow ...
ef0470c053274c343b2be8737e0146d65e17f9be
Analyze and fix the following issue in the Linux kernel code: uml: tidy libc code
Problem Details: This patch lays some groundwork for the next one, which converts calls to os_{read,write}_file into {read,write}, by doing some tidying in the affected areas. do_not_aio gets restructured to make the final result a bit cleaner. There are also whitespace and other formatting fixes, fixes in error mess...
```diff diff --git a/arch/um/os-Linux/aio.c b/arch/um/os-Linux/aio.c index 6ff12743a0bd..c1f0f76291cf 100644 --- a/arch/um/os-Linux/aio.c +++ b/arch/um/os-Linux/aio.c @@ -146,28 +146,21 @@ static int aio_thread(void *arg) static int do_not_aio(struct aio_thread_req *req) { char c; + unsigned long long actual; int...
5d86456d3852cb95a38d2b23fe01cede54984ba5
Analyze and fix the following issue in the Linux kernel code: uml: tidy fault code
Problem Details: Tidying in preparation for the segfault register dumping patch which follows. void * pointers are changed to union uml_pt_regs *. This makes the types match reality, except in arch_fixup, which is changed to operate on a union uml_pt_regs. This fixes a bug in the call from segv_handler, which passes...
```diff diff --git a/arch/um/include/arch.h b/arch/um/include/arch.h index 8e11dd7c1adb..10ad52daa8c5 100644 --- a/arch/um/include/arch.h +++ b/arch/um/include/arch.h @@ -9,7 +9,7 @@ #include "sysdep/ptrace.h" extern void arch_check_bugs(void); -extern int arch_fixup(unsigned long address, void *sc_ptr); +extern in...
65a58ab044308ae65ca06c50fb10be5e0e080989
Analyze and fix the following issue in the Linux kernel code: uml: no locking needed in tls.c
Problem Details: Comment the lack of locking on a couple of globals. Also fix the formatting of __setup_host_supports_tls. Signed-off-by: Jeff Dike <jdike@linux.intel.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds ...
```diff diff --git a/arch/um/sys-i386/tls.c b/arch/um/sys-i386/tls.c index 643dab585727..fea8e5e15cc4 100644 --- a/arch/um/sys-i386/tls.c +++ b/arch/um/sys-i386/tls.c @@ -23,9 +23,13 @@ #include "skas.h" #endif -/* If needed we can detect when it's uninitialized. */ +/* + * If needed we can detect when it's uniniti...
57ac895a7f22d235f637317f58a2d9ba6ec91a27
Analyze and fix the following issue in the Linux kernel code: uml: fix umid in xterm titles
Problem Details: Calls lines_init() *after* xterm_title is modified to include umid. Signed-off-by: Davide Brini <davide.brini@unibo.it> Signed-off-by: Jeff Dike <jdike@linux.intel.com> Acked-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-...
```diff diff --git a/arch/um/drivers/ssl.c b/arch/um/drivers/ssl.c index 94faadc5ea1b..fd09ad9e9c0a 100644 --- a/arch/um/drivers/ssl.c +++ b/arch/um/drivers/ssl.c @@ -191,12 +191,12 @@ static int ssl_init(void) ssl_driver = register_lines(&driver, &ssl_ops, serial_lines, ARRAY_SIZE(serial_lines)); - lines_...
36e454630473caa178bcbc4982ed6a68cf002e95
Analyze and fix the following issue in the Linux kernel code: uml: add missing __init declarations
Problem Details: The build started finding calls from non-init to init functions. These are just cases of init functions not being properly marked, so this patch fixes that. Signed-off-by: Jeff Dike <jdike@linux.intel.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@l...
```diff diff --git a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c index 5e93bbf6e482..72ff85693a39 100644 --- a/arch/um/kernel/mem.c +++ b/arch/um/kernel/mem.c @@ -216,7 +216,7 @@ static void __init fixaddr_user_init( void) #endif } -void paging_init(void) +void __init paging_init(void) { unsigned long zones_size...
f34d9d2dcb7f17b64124841345b23adc0843e7a5
Analyze and fix the following issue in the Linux kernel code: uml: network interface hotplug error handling
Problem Details: This fixes a number of problems associated with network interface hotplug. The userspace initialization function can fail in some cases, but the failure was never passed back to eth_configure, which proceeded with the configuration. This results in a zombie device that is present, but can't work. Th...
```diff diff --git a/arch/um/drivers/daemon_user.c b/arch/um/drivers/daemon_user.c index 09d1de90297c..d0b656a517d3 100644 --- a/arch/um/drivers/daemon_user.c +++ b/arch/um/drivers/daemon_user.c @@ -123,7 +123,7 @@ static int connect_to_switch(struct daemon_data *pri) return err; } -static void daemon_user_init(vo...
b16895b63c504698b0c3ab26ca3c41a4fa162a42
Analyze and fix the following issue in the Linux kernel code: uml-driver-formatting-fixes-fix
Problem Details: Cc: Jeff Dike <jdike@addtoit.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/arch/um/drivers/chan_user.c b/arch/um/drivers/chan_user.c index 77d3fdb0c21a..ed24eab647dd 100644 --- a/arch/um/drivers/chan_user.c +++ b/arch/um/drivers/chan_user.c @@ -158,7 +158,7 @@ static int winch_tramp(int fd, struct tty_struct *tty, int *fd_out) */ err = run_helper_thread(winch_thread,...
56bd194bb200ef0c49517de67a7d7f4b043b11b1
Analyze and fix the following issue in the Linux kernel code: uml: driver formatting fixes
Problem Details: Fix a bunch of formatting violations in the drivers: return(n) -> return n whitespace fixes emacs formatting comment removal breaking if(foo) return(n) into two lines There are also a couple of errno use bugs: using errno in a printk when the failure put errno into a local variable saving errno ...
```diff diff --git a/arch/um/drivers/chan_user.c b/arch/um/drivers/chan_user.c index 0cad3546cb89..77d3fdb0c21a 100644 --- a/arch/um/drivers/chan_user.c +++ b/arch/um/drivers/chan_user.c @@ -158,7 +158,7 @@ static int winch_tramp(int fd, struct tty_struct *tty, int *fd_out) */ err = run_helper_thread(winch_thread,...
a5ed1ffa6c2480cdcf3f0aa945f0b8622fe4e90b
Analyze and fix the following issue in the Linux kernel code: uml: formatting fixes
Problem Details: Formatting fixes - style violations whitespace breakage emacs formatting comment removal Signed-off-by: Jeff Dike <jdike@addtoit.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-fou...
```diff diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c index 89c6dba731f8..299d75a41a7f 100644 --- a/arch/um/kernel/um_arch.c +++ b/arch/um/kernel/um_arch.c @@ -63,8 +63,8 @@ struct cpuinfo_um boot_cpu_data = { unsigned long thread_saved_pc(struct task_struct *task) { - return(os_process_pc(CHOOSE...
9b95e43763cfdfebc1318d27e55712e7b6bfe098
Analyze and fix the following issue in the Linux kernel code: swsusp: fix snapshot_release
Problem Details: Remove the leftover enable_nonboot_cpus() from snapshot_release(). Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Cc: Nigel Cunningham <nigel@nigel.suspend2.net> Cc: Pavel Machek <pavel@ucw.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-found...
```diff diff --git a/kernel/power/user.c b/kernel/power/user.c index ad4e10208cde..040560d9c312 100644 --- a/kernel/power/user.c +++ b/kernel/power/user.c @@ -86,7 +86,6 @@ static int snapshot_release(struct inode *inode, struct file *filp) if (data->frozen) { mutex_lock(&pm_mutex); thaw_processes(); - enable_...
b1296cc48b39355241470ef934a5e2270e3f23bd
Analyze and fix the following issue in the Linux kernel code: freezer: fix racy usage of try_to_freeze in kswapd
Problem Details: Currently we can miss freeze_process()->signal_wake_up() in kswapd() if it happens between try_to_freeze() and prepare_to_wait(). To prevent this from happening we should check freezing(current) before calling schedule(). Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Cc: Pavel Machek <pavel@ucw.cz> ...
```diff diff --git a/mm/vmscan.c b/mm/vmscan.c index db023e2ff385..56651a10c366 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -1323,8 +1323,6 @@ static int kswapd(void *p) for ( ; ; ) { unsigned long new_order; - try_to_freeze(); - prepare_to_wait(&pgdat->kswapd_wait, &wait, TASK_INTERRUPTIBLE); new_order...
1525a2ad76f991eba9755f75c9b6d4d97abad25e
Analyze and fix the following issue in the Linux kernel code: swsusp: fix error paths in snapshot_open
Problem Details: We forget to increase device_available if there's an error in snapshot_open(), so the snapshot device cannot be open at all after snapshot_open() has returned an error. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Andrew Morton <akpm@linux-foundat...
```diff diff --git a/kernel/power/user.c b/kernel/power/user.c index 845acd84cb23..bd1771f7a64e 100644 --- a/kernel/power/user.c +++ b/kernel/power/user.c @@ -49,12 +49,14 @@ static int snapshot_open(struct inode *inode, struct file *filp) if (!atomic_add_unless(&device_available, -1, 0)) return -EBUSY; - if ((f...
433ecb4ab312f873870b67ee374502e84f6dcf92
Analyze and fix the following issue in the Linux kernel code: fix refrigerator() vs thaw_process() race
Problem Details: refrigerator() can miss a wakeup, "wait event" loop needs a proper memory ordering. Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru> Acked-by: "Rafael J. Wysocki" <rjw@sisk.pl> Cc: Pavel Machek <pavel@ucw.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvald...
```diff diff --git a/kernel/power/process.c b/kernel/power/process.c index 6d566bf7085c..0eb5c420e8ed 100644 --- a/kernel/power/process.c +++ b/kernel/power/process.c @@ -47,8 +47,10 @@ void refrigerator(void) recalc_sigpending(); /* We sent fake signal, clean it up */ spin_unlock_irq(&current->sighand->siglock); ...
2af0bc94a665f22975de11bddcf6c57907ce8255
Analyze and fix the following issue in the Linux kernel code: srmcons: fix kmalloc(GFP_KERNEL) inside spinlock
Problem Details: Fixes http://bugzilla.kernel.org/show_bug.cgi?id=8341 Cc: <matthias.kaehlcke@gmail.com> Cc: Richard Henderson <rth@twiddle.net> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru> 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/srmcons.c b/arch/alpha/kernel/srmcons.c index 756923203860..85a821aaceb4 100644 --- a/arch/alpha/kernel/srmcons.c +++ b/arch/alpha/kernel/srmcons.c @@ -164,9 +164,9 @@ srmcons_get_private_struct(struct srmcons_private **ps) int retval = 0; if (srmconsp == NULL) { + srmconsp...
eb2bce7f5e7ac1ca6da434461217fadf3c688d2c
Analyze and fix the following issue in the Linux kernel code: ALPHA: fix BOOTP image creation
Problem Details: Files: arch/alpha/boot/bootpz.c Create a dummy "__kmalloc()" to satisfy the loader; never called. arch/alpha/boot/tools/objstrip.c Remove an include that is now (2.6.x) unnecessary. Signed-off-by: Jay Estabrook <jay.estabrook@hp.com> Signed-off-by: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Cc: ...
```diff diff --git a/arch/alpha/boot/bootpz.c b/arch/alpha/boot/bootpz.c index 4307bde80a35..1036b515e20c 100644 --- a/arch/alpha/boot/bootpz.c +++ b/arch/alpha/boot/bootpz.c @@ -467,3 +467,9 @@ start_kernel(void) #endif runkernel(); } + + /* dummy function, should never be called. */ +void *__kmalloc(size_t size, ...
73243284463a761e04d69d22c7516b2be7de096c
Analyze and fix the following issue in the Linux kernel code: Return EPERM not ECHILD on security_task_wait failure
Problem Details: wait* syscalls return -ECHILD even when an individual PID of a live child was requested explicitly, when security_task_wait denies the operation. This means that something like a broken SELinux policy can produce an unexpected failure that looks just like a bug with wait or ptrace or something. This p...
```diff diff --git a/kernel/exit.c b/kernel/exit.c index b55ed4cc9104..92369240d91d 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -1033,6 +1033,8 @@ asmlinkage void sys_exit_group(int error_code) static int eligible_child(pid_t pid, int options, struct task_struct *p) { + int err; + if (pid > 0) { if (p->p...
4ab688c51226188f2d4ad4f789032c107944ef89
Analyze and fix the following issue in the Linux kernel code: slob: fix page order calculation on not 4KB page
Problem Details: SLOB doesn't calculate correct page order when page size is not 4KB. This patch fixes it with using get_order() instead of find_order() which is SLOB version of get_order(). Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Acked-by: Matt Mackall <mpm@selenic.com> Cc: <stable@kernel.org> Signed-of...
```diff diff --git a/mm/slob.c b/mm/slob.c index c9401a7eaa5f..c6933bc19bcd 100644 --- a/mm/slob.c +++ b/mm/slob.c @@ -150,15 +150,6 @@ static void slob_free(void *block, int size) spin_unlock_irqrestore(&slob_lock, flags); } -static int FASTCALL(find_order(int size)); -static int fastcall find_order(int size) -{ ...
5bc98594d59672303c4c9c07262ecc373dc374da
Analyze and fix the following issue in the Linux kernel code: hugetlbfs: add NULL check in hugetlb_zero_setup()
Problem Details: If hugetlbfs module_init() fails, hugetlbfs_vfsmount is not initialized and shmget() with SHM_HUGETLB flag will cause NULL pointer dereference. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Acked-by: William Irwin <wli@holomorphy.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Sig...
```diff diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 842a4ed4052d..98959b87cdf8 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -747,6 +747,9 @@ struct file *hugetlb_zero_setup(size_t size) char buf[16]; static atomic_t counter; + if (!hugetlbfs_vfsmount) + return ERR_PTR(-ENOEN...
50953fe9e00ebbeffa032a565ab2f08312d51a87
Analyze and fix the following issue in the Linux kernel code: slab allocators: Remove SLAB_DEBUG_INITIAL flag
Problem Details: I have never seen a use of SLAB_DEBUG_INITIAL. It is only supported by SLAB. I think its purpose was to have a callback after an object has been freed to verify that the state is the constructor state again? The callback is performed before each freeing of an object. I would think that it is much e...
```diff diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c index 13e4f70ec8c0..a93f328a7317 100644 --- a/arch/powerpc/platforms/cell/spufs/inode.c +++ b/arch/powerpc/platforms/cell/spufs/inode.c @@ -71,8 +71,7 @@ spufs_init_once(void *p, struct kmem_cache * cachep, unsign...
acec0ac0a87ca821f9d204780c2d1aa0509a6346
Analyze and fix the following issue in the Linux kernel code: get_unmapped_area handles MAP_FIXED on arm
Problem Details: ARM already had a case for MAP_FIXED in arch_get_unmapped_area() though it was not called before. Fix the comment to reflect that it will now be called. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Andrew Morton <...
```diff diff --git a/arch/arm/mm/mmap.c b/arch/arm/mm/mmap.c index b0b5f4694070..2c4c2422cd1e 100644 --- a/arch/arm/mm/mmap.c +++ b/arch/arm/mm/mmap.c @@ -49,8 +49,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, #endif /* - * We should enforce the MAP_FIXED case. However, currently - * the ge...
2b45ab3398a0ba119b1f672c7c56fd5a431b7f0a
Analyze and fix the following issue in the Linux kernel code: oom: fix constraint deadlock
Problem Details: Fixes a deadlock in the OOM killer for allocations that are not __GFP_HARDWALL. Before the OOM killer checks for the allocation constraint, it takes callback_mutex. constrained_alloc() iterates through each zone in the allocation zonelist and calls cpuset_zone_allowed_softwall() to determine whether ...
```diff diff --git a/mm/oom_kill.c b/mm/oom_kill.c index 038d2234f139..a7001410ab15 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c @@ -399,6 +399,7 @@ void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, int order) struct task_struct *p; unsigned long points = 0; unsigned long freed = 0; + int constraint...
2b744c01a54fe0c9974ff1b29522f25f07084053
Analyze and fix the following issue in the Linux kernel code: mm: fix handling of panic_on_oom when cpusets are in use
Problem Details: The current panic_on_oom may not work if there is a process using cpusets/mempolicy, because other nodes' memory may remain. But some people want failover by panic ASAP even if they are used. This patch makes new setting for its request. This is tested on my ia64 box which has 3 nodes. Signed-off-b...
```diff diff --git a/Documentation/sysctl/vm.txt b/Documentation/sysctl/vm.txt index e96a341eb7e4..1d192565e182 100644 --- a/Documentation/sysctl/vm.txt +++ b/Documentation/sysctl/vm.txt @@ -197,11 +197,22 @@ and may not be fast. panic_on_oom -This enables or disables panic on out-of-memory feature. If this is se...
824ebef122153a03925ae0ed211b4e8568d1c8db
Analyze and fix the following issue in the Linux kernel code: fault injection: fix failslab with CONFIG_NUMA
Problem Details: Currently failslab injects failures into ____cache_alloc(). But with enabling CONFIG_NUMA it's not enough to let actual slab allocator functions (kmalloc, kmem_cache_alloc, ...) return NULL. This patch moves fault injection hook inside of __cache_alloc() and __cache_alloc_node(). These are lower cal...
```diff diff --git a/mm/slab.c b/mm/slab.c index 583644f6ae11..2a3cbd6e675d 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -3170,7 +3170,7 @@ static int __init failslab_debugfs(void) struct dentry *dir; int err; - err = init_fault_attr_dentries(&failslab.attr, "failslab"); + err = init_fault_attr_dentries(&fail...
88a420e4e21c1ff6592a668cf4e8af42eff30bad
Analyze and fix the following issue in the Linux kernel code: slub: add ability to list alloc / free callers per slab
Problem Details: This patch enables listing the callers who allocated or freed objects in a cache. For example to list the allocators for kmalloc-128 do cat /sys/slab/kmalloc-128/alloc_calls 7 sn_io_slot_fixup+0x40/0x700 7 sn_io_slot_fixup+0x80/0x700 9 sn_bus_fixup+0xe0/0x380 6 param_sysfs_set...
```diff diff --git a/mm/slub.c b/mm/slub.c index 4251917c5da1..a6231963cae5 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -97,9 +97,6 @@ * * - Support PAGE_ALLOC_DEBUG. Should be easy to do. * - * - Support DEBUG_SLAB_LEAK. Trouble is we do not know where the full - * slabs are in SLUB. - * * - SLAB_DEBUG_INITIAL...
53e15af03be4fdaaf20802d78f141487d7272985
Analyze and fix the following issue in the Linux kernel code: slub: validation of slabs (metadata and guard zones)
Problem Details: This enables validation of slab. Validation means that all objects are checked to see if there are redzone violations, if padding has been overwritten or any pointers have been corrupted. Also checks the consistency of slab counters. Validation enables the detection of metadata corruption without th...
```diff diff --git a/mm/slub.c b/mm/slub.c index c4f40d373d1e..69ee7f807e84 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -670,8 +670,6 @@ static void add_full(struct kmem_cache *s, struct page *page) VM_BUG_ON(!irqs_disabled()); - VM_BUG_ON(!irqs_disabled()); - if (!(s->flags & SLAB_STORE_USER)) return; @@ -2...
77c5e2d01af871f4bfbe08feefa3d5118cb1001b
Analyze and fix the following issue in the Linux kernel code: slub: fix object tracking
Problem Details: Object tracking did not work the right way for several call chains. Fix this up by adding a new parameter to slub_alloc and slub_free that specifies the caller address explicitly. Signed-off-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by...
```diff diff --git a/mm/slub.c b/mm/slub.c index 347c11e80d8e..cfc5301afe42 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -297,9 +297,6 @@ static void set_track(struct kmem_cache *s, void *object, memset(p, 0, sizeof(struct track)); } -#define set_tracking(__s, __o, __a) set_track(__s, __o, __a, \ - __builtin_retur...
d85f33855c303acfa87fa457157cef755b6087df
Analyze and fix the following issue in the Linux kernel code: Make page->private usable in compound pages
Problem Details: If we add a new flag so that we can distinguish between the first page and the tail pages then we can avoid to use page->private in the first page. page->private == page for the first page, so there is no real information in there. Freeing up page->private makes the use of compound pages more transpar...
```diff diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c index 4f36987eea72..2da841110727 100644 --- a/arch/ia64/mm/init.c +++ b/arch/ia64/mm/init.c @@ -121,7 +121,7 @@ lazy_mmu_prot_update (pte_t pte) return; /* i-cache is already coherent with d-cache */ if (PageCompound(page)) { - order = (unsigned ...
543691a6cd70b606dd9bed5e77b120c5d9c5c506
Analyze and fix the following issue in the Linux kernel code: tty_register_driver: only allocate tty instances when defined
Problem Details: If device->num is zero we attempt to kmalloc() zero bytes. When SLUB is enabled this returns a null pointer and take that as an allocation failure and fail the device register. Check for no devices and avoid the allocation. [akpm: opportunistic kzalloc() conversion] Signed-off-by: Andy Whitcroft <ap...
```diff diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index 7a32df594907..389da364e6b6 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c @@ -3720,11 +3720,10 @@ int tty_register_driver(struct tty_driver *driver) if (driver->flags & TTY_DRIVER_INSTALLED) return 0; - if (!(driver->flags &...
b5637e65ee2cecd344b1f8ff750013f697d3ae16
Analyze and fix the following issue in the Linux kernel code: i386: use page allocator to allocate thread_info structure
Problem Details: i386 uses kmalloc to allocate the threadinfo structure assuming that the allocations result in a page sized aligned allocation. That has worked so far because SLAB exempts page sized slabs from debugging and aligns them in special ways that goes beyond the restrictions imposed by KMALLOC_ARCH_MINALIGN...
```diff diff --git a/include/asm-i386/thread_info.h b/include/asm-i386/thread_info.h index 4b187bb377b4..bf01d4b342bd 100644 --- a/include/asm-i386/thread_info.h +++ b/include/asm-i386/thread_info.h @@ -95,12 +95,14 @@ static inline struct thread_info *current_thread_info(void) /* thread information allocation */ #...