id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
d3d74453c34f8fd87674a8cf5b8a327c68f22e99
Analyze and fix the following issue in the Linux kernel code: hrtimer: fixup the HRTIMER_CB_IRQSAFE_NO_SOFTIRQ fallback
Problem Details: Currently all highres=off timers are run from softirq context, but HRTIMER_CB_IRQSAFE_NO_SOFTIRQ timers expect to run from irq context. Fix this up by splitting it similar to the highres=on case. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Ingo Molnar <mingo@elte.hu>
```diff diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index ecc8e2685e2b..49067f14fac1 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -115,10 +115,8 @@ struct hrtimer { enum hrtimer_restart (*function)(struct hrtimer *); struct hrtimer_clock_base *base; unsigned long sta...
03319ec8b06849051747a17aa2a0f9aba9277980
Analyze and fix the following issue in the Linux kernel code: sched: documentation, whitespace fixes
Problem Details: whitespace fixes. Signed-off-by: Ingo Molnar <mingo@elte.hu>
```diff diff --git a/kernel/sched.c b/kernel/sched.c index c2cedd09d895..b9ee0f4db66a 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -182,7 +182,7 @@ struct task_group { * * Bw(A) = 1000/(1000+2000+3000) * 100 = 16.66% * Bw(B) = 2000/(1000+2000+3000) * 100 = 33.33% - * Bw(C) = 3000/(1000+2000+3000) * 10...
e0ecfa7917cafe72f4a75f87e8bb5d8d51dc534f
Analyze and fix the following issue in the Linux kernel code: Preempt-RCU: fix rcu_barrier for preemptive environment.
Problem Details: Fix rcu_barrier() to work properly in preemptive kernel environment. Also, the ordering of callback must be preserved while moving callbacks to another CPU during CPU hotplug. Signed-off-by: Gautham R Shenoy <ego@in.ibm.com> Signed-off-by: Dipankar Sarma <dipankar@in.ibm.com> Signed-off-by: Paul E. Mc...
```diff diff --git a/kernel/rcuclassic.c b/kernel/rcuclassic.c index 18369e3386e2..ce0cf16cab67 100644 --- a/kernel/rcuclassic.c +++ b/kernel/rcuclassic.c @@ -371,9 +371,9 @@ static void __rcu_offline_cpu(struct rcu_data *this_rdp, if (rcp->cur != rcp->completed) cpu_quiet(rdp->cpu, rcp); spin_unlock_bh(&rcp->lo...
bdd7c81b4973e72b670eff6b5725bab189b723d6
Analyze and fix the following issue in the Linux kernel code: sched: fix sched_rt.c:join/leave_domain
Problem Details: fix build bug in sched_rt.c:join/leave_domain and make them only be included on SMP builds. Signed-off-by: Ingo Molnar <mingo@elte.hu>
```diff diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c index b049e5110eea..3ea0cae513d2 100644 --- a/kernel/sched_rt.c +++ b/kernel/sched_rt.c @@ -767,6 +767,20 @@ static void set_cpus_allowed_rt(struct task_struct *p, cpumask_t *new_mask) p->nr_cpus_allowed = weight; } +/* Assumes rq->lock is held */ +static ...
deeeccd41bd94a9db133d7b923f9a7479a47305d
Analyze and fix the following issue in the Linux kernel code: sched: clean up overlong line in kernel/sched_debug.c
Problem Details: clean up overlong line in kernel/sched_debug.c. Signed-off-by: Ingo Molnar <mingo@elte.hu>
```diff diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c index 0749c1837b10..b591b89710a4 100644 --- a/kernel/sched_rt.c +++ b/kernel/sched_rt.c @@ -762,6 +762,7 @@ move_one_task_rt(struct rq *this_rq, int this_cpu, struct rq *busiest, /* don't touch RT tasks */ return 0; } + static void set_cpus_allowed_rt(str...
a22d7fc187ed996b66d8439db27b2303f79a8e7b
Analyze and fix the following issue in the Linux kernel code: sched: wake-balance fixes
Problem Details: We have logic to detect whether the system has migratable tasks, but we are not using it when deciding whether to push tasks away. So we add support for considering this new information. Signed-off-by: Gregory Haskins <ghaskins@novell.com> Signed-off-by: Steven Rostedt <srostedt@redhat.com> Signed-of...
```diff diff --git a/kernel/sched.c b/kernel/sched.c index 3344ba776b97..c591abd9ca38 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -346,6 +346,7 @@ struct rt_rq { unsigned long rt_nr_migratory; /* highest queued rt task prio */ int highest_prio; + int overloaded; }; /* @@ -6770,6 +6771,7 @@ void __init...
82a1fcb90287052aabfa235e7ffc693ea003fe69
Analyze and fix the following issue in the Linux kernel code: softlockup: automatically detect hung TASK_UNINTERRUPTIBLE tasks
Problem Details: this patch extends the soft-lockup detector to automatically detect hung TASK_UNINTERRUPTIBLE tasks. Such hung tasks are printed the following way: ------------------> INFO: task prctl:3042 blocked for more than 120 seconds. "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message ...
```diff diff --git a/include/linux/debug_locks.h b/include/linux/debug_locks.h index 1678a5de7013..f4a5871767f5 100644 --- a/include/linux/debug_locks.h +++ b/include/linux/debug_locks.h @@ -47,6 +47,7 @@ struct task_struct; #ifdef CONFIG_LOCKDEP extern void debug_show_all_locks(void); +extern void __debug_show_hel...
d0d23b5432fe61229dd3641c5e94d4130bc4e61b
Analyze and fix the following issue in the Linux kernel code: cpu-hotplug: fix build on !CONFIG_SMP
Problem Details: fix build on !CONFIG_SMP. Signed-off-by: Ingo Molnar <mingo@elte.hu>
```diff diff --git a/include/linux/cpu.h b/include/linux/cpu.h index 3a3ff1c5cbef..0be8d65bc3c8 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h @@ -71,19 +71,25 @@ static inline void unregister_cpu_notifier(struct notifier_block *nb) int cpu_up(unsigned int cpu); +extern void cpu_hotplug_init(void); + ...
6b2d7700266b9402e12824e11e0099ae6a4a6a79
Analyze and fix the following issue in the Linux kernel code: sched: group scheduler, fix fairness of cpu bandwidth allocation for task groups
Problem Details: The current load balancing scheme isn't good enough for precise group fairness. For example: on a 8-cpu system, I created 3 groups as under: a = 8 tasks (cpu.shares = 1024) b = 4 tasks (cpu.shares = 1024) c = 3 tasks (cpu.shares = 1024) a, b and c are task groups that have equal weight. We would ...
```diff diff --git a/include/linux/sched.h b/include/linux/sched.h index d6eacda765ca..288245f83bd4 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -1453,6 +1453,10 @@ extern unsigned int sysctl_sched_child_runs_first; extern unsigned int sysctl_sched_features; extern unsigned int sysctl_sched_migra...
ec2c507fe8c8fa3c04fc6cb99a382a965c477379
Analyze and fix the following issue in the Linux kernel code: sched: group scheduling, minor fixes
Problem Details: Minor bug fixes for the group scheduler: - Use a mutex to serialize add/remove of task groups and also when changing shares of a task group. Use the same mutex when printing cfs_rq debugging stats for various task groups. - Use list_for_each_entry_rcu in for_each_leaf_cfs_rq macro (when walking...
```diff diff --git a/kernel/sched.c b/kernel/sched.c index 7f827b70ae02..cfa695819252 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -169,8 +169,6 @@ struct task_group { /* runqueue "owned" by this group on each cpu */ struct cfs_rq **cfs_rq; unsigned long shares; - /* spinlock to serialize modification to s...
93f992ccc008dd4030381caeebb252e85e66684b
Analyze and fix the following issue in the Linux kernel code: sched: group scheduling code cleanup
Problem Details: Minor cleanups: - Fix coding style - remove obsolete comment Signed-off-by: Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
```diff diff --git a/kernel/sched.c b/kernel/sched.c index e76b11ca6df3..7f827b70ae02 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -191,12 +191,12 @@ struct task_group init_task_group = { }; #ifdef CONFIG_FAIR_USER_SCHED -# define INIT_TASK_GRP_LOAD 2*NICE_0_LOAD +# define INIT_TASK_GROUP_LOAD 2*NICE_0_LOAD ...
d713f519332e029d43eca8462629314eee1ded86
Analyze and fix the following issue in the Linux kernel code: sched: fix CONFIG_PRINT_TIME's reliance on sched_clock()
Problem Details: Stefano Brivio reported weird printk timestamp behavior during CPU frequency changes: http://bugzilla.kernel.org/show_bug.cgi?id=9475 fix CONFIG_PRINT_TIME's reliance on sched_clock() and use cpu_clock() instead. Reported-and-bisected-by: Stefano Brivio <stefano.brivio@polimi.it> Signed-off-by: In...
```diff diff --git a/kernel/printk.c b/kernel/printk.c index e6c1f36d8c3a..5f9d053699f9 100644 --- a/kernel/printk.c +++ b/kernel/printk.c @@ -707,7 +707,7 @@ asmlinkage int vprintk(const char *fmt, va_list args) loglev_char = default_message_loglevel + '0'; } - t = printk_clock(); + t = cpu_clo...
32a76006683f7b28ae3cc491da37716e002f198e
Analyze and fix the following issue in the Linux kernel code: printk: make printk more robust by not allowing recursion
Problem Details: make printk more robust by allowing recursion only if there's a crash going on. Also add recursion detection. I've tested it with an artificially injected printk recursion - instead of a lockup or spontaneous reboot or other crash, the output was a well controlled: [ 41.057335] SysRq : <2>BUG: rece...
```diff diff --git a/kernel/printk.c b/kernel/printk.c index 89011bf8c106..e6c1f36d8c3a 100644 --- a/kernel/printk.c +++ b/kernel/printk.c @@ -628,30 +628,57 @@ asmlinkage int printk(const char *fmt, ...) /* cpu currently holding logbuf_lock */ static volatile unsigned int printk_cpu = UINT_MAX; +const char printk_...
1292500b159c00a8fece072b004f154e6fda9f48
Analyze and fix the following issue in the Linux kernel code: [SCSI] ultrastor: clean up inline asm warnings
Problem Details: To: linux-kernel@vger.kernel.org Cc: bunk@kernel.org Subject: [trivial patch] scsi/ultrastor: clean up inline asm warnings Hi, Compiling latest mainline with gcc 4.2.1 spews the following warnings: drivers/scsi/ultrastor.c: In function 'find_and_clear_bit_16': drivers/scsi/ultrastor.c:303: warning: ...
```diff diff --git a/drivers/scsi/ultrastor.c b/drivers/scsi/ultrastor.c index 1d3b02976d74..75eca6b22db5 100644 --- a/drivers/scsi/ultrastor.c +++ b/drivers/scsi/ultrastor.c @@ -298,9 +298,16 @@ static inline int find_and_clear_bit_16(unsigned long *field) { int rv; - if (*field == 0) panic("No free mscp"); - ...
556a169dab38b5100df6f4a45b655dddd3db94c1
Analyze and fix the following issue in the Linux kernel code: slab: fix bootstrap on memoryless node
Problem Details: If the node we're booting on doesn't have memory, bootstrapping kmalloc() caches resorts to fallback_alloc() which requires ->nodelists set for all nodes. Fix that by calling set_up_list3s() for CACHE_CACHE in kmem_cache_init(). As kmem_getpages() is called with GFP_THISNODE set, this used to work be...
```diff diff --git a/mm/slab.c b/mm/slab.c index b03b2e46b806..ff31261fd24f 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -304,11 +304,11 @@ struct kmem_list3 { /* * Need this for bootstrapping a per node allocator. */ -#define NUM_INIT_LISTS (2 * MAX_NUMNODES + 1) +#define NUM_INIT_LISTS (3 * MAX_NUMNODES) struct km...
eb36f4fc019835cecf0788907f6cab774508087b
Analyze and fix the following issue in the Linux kernel code: fix oops on rmmod capidrv
Problem Details: Fix overwriting the stack with the version string (it is currently 10 bytes + zero) when unloading the capidrv module. Safeguard against overwriting it should the version string grow in the future. Should fix Kernel Bug Tracker Bug 9696. Signed-off-by: Gerd v. Egidy <gerd.von.egidy@intra2net.com> Ack...
```diff diff --git a/drivers/isdn/capi/capidrv.c b/drivers/isdn/capi/capidrv.c index 48c1775ef5b3..cb42b690b45e 100644 --- a/drivers/isdn/capi/capidrv.c +++ b/drivers/isdn/capi/capidrv.c @@ -2332,13 +2332,14 @@ static int __init capidrv_init(void) static void __exit capidrv_exit(void) { - char rev[10]; + char rev[3...
93a38fa2dd83fcaf65b2327fff65e364472388f9
Analyze and fix the following issue in the Linux kernel code: [SCSI] aic7xxx: fix firmware build
Problem Details: This patch adds the proper $(obj) and $(src) prefixes to dependency rules in aic7xxx makefile. Without this patch, there is a remote possibility that parallel make with a different output directory can fail. Also changed the deprecated EXTRA_CFLAGS construct to ccflags-y syntax. Fixed up patch to sur...
```diff diff --git a/drivers/scsi/aic7xxx/Makefile b/drivers/scsi/aic7xxx/Makefile index 9a6ce19a4030..e4f70c563bc2 100644 --- a/drivers/scsi/aic7xxx/Makefile +++ b/drivers/scsi/aic7xxx/Makefile @@ -33,11 +33,10 @@ aic79xx-y += aic79xx_osm.o \ aic79xx_proc.o \ aic79xx_osm_pci.o -EXTRA_CFLAGS +...
da707c54c3424b4b50d4352c2103867284ba6724
Analyze and fix the following issue in the Linux kernel code: [SCSI] ch: fix device minor number management bug
Problem Details: ch_probe uses the total number of ch devices as minor. ch_probe: ch->minor = ch_devcount; ... ch_devcount++; Then ch_remove decreases ch_devcount: ch_remove: ch_devcount--; If you have two ch devices, sch0 and sch1, and remove sch0, ch_devcount is 1. Then if you add another ch device, ch_probe t...
```diff diff --git a/drivers/scsi/ch.c b/drivers/scsi/ch.c index 765f2fc001aa..2b07014cbc83 100644 --- a/drivers/scsi/ch.c +++ b/drivers/scsi/ch.c @@ -21,6 +21,7 @@ #include <linux/compat.h> #include <linux/chio.h> /* here are all the ioctls */ #include <linux/mutex.h> +#include <linux/idr.h> #include <scsi/scs...
866136827b9a71c39dcb06d23ce523f719eab74b
Analyze and fix the following issue in the Linux kernel code: UBI: introduce atomic LEB change ioctl
Problem Details: We have to be able to change individual LEBs for utilities like ubifsck, ubifstune. For example, ubifsck has to be able to fix errors on the media, ubifstune has to be able to change the the superblock, hence this ioctl. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
```diff diff --git a/include/linux/mtd/ubi.h b/include/linux/mtd/ubi.h index c4abe0351225..f71201d0f3e7 100644 --- a/include/linux/mtd/ubi.h +++ b/include/linux/mtd/ubi.h @@ -25,23 +25,6 @@ #include <linux/types.h> #include <mtd/ubi-user.h> -/* - * UBI data type hint constants. - * - * UBI_LONGTERM: long-term data ...
c18a84186cc05bee19d55823f1a35f4ea91a92d6
Analyze and fix the following issue in the Linux kernel code: UBI: fix warnings
Problem Details: Old gcc complains: CC drivers/mtd/ubi/wl.o drivers/mtd/ubi/wl.c: In function 'wear_leveling_worker': drivers/mtd/ubi/wl.c:746: warning: 'pe' may be used uninitialized in this function CC drivers/mtd/ubi/scan.o drivers/mtd/ubi/scan.c: In function 'ubi_scan': drivers/mtd/ubi/scan.c:772: warnin...
```diff diff --git a/drivers/mtd/ubi/scan.c b/drivers/mtd/ubi/scan.c index e47663870501..6f2680f423fe 100644 --- a/drivers/mtd/ubi/scan.c +++ b/drivers/mtd/ubi/scan.c @@ -773,7 +773,7 @@ struct ubi_scan_leb *ubi_scan_get_free_peb(struct ubi_device *ubi, */ static int process_eb(struct ubi_device *ubi, struct ubi_sca...
d536058752274b2fe60135142da550b5355ffa94
Analyze and fix the following issue in the Linux kernel code: UBI: bugfix: calculate data offset properly
Problem Details: Data offset is VID header offset + VID header size aligned to the min. I/O unit size up. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
```diff diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c index 51bff88342af..6ac81e35355c 100644 --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c @@ -562,7 +562,7 @@ static int io_init(struct ubi_device *ubi) } /* Similar for the data offset */ - ubi->leb_start = ubi->vid_hdr_offset + ubi...
ae616e1be13599c3b64e544ebe99e69ea851e99c
Analyze and fix the following issue in the Linux kernel code: UBI: fix warnings
Problem Details: drivers/mtd/ubi/cdev.c: In function ‘vol_cdev_read’: drivers/mtd/ubi/cdev.c:187: warning: unused variable ‘vol_id’ CC [M] drivers/mtd/ubi/kapi.o drivers/mtd/ubi/kapi.c: In function ‘ubi_leb_erase’: drivers/mtd/ubi/kapi.c:483: warning: unused variable ‘vol_id’ drivers/mtd/ubi/kapi.c: In function ‘ubi_l...
```diff diff --git a/drivers/mtd/ubi/cdev.c b/drivers/mtd/ubi/cdev.c index a60a3a24c2a1..a7aa123afaf6 100644 --- a/drivers/mtd/ubi/cdev.c +++ b/drivers/mtd/ubi/cdev.c @@ -184,13 +184,13 @@ static ssize_t vol_cdev_read(struct file *file, __user char *buf, size_t count, struct ubi_volume_desc *desc = file->private_data...
092ca5bd61da6344f3b249754b337f2d48dfe08d
Analyze and fix the following issue in the Linux kernel code: [POWERPC] Revert chrp_pci_fixup_vt8231_ata devinit to fix libata on pegasos
Problem Details: Commit 6d98bda79bea0e1be26c0767d0e9923ad3b72f2e changed the init order for chrp_pci_fixup_vt8231_ata(). It can not work anymore because either the irq is not yet set to 14 or pci_get_device() returns nothing. At least the printk() in chrp_pci_fixup_vt8231_ata() does not trigger anymore. pata_via work...
```diff diff --git a/arch/powerpc/platforms/chrp/pci.c b/arch/powerpc/platforms/chrp/pci.c index d51f83aeef7f..609c46db4a1b 100644 --- a/arch/powerpc/platforms/chrp/pci.c +++ b/arch/powerpc/platforms/chrp/pci.c @@ -354,7 +354,7 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_82C105, * mode as ...
9d5f49283b85d925f17fa07af5e4879465e179d6
Analyze and fix the following issue in the Linux kernel code: [POWERPC] Always hookup PHB IO resource even when empty
Problem Details: We must always hookup the pci_bus resource 0 to the PHB io_resource even if the latter is empty (the bus has no IO support). Otherwise, some other code will end up hooking it up to something bogus and the resource tree will end up being broken. This fixes boot on QS20 Cell blades where the IDE driver...
```diff diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c index 1930f393d01c..52750745edfd 100644 --- a/arch/powerpc/kernel/pci_64.c +++ b/arch/powerpc/kernel/pci_64.c @@ -357,7 +357,6 @@ void __devinit scan_phb(struct pci_controller *hose) struct pci_bus *bus; struct device_node *node = hose...
972b1f040c8698ef2a44ad3f2b790039d5a8ac09
Analyze and fix the following issue in the Linux kernel code: [POWERPC] PS3: Add repository polling loop to work around timing bug
Problem Details: PS3: Add repository polling loop to work around timing bug On some firmware versions (e.g. 1.90), the storage device may not show up in the repository immediately after receiving the notification message. Add a small polling loop to make sure we don't miss it. Signed-off-by: Geert Uytterhoeven <Geert...
```diff diff --git a/arch/powerpc/platforms/ps3/device-init.c b/arch/powerpc/platforms/ps3/device-init.c index 5695e00219e4..05c7c1c624dc 100644 --- a/arch/powerpc/platforms/ps3/device-init.c +++ b/arch/powerpc/platforms/ps3/device-init.c @@ -489,6 +489,38 @@ static int ps3_register_repository_device( return result; ...
caa34c9e9cab6afb243a3da406cce272805c48c5
Analyze and fix the following issue in the Linux kernel code: [POWERPC] Fix a couple of copyright symbols
Problem Details: Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
```diff diff --git a/arch/powerpc/kernel/systbl_chk.c b/arch/powerpc/kernel/systbl_chk.c index 77824d1cb150..238aa63ced8f 100644 --- a/arch/powerpc/kernel/systbl_chk.c +++ b/arch/powerpc/kernel/systbl_chk.c @@ -6,7 +6,7 @@ * Unfortunately, we cannot check for the correct ordering of entries * using SYSX(). * - * ...
e057d985fd8aad83d07376c5c36f2c8a6c5411be
Analyze and fix the following issue in the Linux kernel code: [POWERPC] Make smp_send_stop() handle panic and xmon reboot
Problem Details: smp_send_stop() will send an IPI to all other cpus to shut them down. However, for the case of xmon-based reboots (as well as potentially some panics), the other cpus are (or might be) spinning with interrupts off, and won't take the IPI. Current code will drop us into the debugger when the IPI fails,...
```diff diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c index cefeee81c52e..be35ffae10f0 100644 --- a/arch/powerpc/kernel/smp.c +++ b/arch/powerpc/kernel/smp.c @@ -76,6 +76,8 @@ void smp_call_function_interrupt(void); int smt_enabled_at_boot = 1; +static int ipi_fail_ok; + static void (*crash_i...
366781c19635d861f43ff5e03388a3873ec912d9
Analyze and fix the following issue in the Linux kernel code: [CIFS] DFS build fixes
Problem Details: Also includes a few minor changes suggested by Christoph Signed-off-by: Steve French <sfrench@us.ibm.com>
```diff diff --git a/fs/cifs/cifs_dfs_ref.c b/fs/cifs/cifs_dfs_ref.c index 15e31f8435ba..413ee2349d1a 100644 --- a/fs/cifs/cifs_dfs_ref.c +++ b/fs/cifs/cifs_dfs_ref.c @@ -3,8 +3,9 @@ * traversal via DFS junction point * * Copyright (c) 2007 Igor Mammedov + * Copyright (C) International Business Machines Co...
1b8177ec1e779bcc3ed89419ff7c80dbc3dcc489
Analyze and fix the following issue in the Linux kernel code: [GFS2] Lockup on error
Problem Details: I spotted this bug while I was digging around. Looks like it could cause a lockup in some rare error condition. Signed-off-by: Bob Peterson <rpeterso@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
```diff diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index c84764ad82b3..728d3169e7bd 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c @@ -860,7 +860,7 @@ static int link_dinode(struct gfs2_inode *dip, const struct qstr *name, error = alloc_required = gfs2_diradd_alloc_required(&dip->i_inode, name); if (alloc...
b7fe2e391ee7b711d6dfd6a694d60c4f21113cbb
Analyze and fix the following issue in the Linux kernel code: [GFS2] Fix page_mkwrite truncation race path
Problem Details: There was a bug in the truncation/invalidation race path for ->page_mkwrite for gfs2. It ought to return 0 so that the effect is the same as if the page was truncated at any of the other points at which the page_lock is dropped. This will result in the restart of the whole page fault path. If it was du...
```diff diff --git a/fs/gfs2/ops_file.c b/fs/gfs2/ops_file.c index d7f4726ae0ce..f4842f2548cd 100644 --- a/fs/gfs2/ops_file.c +++ b/fs/gfs2/ops_file.c @@ -394,6 +394,7 @@ static int gfs2_page_mkwrite(struct vm_area_struct *vma, struct page *page) last_index = ip->i_inode.i_size >> PAGE_CACHE_SHIFT; if (page->index ...
3e5cd0877e6d2f059dc36b8206cb7e93938151db
Analyze and fix the following issue in the Linux kernel code: [GFS2] Fix typo
Problem Details: This patch fixes a minor typo. Surprisingly, it still compiled. Signed-off-by: Bob Peterson <rpeterso@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
```diff diff --git a/fs/gfs2/meta_io.c b/fs/gfs2/meta_io.c index 3144d35a6261..85aea27b4a86 100644 --- a/fs/gfs2/meta_io.c +++ b/fs/gfs2/meta_io.c @@ -284,7 +284,7 @@ void gfs2_attach_bufdata(struct gfs2_glock *gl, struct buffer_head *bh, return; } - bd = kmem_cache_zalloc(gfs2_bufdata_cachep, GFP_NOFS | __GFP_N...
1af535727bbf68e1da7ac232de47315da4c66ade
Analyze and fix the following issue in the Linux kernel code: [GFS2] Fix write alloc required shortcut calculation
Problem Details: The comparison was being made against the wrong quantity. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
```diff diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c index 4356cc2fb3f5..e4effc47abfc 100644 --- a/fs/gfs2/bmap.c +++ b/fs/gfs2/bmap.c @@ -1222,10 +1222,10 @@ int gfs2_write_alloc_required(struct gfs2_inode *ip, u64 offset, do_div(lblock_stop, bsize); } else { unsigned int shift = sdp->sd_sb.sb_bsize_shift; + ...
ac39aadd0440ae696e6dacaa8006ce1737b17008
Analyze and fix the following issue in the Linux kernel code: [GFS2] Fix assert in log code
Problem Details: Although the values were all being calculated correctly, there was a race in the assert due to the way it was using atomic variables. This changes the value we assert on so that we get the same effect by testing a different variable. This prevents the assert triggering when it shouldn't. Signed-off-by...
```diff diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c index 91645259e135..161ab6f2058e 100644 --- a/fs/gfs2/log.c +++ b/fs/gfs2/log.c @@ -757,7 +757,7 @@ void __gfs2_log_flush(struct gfs2_sbd *sdp, struct gfs2_glock *gl) static void log_refund(struct gfs2_sbd *sdp, struct gfs2_trans *tr) { unsigned int reserved; - uns...
9656b2c14c6ee0806c90a6be41dec71117fc8f50
Analyze and fix the following issue in the Linux kernel code: [GFS2] Fix problems relating to execution of files on GFS2
Problem Details: This patch fixes a couple of problems which affected the execution of files on GFS2. The first is that there was a corner case where inodes were not always uptodate at the point at which permissions checks were being carried out, this was resulting in refusal of execute permission, but only on the firs...
```diff diff --git a/fs/gfs2/ops_address.c b/fs/gfs2/ops_address.c index e16ad8104495..37406a379e7a 100644 --- a/fs/gfs2/ops_address.c +++ b/fs/gfs2/ops_address.c @@ -848,14 +848,11 @@ static int gfs2_write_end(struct file *file, struct address_space *mapping, ret = generic_write_end(file, mapping, pos, len, copied...
ff91cc9bb41b62bc4ea7d5ced396fabf97539df9
Analyze and fix the following issue in the Linux kernel code: [GFS2] Fix log block mapper
Problem Details: A missing offset in the calculation. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
```diff diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c index 69a583ec43c7..91645259e135 100644 --- a/fs/gfs2/log.c +++ b/fs/gfs2/log.c @@ -343,7 +343,7 @@ static u64 log_bmap(struct gfs2_sbd *sdp, unsigned int lbn) list_for_each_entry(je, &sdp->sd_jdesc->extent_list, extent_list) { if (lbn >= je->lblock && lbn < je-...
b3513fca7e41965d85125c9770ce5f8fd4ff509a
Analyze and fix the following issue in the Linux kernel code: [GFS2] Incremental patch to fix compiler warning
Problem Details: Signed-off-by: Bob Peterson <rpeterso@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
```diff diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c index d7ff9cf6653f..68c4bf363c46 100644 --- a/fs/gfs2/rgrp.c +++ b/fs/gfs2/rgrp.c @@ -133,10 +133,9 @@ static u32 gfs2_bitfit(unsigned char *buffer, unsigned int buflen, u32 goal, u32 blk = goal; unsigned int bit, bitlong; unsigned long *plong, plong55; - stati...
292c8c14cace19c94c6abe25506310239daf949e
Analyze and fix the following issue in the Linux kernel code: [GFS2] patch to check for recursive lock requests in gfs2_rename code path
Problem Details: A certain scenario in the rename code path triggers a kernel BUG() because it accidentally does recursive locking The first lock is requested to unlink an already existing inode (replacing a file) and the second lock is requested when the destination directory needs to alloc some space. It is rare that...
```diff diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c index 09848aac45f6..e0ee195558d3 100644 --- a/fs/gfs2/rgrp.c +++ b/fs/gfs2/rgrp.c @@ -1063,22 +1063,30 @@ static struct inode *get_local_rgrp(struct gfs2_inode *ip, u64 *last_unlinked) int flags = LM_FLAG_TRY; int skipped = 0; int loops = 0; - int error; + int ...
6a69a23f7df18f39e4a084e10b62ff4a144b05a5
Analyze and fix the following issue in the Linux kernel code: [GFS2] Fix build warnings
Problem Details: Hi Steven, Steven Whitehouse wrote: > Hi, > > Now in the -nmw git tree. Thanks, > > Steve. > > On Wed, 2007-11-21 at 11:54 -0600, Ryan O'Hara wrote: this patch introduces a bunch of build warnings by leaving around struct inode *inode = &ip->i_inode; The patch in attachment cleans them up. Please a...
```diff diff --git a/fs/gfs2/eaops.c b/fs/gfs2/eaops.c index ef91b6e893a0..14fbd95fd664 100644 --- a/fs/gfs2/eaops.c +++ b/fs/gfs2/eaops.c @@ -58,22 +58,16 @@ unsigned int gfs2_ea_name2type(const char *name, const char **truncated_name) static int user_eo_get(struct gfs2_inode *ip, struct gfs2_ea_request *er) { - s...
1a2781cfa5ed8eb82bb311d684f268c1822dae69
Analyze and fix the following issue in the Linux kernel code: [GFS2] Fix runtime issue with UP kernels
Problem Details: The issue is indeed UP vs SMP and it is totally random. spin_is_locked() is a bad assertion because there is no correct answer on UP. on UP spin_is_locked() has to return either one value or another, always. This means that in my setup I am lucky enough to trigger the issue and your you are lucky eno...
```diff diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index d83df6888402..a7f3c462d4fe 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c @@ -217,7 +217,6 @@ int gfs2_glock_put(struct gfs2_glock *gl) if (atomic_dec_and_test(&gl->gl_ref)) { hlist_del(&gl->gl_list); write_unlock(gl_lock_addr(gl->gl_hash)); - BU...
0b7580c786a5feda6291fe68ead3a1b92b6b35b8
Analyze and fix the following issue in the Linux kernel code: [GFS2] Check for installation of mount helpers for DLM mounts
Problem Details: The patch is a fix to abort mount if the mount.gfs* and possible umount.* are missing from /sbin. While we do what we can to guarantee that they are installed properly in userland (CVS HEAD), we want to make sure that mount still aborts properly. The only sign of missing helpers is that lock_dlm will...
```diff diff --git a/fs/gfs2/locking/dlm/mount.c b/fs/gfs2/locking/dlm/mount.c index 41c5b04caaba..ab301023094f 100644 --- a/fs/gfs2/locking/dlm/mount.c +++ b/fs/gfs2/locking/dlm/mount.c @@ -67,6 +67,12 @@ static int make_args(struct gdlm_ls *ls, char *data_arg, int *nodir) memset(data, 0, 256); strncpy(data, data_...
9ff8ec32e58875022447af619bec6e5aee7c77e4
Analyze and fix the following issue in the Linux kernel code: [GFS2] Split gfs2_writepage into three cases
Problem Details: This patch splits gfs2_writepage into separate functions for each of the three cases: writeback, ordered and journalled. As a result it becomes a lot easier to see what each one is doing. The common code is moved into gfs2_writepage_common. This fixes a performance bug where we were doing more work th...
```diff diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c index 6c27cea761c6..e901f8f7d650 100644 --- a/fs/gfs2/lops.c +++ b/fs/gfs2/lops.c @@ -556,17 +556,20 @@ static void databuf_lo_add(struct gfs2_sbd *sdp, struct gfs2_log_element *le) lock_buffer(bd->bd_bh); gfs2_log_lock(sdp); - if (!list_empty(&bd->bd_list_tr))...
bf36a713169432643d4fc7eeb4e0ace96d791d26
Analyze and fix the following issue in the Linux kernel code: [GFS2] Add gfs2_is_writeback()
Problem Details: This adds a function "gfs2_is_writeback()" along the lines of the existing "gfs2_is_jdata()" in order to clean up the code and make the various tests for the inode mode more obvious. It also fixes the PageChecked() logic where we were resetting the flag too early in the case of an error path. Signed-o...
```diff diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c index 93fa427bb5f5..1cfd493e30fb 100644 --- a/fs/gfs2/bmap.c +++ b/fs/gfs2/bmap.c @@ -59,7 +59,6 @@ struct strip_mine { static int gfs2_unstuffer_page(struct gfs2_inode *ip, struct buffer_head *dibh, u64 block, struct page *page) { - struct gfs2_sbd *sdp...
cc7e79b168a552152299bd8a8254dc099aacc993
Analyze and fix the following issue in the Linux kernel code: [GFS2] Handle multiple glock demote requests
Problem Details: Fix a race condition where multiple glock demote requests are sent to a node back-to-back. This patch does a check inside handle_callback() to see whether a demote request is in progress. If true, it sets a flag to make sure run_queue() will loop again to handle the new request, instead of erronously s...
```diff diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index a37efe4aae6f..104e83ff874f 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c @@ -567,7 +567,10 @@ static int rq_demote(struct gfs2_glock *gl) gfs2_demote_wake(gl); return 0; } + set_bit(GLF_LOCK, &gl->gl_flags); + set_bit(GLF_DEMOTE_IN_PROGRESS, &g...
d6c49a7a78fc841418bbd58bda504076f80ec51d
Analyze and fix the following issue in the Linux kernel code: [AVR32] extint: Set initial irq type to low level
Problem Details: David Brownell pointed out a mismatch in the avr32 extint code: > I noticed a small glitch that's not fixed by this patch: the > initial type is falling edge, but IRQ_TYPE_NONE is mapped to > IRQ_TYPE_LEVEL_LOW. Potentially surprising. Fix it by setting the initial type (and handler) to low level, ...
```diff diff --git a/arch/avr32/mach-at32ap/extint.c b/arch/avr32/mach-at32ap/extint.c index 81a4a02f5f42..c36a6d59d6f0 100644 --- a/arch/avr32/mach-at32ap/extint.c +++ b/arch/avr32/mach-at32ap/extint.c @@ -226,15 +226,15 @@ static int __init eic_probe(struct platform_device *pdev) pattern = eic_readl(eic, MODE); n...
a7f5bf9b95ace39cd8b61e8c9ca1035966779ed1
Analyze and fix the following issue in the Linux kernel code: [AVR32] Include instrumentation menu
Problem Details: Remove KPROBES option from Kconfig.debug and include kernel/Kconfig.instrumentation. Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
```diff diff --git a/arch/avr32/Kconfig b/arch/avr32/Kconfig index b77abce10c7a..bc08c7f0883f 100644 --- a/arch/avr32/Kconfig +++ b/arch/avr32/Kconfig @@ -219,6 +219,8 @@ source "drivers/Kconfig" source "fs/Kconfig" +source "kernel/Kconfig.instrumentation" + source "arch/avr32/Kconfig.debug" source "security/K...
13b54a50525a9685065684e1e11258d27dd27bdf
Analyze and fix the following issue in the Linux kernel code: [AVR32] Enable debugging only when needed
Problem Details: Keep track of processes being debugged (including the kernel itself) and turn the OCD system on and off as appropriate. Since enabling debugging turns off some optimizations in the CPU core, this fixes the issue that enabling KProbes support or simply running a program under gdbserver will reduce syste...
```diff diff --git a/arch/avr32/kernel/Makefile b/arch/avr32/kernel/Makefile index 2d6d48f35f69..bc224a4e39fe 100644 --- a/arch/avr32/kernel/Makefile +++ b/arch/avr32/kernel/Makefile @@ -6,7 +6,7 @@ extra-y := head.o vmlinux.lds obj-$(CONFIG_SUBARCH_AVR32B) += entry-avr32b.o obj-y += syscall_table.o syscall-s...
6ea6dd93c9454cc9521134f907bc970d09f460e4
Analyze and fix the following issue in the Linux kernel code: ptrace: Call arch_ptrace_attach() when request=PTRACE_TRACEME
Problem Details: arch_ptrace_attach() is a hook that allows the architecture to do book-keeping after a ptrace attach. This patch adds a call to this hook when handling a PTRACE_TRACEME request as well. Currently only one architecture, m32r, implements this hook. When called, it initializes a number of debug trap slot...
```diff diff --git a/kernel/ptrace.c b/kernel/ptrace.c index c25db863081d..c719bb9d79ab 100644 --- a/kernel/ptrace.c +++ b/kernel/ptrace.c @@ -470,6 +470,8 @@ asmlinkage long sys_ptrace(long request, long pid, long addr, long data) lock_kernel(); if (request == PTRACE_TRACEME) { ret = ptrace_traceme(); + if (!r...
e374a2bfebf359f846216336de91670be40499da
Analyze and fix the following issue in the Linux kernel code: Kobject: fix coding style issues in kobject c files
Problem Details: Clean up the kobject.c and kobject_uevent.c files to follow the proper coding style rules. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
```diff diff --git a/lib/kobject.c b/lib/kobject.c index 8dc32454661d..1d63ead1815e 100644 --- a/lib/kobject.c +++ b/lib/kobject.c @@ -18,58 +18,57 @@ #include <linux/stat.h> #include <linux/slab.h> -/** - * populate_dir - populate directory with attributes. - * @kobj: object we're working on. - * - * Most subsyste...
79a6ee42fd81be9abc6bdab08f932875924b26a5
Analyze and fix the following issue in the Linux kernel code: Kobject: fix coding style issues in kobject.h
Problem Details: Finally clean up the odd spaces and other mess in kobject.h Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
```diff diff --git a/include/linux/kobject.h b/include/linux/kobject.h index 4adbe1d83081..caa3f411f15d 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h @@ -3,15 +3,14 @@ * * Copyright (c) 2002-2003 Patrick Mochel * Copyright (c) 2002-2003 Open Source Development Labs - * Copyright (c) 2006-2007...
d462943afee8bff610258a82dba666e8ab72c9c8
Analyze and fix the following issue in the Linux kernel code: Driver core: fix coding style issues in device.h
Problem Details: Finally clean up the odd spaces and other mess in device.h Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
```diff diff --git a/include/linux/device.h b/include/linux/device.h index cdaf57bf4d19..1880208964d6 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -25,7 +25,8 @@ #include <asm/device.h> #define DEVICE_NAME_SIZE 50 -#define DEVICE_NAME_HALF __stringify(20) /* Less than half to accommodate slop...
63b6971a0876b744e2fcf3c9df15d130501e1deb
Analyze and fix the following issue in the Linux kernel code: Driver core: Cleanup get_device_parent() in device_add() and device_move()
Problem Details: Make setup_parent() void as get_device_parent() will always return either a valid kobject or NULL. Introduce cleanup_glue_dir() to drop reference grabbed on "glue" directory by get_device_parent(). Use it for cleanup in device_move() and device_add() on errors. This should fix the refcounting problem ...
```diff diff --git a/drivers/base/core.c b/drivers/base/core.c index d5d542db96fd..f09dde3b1e27 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -552,6 +552,8 @@ static struct kobject *get_device_parent(struct device *dev, } static inline void cleanup_device_parent(struct device *dev) {} +static inline...
92b421416f8194aec87b1439487b5544e9ac8187
Analyze and fix the following issue in the Linux kernel code: driver core: fix build with SYSFS=n
Problem Details: When SYSFS=n and MODULES=y, build ends with: linux-2.6.24-rc6-mm1/drivers/base/module.c: In function 'module_add_driver': linux-2.6.24-rc6-mm1/drivers/base/module.c:49: error: 'module_kset' undeclared (first use in this function) make[3]: *** [drivers/base/module.o] Error 1 Below is one possible fix....
```diff diff --git a/drivers/base/Makefile b/drivers/base/Makefile index ff2696823f8d..63e09c015ca0 100644 --- a/drivers/base/Makefile +++ b/drivers/base/Makefile @@ -11,7 +11,9 @@ obj-$(CONFIG_FW_LOADER) += firmware_class.o obj-$(CONFIG_NUMA) += node.o obj-$(CONFIG_MEMORY_HOTPLUG_SPARSE) += memory.o obj-$(CONFIG_SM...
09f82ea92822a7bbb7e816508abbda47ed54a77f
Analyze and fix the following issue in the Linux kernel code: Kobject: drop child->parent ref at unregistration
Problem Details: This patch (as1015) reverts changes that were made to the driver core about four years ago. The intent back then was to avoid certain kinds of invalid memory accesses by leaving kernel objects allocated as long as any of their children were still allocated. The original and correct approach was to wa...
```diff diff --git a/lib/kobject.c b/lib/kobject.c index 1015f74212d0..493e991abb1b 100644 --- a/lib/kobject.c +++ b/lib/kobject.c @@ -149,12 +149,16 @@ void kobject_init(struct kobject * kobj) static void unlink(struct kobject * kobj) { + struct kobject *parent = kobj->parent; + if (kobj->kset) { spin_lock(&k...
97c146ef075dc40ae34407c03d3860fc3850b8e8
Analyze and fix the following issue in the Linux kernel code: sysfs: fix /sys/module/*/holders after sysfs logic change
Problem Details: Sysfs symlinks now require fully registered kobjects as a target, otherwise the call to create a symlink will fail. Here we register the kobject before we request the symlink in the holders directory. Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Cc: Tejun Heo <teheo@suse.de> Signed-off-by: Greg K...
```diff diff --git a/kernel/module.c b/kernel/module.c index dc4d3f5ce820..0ae811785c59 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -1227,6 +1227,8 @@ int mod_sysfs_init(struct module *mod) kobject_init(&mod->mkobj.kobj); + /* delay uevent until full sysfs population */ + err = kobject_add(&mod->mkobj.k...
da231fd5d113ab6da5dab7a2d2c38d0a540f939c
Analyze and fix the following issue in the Linux kernel code: Driver core: fix class glue dir cleanup logic
Problem Details: We should remove the glue directory between the class and the bus device _after_ we sent out the 'remove' event for the device, otherwise the parent relationship is no longer valid, and composing the path with deleted sysfs entries will not work. Cc: Alan Stern <stern@rowland.harvard.edu> Signed-off-b...
```diff diff --git a/drivers/base/core.c b/drivers/base/core.c index 22fdf320a2a6..13cae18936c5 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -18,7 +18,7 @@ #include <linux/string.h> #include <linux/kdev_t.h> #include <linux/notifier.h> - +#include <linux/genhd.h> #include <asm/semaphore.h> #incl...
ef2c51746dc89c2326ce522f8fb8a57695780e75
Analyze and fix the following issue in the Linux kernel code: Driver core: fix race in __device_release_driver
Problem Details: This patch (as1013) was suggested by David Woodhouse; it fixes a race in the driver core. If a device is unregistered at the same time as its driver is unloaded, the driver's code pages may be unmapped while the remove method is still running. The calls to get_driver() and put_driver() were intended ...
```diff diff --git a/drivers/base/dd.c b/drivers/base/dd.c index 54922647522d..b0726eb6405e 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c @@ -289,11 +289,10 @@ static void __device_release_driver(struct device * dev) { struct device_driver * drv; - drv = get_driver(dev->driver); + drv = dev->driver; if ...
7dc72b2842381684b864750af31a5fb168dec764
Analyze and fix the following issue in the Linux kernel code: Driver core: clean up debugging messages
Problem Details: The driver core debugging messages are a mess. This provides a unified message that makes them actually useful. The format for new kobject debug messages should be: driver/bus/class: 'OBJECT_NAME': FUNCTION_NAME: message.\n Note, the class code is not changed in this patch due to pending patches in...
```diff diff --git a/drivers/base/bus.c b/drivers/base/bus.c index aa0c986c323a..937fc100b64a 100644 --- a/drivers/base/bus.c +++ b/drivers/base/bus.c @@ -80,7 +80,7 @@ static void driver_release(struct kobject *kobj) { struct driver_private *drv_priv = to_driver(kobj); - pr_debug("%s: freeing %s\n", __FUNCTION__,...
c63469a3985a9771c18a916b8d42845d044ea0b1
Analyze and fix the following issue in the Linux kernel code: Driver core: move the driver specific module code into the driver core
Problem Details: The module driver specific code should belong in the driver core, not in the kernel/ directory. So move this code. This is done in preparation for some struct device_driver rework that should be confined to the driver core code only. This also lets us keep from exporting these functions, as no exter...
```diff diff --git a/drivers/base/Makefile b/drivers/base/Makefile index b39ea3f59c9b..ff2696823f8d 100644 --- a/drivers/base/Makefile +++ b/drivers/base/Makefile @@ -11,6 +11,7 @@ obj-$(CONFIG_FW_LOADER) += firmware_class.o obj-$(CONFIG_NUMA) += node.o obj-$(CONFIG_MEMORY_HOTPLUG_SPARSE) += memory.o obj-$(CONFIG_SM...
c6f7e72a3f4641095ade9ded287d910c980c6148
Analyze and fix the following issue in the Linux kernel code: driver core: remove fields from struct bus_type
Problem Details: struct bus_type is static everywhere in the kernel. This moves the kobject in the structure out of it, and a bunch of other private only to the driver core fields are now moved to a private structure. This lets us dynamically create the backing kobject properly and gives us the chance to be able to d...
```diff diff --git a/drivers/base/base.h b/drivers/base/base.h index 7e309a49a711..ca6d273064f8 100644 --- a/drivers/base/base.h +++ b/drivers/base/base.h @@ -1,6 +1,34 @@ -/* initialisation functions */ +/** + * struct bus_type_private - structure to hold the private to the driver core portions of the bus_type struc...
52840bd628707979b5bbcce3c506786d3a69dba0
Analyze and fix the following issue in the Linux kernel code: Kobject: the cris iop_fw_load.c code is broken
Problem Details: This code is really really really broken. So much so that it's almost impossible to fix with a simple patch, so just comment out the offending registration with the kobject core, and mark the driver as broken. The problem is that the code is trying to register a "raw" struct device, which is not allo...
```diff diff --git a/arch/cris/arch-v32/drivers/iop_fw_load.c b/arch/cris/arch-v32/drivers/iop_fw_load.c index 11f9895ded50..f4bdc1dfa320 100644 --- a/arch/cris/arch-v32/drivers/iop_fw_load.c +++ b/arch/cris/arch-v32/drivers/iop_fw_load.c @@ -20,6 +20,9 @@ #define IOP_TIMEOUT 100 +#error "This driver is broken wit...
81e7c6a636c81d9eeaeaa732bfbace44535fab00
Analyze and fix the following issue in the Linux kernel code: UIO: fix kobject usage
Problem Details: The uio kobject code is "wierd". This patch should hopefully fix it up to be sane and not leak memory anymore. Cc: Kay Sievers <kay.sievers@vrfy.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Benedikt Spranger <b.spranger@linutronix.de> Signed-off-by: Hans J. Koch <hjk@linutronix.de> Signed-off-b...
```diff diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c index 606aae7490ab..acc387de988f 100644 --- a/drivers/uio/uio.c +++ b/drivers/uio/uio.c @@ -34,7 +34,7 @@ struct uio_device { wait_queue_head_t wait; int vma_count; struct uio_info *info; - struct kset map_attr_kset; + struct kobject *map_dir; }; ...
9f66fa2a4690a16da0dbaae2f44ddfc313802504
Analyze and fix the following issue in the Linux kernel code: kobject: clean up debugging messages
Problem Details: The kobject debugging messages are a mess. This provides a unified message that makes them actually useful. The format for new kobject debug messages should be: kobject: 'KOBJECT_NAME' (ADDRESS): FUNCTION_NAME: message.\n Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gre...
```diff diff --git a/lib/kobject.c b/lib/kobject.c index 4d52b6f534bc..1015f74212d0 100644 --- a/lib/kobject.c +++ b/lib/kobject.c @@ -95,7 +95,8 @@ static void fill_kobj_path(struct kobject *kobj, char *path, int length) *(path + --length) = '/'; } - pr_debug("%s: path = '%s'\n",__FUNCTION__,path); + pr_debug("...
cfb36fff45e3997b8044c81045fc4869ba5f281a
Analyze and fix the following issue in the Linux kernel code: kobject: grab the kset reference in kobject_add, not kobject_init
Problem Details: kobject_init should not be grabing any references, but only initializing the object. This patch fixes this, and makes the lock hold-time shorter for when a kset is present in the kobject. The current kernel tree has been audited to verify that this change should be safe. Cc: Kay Sievers <kay.sievers...
```diff diff --git a/lib/kobject.c b/lib/kobject.c index 7919c32a3a15..4d52b6f534bc 100644 --- a/lib/kobject.c +++ b/lib/kobject.c @@ -133,7 +133,6 @@ void kobject_init(struct kobject * kobj) return; kref_init(&kobj->kref); INIT_LIST_HEAD(&kobj->entry); - kobj->kset = kset_get(kobj->kset); } @@ -184,7 +183,...
d76e15fb20eeb7632ef38876a884fe3508b2c01d
Analyze and fix the following issue in the Linux kernel code: driver core: make /sys/power a kobject
Problem Details: /sys/power should not be a kset, that's overkill. This patch renames it to power_kset and fixes up all usages of it in the tree. Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
```diff diff --git a/arch/arm/mach-omap1/pm.c b/arch/arm/mach-omap1/pm.c index 63edafb59490..d9805e3d9304 100644 --- a/arch/arm/mach-omap1/pm.c +++ b/arch/arm/mach-omap1/pm.c @@ -719,7 +719,7 @@ static int __init omap_pm_init(void) omap_pm_init_proc(); #endif - error = sysfs_create_file(&power_kset->kobj, &sleep_w...
9b949165bd4a86c536cb92a9ce4367effbde9079
Analyze and fix the following issue in the Linux kernel code: kobject: convert s390 ipl.c to kobj_attr interface
Problem Details: This makes the code a bit simpler and and gets us one step closer to deleting the deprecated subsys_attr code. NOTE, this needs the next patch in the series in order to work properly. This will build, but the sysfs files will not properly operate. Thanks to Cornelia for the build fix on this patch. ...
```diff diff --git a/arch/s390/kernel/ipl.c b/arch/s390/kernel/ipl.c index cae793af5423..50be9d063d68 100644 --- a/arch/s390/kernel/ipl.c +++ b/arch/s390/kernel/ipl.c @@ -162,22 +162,25 @@ EXPORT_SYMBOL_GPL(diag308); /* SYSFS */ #define DEFINE_IPL_ATTR_RO(_prefix, _name, _format, _value) \ -static ssize_t sys_##_p...
eb41d9465cdafee45e0cb30f3b7338646221908e
Analyze and fix the following issue in the Linux kernel code: fix struct user_info export's sysfs interaction
Problem Details: Clean up the use of ksets and kobjects. Kobjects are instances of objects (like struct user_info), ksets are collections of objects of a similar type (like the uids directory containing the user_info directories). So, use kobjects for the user_info directories, and a kset for the "uids" directory. On ...
```diff diff --git a/include/linux/sched.h b/include/linux/sched.h index cc14656f8682..d6eacda765ca 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -552,18 +552,13 @@ struct user_struct { #ifdef CONFIG_FAIR_USER_SCHED struct task_group *tg; #ifdef CONFIG_SYSFS - struct kset kset; - struct subsys_a...
6dcec2511ff55b4abaca7ad3433011a7c04c2430
Analyze and fix the following issue in the Linux kernel code: kset: convert struct bus_device->drivers to use kset_create
Problem Details: Dynamically create the kset instead of declaring it statically. Having 3 static kobjects in one structure is not only foolish, but ripe for nasty race conditions if handled improperly. We also rename the field to catch any potential users of it (not that there should be outside of the driver core...)...
```diff diff --git a/drivers/base/bus.c b/drivers/base/bus.c index b23eeb2d4ead..6796d3e46053 100644 --- a/drivers/base/bus.c +++ b/drivers/base/bus.c @@ -638,7 +638,7 @@ int bus_add_driver(struct device_driver *drv) error = kobject_set_name(&drv->kobj, "%s", drv->name); if (error) goto out_put_bus; - drv->kobj....
3d8995963dfec66ef6270e729bf75903e9043f9d
Analyze and fix the following issue in the Linux kernel code: kset: convert struct bus_device->devices to use kset_create
Problem Details: Dynamically create the kset instead of declaring it statically. Having 3 static kobjects in one structure is not only foolish, but ripe for nasty race conditions if handled improperly. We also rename the field to catch any potential users of it (not that there should be outside of the driver core...)...
```diff diff --git a/drivers/base/bus.c b/drivers/base/bus.c index e3b101077804..b23eeb2d4ead 100644 --- a/drivers/base/bus.c +++ b/drivers/base/bus.c @@ -449,7 +449,7 @@ int bus_add_device(struct device * dev) error = device_add_attrs(bus, dev); if (error) goto out_put; - error = sysfs_create_link(&bus->dev...
9b477705360c16198d7a4bd73d199f5a957585b0
Analyze and fix the following issue in the Linux kernel code: kobject: convert s390 hypervisor to use kobject_create
Problem Details: We don't need a kset here, a simple kobject will do just fine, so dynamically create the kobject and use it. Thanks to Cornelia for the build fix. Cc: Kay Sievers <kay.sievers@vrfy.org> Cc: Michael Holzheu <holzheu@de.ibm.com> Cc: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Greg Kroah-Har...
```diff diff --git a/arch/s390/hypfs/inode.c b/arch/s390/hypfs/inode.c index b0ad479e7487..631a6109f642 100644 --- a/arch/s390/hypfs/inode.c +++ b/arch/s390/hypfs/inode.c @@ -490,7 +490,7 @@ static struct super_operations hypfs_s_ops = { .show_options = hypfs_show_options, }; -static decl_subsys(s390, NULL); +stat...
3514faca19a6fdc209734431c509631ea92b094e
Analyze and fix the following issue in the Linux kernel code: kobject: remove struct kobj_type from struct kset
Problem Details: We don't need a "default" ktype for a kset. We should set this explicitly every time for each kset. This change is needed so that we can make ksets dynamic, and cleans up one of the odd, undocumented assumption that the kset/kobject/ktype model has. This patch is based on a lot of help from Kay Siev...
```diff diff --git a/arch/powerpc/platforms/pseries/power.c b/arch/powerpc/platforms/pseries/power.c index 73e69023d90a..08d7a5007167 100644 --- a/arch/powerpc/platforms/pseries/power.c +++ b/arch/powerpc/platforms/pseries/power.c @@ -57,7 +57,7 @@ static struct subsys_attribute auto_poweron_attr = { }; #ifndef CON...
663a47430b361f863b515752a97166a7a4b92d35
Analyze and fix the following issue in the Linux kernel code: kobject: fix up kobject_set_name to use kvasprintf
Problem Details: Kay pointed out that kobject_set_name was being very stupid, doing two allocations for every call, when it should just be using the kernel function kvasprintf() instead. This change adds the internal kobject_set_name_vargs() function, which other follow-on patches will be using. Cc: Kay Sievers <kay....
```diff diff --git a/lib/kobject.c b/lib/kobject.c index 9500339ae024..4a310e55a886 100644 --- a/lib/kobject.c +++ b/lib/kobject.c @@ -232,60 +232,53 @@ int kobject_register(struct kobject * kobj) return error; } +/** + * kobject_set_name_vargs - Set the name of an kobject + * @kobj: struct kobject to set the name...
9fd5b1c906a9b4b0efb24cb2b4d20c678ff26122
Analyze and fix the following issue in the Linux kernel code: sysfs: Fix a copy-n-paste typo in comment
Problem Details: Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
```diff diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c index f281cc6584b0..4948d9bc405d 100644 --- a/fs/sysfs/dir.c +++ b/fs/sysfs/dir.c @@ -440,7 +440,7 @@ int sysfs_add_one(struct sysfs_addrm_cxt *acxt, struct sysfs_dirent *sd) /** * sysfs_remove_one - remove sysfs_dirent from parent * @acxt: addrm context to use ...
88c3f7a8f2c86be264d326cf6f49a3e8c30d13a6
Analyze and fix the following issue in the Linux kernel code: Security: remove security_file_mmap hook sparse-warnings (NULL as 0).
Problem Details: Fixing: CHECK mm/mmap.c mm/mmap.c:1623:29: warning: Using plain integer as NULL pointer mm/mmap.c:1623:29: warning: Using plain integer as NULL pointer mm/mmap.c:1944:29: warning: Using plain integer as NULL pointer Signed-off-by: Richard Knutsson <ricknu-0@student.ltu.se> Signed-off-by: James Mor...
```diff diff --git a/mm/mmap.c b/mm/mmap.c index 15678aa6ec73..bfa389fc6ded 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -1620,7 +1620,7 @@ static inline int expand_downwards(struct vm_area_struct *vma, return -ENOMEM; address &= PAGE_MASK; - error = security_file_mmap(0, 0, 0, 0, address, 1); + error = security_fi...
5c5e32ceeb6b64496a1842d5d99e4ac8d20166c4
Analyze and fix the following issue in the Linux kernel code: mount options: fix jfs
Problem Details: Add iocharset= and errors= options to /proc/mounts for jfs filesystems. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Signed-off-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
```diff diff --git a/fs/jfs/super.c b/fs/jfs/super.c index 314bb4ff1ba8..70a14001c98f 100644 --- a/fs/jfs/super.c +++ b/fs/jfs/super.c @@ -598,6 +598,12 @@ static int jfs_show_options(struct seq_file *seq, struct vfsmount *vfs) seq_printf(seq, ",umask=%03o", sbi->umask); if (sbi->flag & JFS_NOINTEGRITY) seq_put...
feed9bab7b14b77be8d796bcee95e2343fb82955
Analyze and fix the following issue in the Linux kernel code: spi: omap2_mcspi PIO RX fix
Problem Details: Before transmission of the last word in PIO RX_ONLY mode rx+tx mode is enabled: /* prevent last RX_ONLY read from triggering * more word i/o: switch to rx+tx */ if (c == 0 && tx == NULL) mcspi_write_cs_reg(spi, OMAP2_MCSPI_CHCONF0, l); But because c is decremented after the test, c will n...
```diff diff --git a/drivers/spi/omap2_mcspi.c b/drivers/spi/omap2_mcspi.c index 3cdab131c4a9..ea61724ae225 100644 --- a/drivers/spi/omap2_mcspi.c +++ b/drivers/spi/omap2_mcspi.c @@ -350,6 +350,7 @@ omap2_mcspi_txrx_pio(struct spi_device *spi, struct spi_transfer *xfer) tx = xfer->tx_buf; do { + c -= 1; i...
c5c99429fa57dcf6e05203ebe3676db1ec646793
Analyze and fix the following issue in the Linux kernel code: fix hugepages leak due to pagetable page sharing
Problem Details: The shared page table code for hugetlb memory on x86 and x86_64 is causing a leak. When a user of hugepages exits using this code the system leaks some of the hugepages. ------------------------------------------------------- Part of /proc/meminfo just before database startup: HugePages_Total: 5500 ...
```diff diff --git a/mm/hugetlb.c b/mm/hugetlb.c index e0fda156f021..db861d8b6c28 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -699,6 +699,11 @@ int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src, dst_pte = huge_pte_alloc(dst, addr); if (!dst_pte) goto nomem; + + /* If the pagetables...
fabe874a48de45b137f99b4ed3641e0413f465ce
Analyze and fix the following issue in the Linux kernel code: lockdep: fix kernel crash on module unload
Problem Details: Michael Wu noticed in his lkml post at http://marc.info/?l=linux-kernel&m=119396182726091&w=2 that certain wireless drivers ended up having their name in module memory, which would then crash the kernel on module unload. The patch he proposed was a bit clumsy in that it increased the size of a l...
```diff diff --git a/kernel/lockdep.c b/kernel/lockdep.c index 4335f12a27c6..e2c07ece367d 100644 --- a/kernel/lockdep.c +++ b/kernel/lockdep.c @@ -2932,7 +2932,7 @@ static void zap_class(struct lock_class *class) } -static inline int within(void *addr, void *start, unsigned long size) +static inline int within(con...
fccd5d00ba68455425a35f905fd92538429c310d
Analyze and fix the following issue in the Linux kernel code: sony-laptop: fix scancode decode
Problem Details: compare against the sony_laptop specific event list index to decode the input scancode to send. Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Len Brown <len.brown@intel.com>
```diff diff --git a/drivers/misc/sony-laptop.c b/drivers/misc/sony-laptop.c index 70d5cc5969aa..899e3f75f288 100644 --- a/drivers/misc/sony-laptop.c +++ b/drivers/misc/sony-laptop.c @@ -315,7 +315,7 @@ static void sony_laptop_report_input_event(u8 event) break; default: - if (event > ARRAY_SIZE (sony_laptop_in...
ec68373c04495edbe39fb94fad963fb781e062e5
Analyze and fix the following issue in the Linux kernel code: Revert "ACPI: Fan: Drop force_power_state acpi_device option"
Problem Details: This reverts commit 93ad7c07ad487b036add8760dabcc35666a550ef. http://bugzilla.kernel.org/show_bug.cgi?id=9798 Signed-off-by: Len Brown <len.brown@intel.com>
```diff diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index d7a115c362d1..f4487c38d9f2 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -200,7 +200,7 @@ int acpi_bus_set_power(acpi_handle handle, int state) * Get device's current power state */ acpi_bus_get_power(device->handle, &device->power...
d772b3b323a15588a757f5af28e51a57d0d2f622
Analyze and fix the following issue in the Linux kernel code: ACPI: EC: "DEBUG" needs to be defined earlier
Problem Details: The "DEBUG" symbol needs to be defined before #including <linux/kernel.h> to get the pr_debug() working. Signed-off-by: Márton Németh <nm127@freemail.hu> Signed-off-by: Len Brown <len.brown@intel.com>
```diff diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index 06c9f3520daa..987b967c7467 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c @@ -26,6 +26,9 @@ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +/* Uncomment next line to get verbose print outs*/ +/* #define DEBUG...
86dae0154a49b67c908faffeb33ba37eddceba74
Analyze and fix the following issue in the Linux kernel code: ACPI: EC: add leading zeros to debug messages
Problem Details: Add leading zeros to pr_debug() calls. For example if x=0x0a, the format "0x%2x" will result the string "0x a", the format "0x%2.2x" will result "0x0a". Signed-off-by: Márton Németh <nm127@freemail.hu> Signed-off-by: Len Brown <len.brown@intel.com>
```diff diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index 8917d754020e..06c9f3520daa 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c @@ -139,26 +139,26 @@ static struct acpi_ec { static inline u8 acpi_ec_read_status(struct acpi_ec *ec) { u8 x = inb(ec->command_addr); - pr_debug(PREFIX "---> status = 0...
03d1d99c55649ca641b86d2e3489b167ede1671a
Analyze and fix the following issue in the Linux kernel code: ACPI: EC: fix dmesg spam regression
Problem Details: Return OBF_1 optimization workaround http://bugzilla.kernel.org/show_bug.cgi?id=8459 Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
```diff diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index 97dc16155a55..8917d754020e 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c @@ -82,6 +82,7 @@ enum { EC_FLAGS_ADDRESS, /* Address is being written */ EC_FLAGS_NO_WDATA_GPE, /* Don't expect WDATA GPE event */ EC_FLAGS_WDATA, /* Data is bein...
1dd4561e7d9b907afd10709f9ff092861e8ab095
Analyze and fix the following issue in the Linux kernel code: [POWERPC] Fix compile error if CONFIG_STX_GP3 is defined
Problem Details: cpmux is need in all cases, having wrapped by the ifndef CONFIG_STX_GP3 was causing a compile error. Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
```diff diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm2.c b/drivers/serial/cpm_uart/cpm_uart_cpm2.c index def01582de5c..d9af06a791ba 100644 --- a/drivers/serial/cpm_uart/cpm_uart_cpm2.c +++ b/drivers/serial/cpm_uart/cpm_uart_cpm2.c @@ -165,9 +165,9 @@ void scc2_lineif(struct uart_cpm_port *pinfo) * really has to ...
5febf1cd79425d3c65d9a66a2299f0d06dc4b1eb
Analyze and fix the following issue in the Linux kernel code: [RAPIDIO] Fix compile error and warning
Problem Details: drivers/rapidio/rio.c: In function 'rio_get_asm': drivers/rapidio/rio.c:413: error: implicit declaration of function 'in_interrupt' drivers/rapidio/rio.c: In function 'rio_init_mports': drivers/rapidio/rio.c:480: warning: format '%8.8lx' expects type 'long unsigned int', but argument 2 has type 'resour...
```diff diff --git a/drivers/rapidio/rio.c b/drivers/rapidio/rio.c index f644807da2f9..80c5f1ba2e49 100644 --- a/drivers/rapidio/rio.c +++ b/drivers/rapidio/rio.c @@ -23,6 +23,7 @@ #include <linux/module.h> #include <linux/spinlock.h> #include <linux/slab.h> +#include <linux/interrupt.h> #include "rio.h" @@ -47...
de7566bff359bbd7f6a4a37b4b5ce93225067786
Analyze and fix the following issue in the Linux kernel code: [POWERPC] 8xx: adder875 - Fix flash bus-width and remove duplicate __initdata
Problem Details: Signed-off-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
```diff diff --git a/arch/powerpc/boot/dts/adder875-redboot.dts b/arch/powerpc/boot/dts/adder875-redboot.dts index 8f7a79ffa3bf..930bfb3894eb 100644 --- a/arch/powerpc/boot/dts/adder875-redboot.dts +++ b/arch/powerpc/boot/dts/adder875-redboot.dts @@ -62,7 +62,7 @@ flash@0,0 { compatible = "cfi-flash"; reg = ...
6c7e072b1682eeb7c17ed5fdec0672fcf3ccb205
Analyze and fix the following issue in the Linux kernel code: [POWERPC] fsl_soc: Fix get_immrbase() to use ranges, rather than reg.
Problem Details: Don't depend on the reg property as a way to determine the base of the immr space. The reg property might be defined differently for different SoC families. Signed-off-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
```diff diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c index 474cb8e22f64..f2c0988a03b8 100644 --- a/arch/powerpc/sysdev/fsl_soc.c +++ b/arch/powerpc/sysdev/fsl_soc.c @@ -55,10 +55,18 @@ phys_addr_t get_immrbase(void) soc = of_find_node_by_type(NULL, "soc"); if (soc) { int size; - co...
e3bc3a09bdfc1b3b88b32d7960c4c3b84a2b860f
Analyze and fix the following issue in the Linux kernel code: [POWERPC] Fix carry bug in 128-bit unsigned integer adding
Problem Details: Synchronize it to the definition in include/math-emu/op-4.h for short term. Signed-off-by: Liu Yu <Yu.Liu@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
```diff diff --git a/arch/powerpc/math-emu/op-4.h b/arch/powerpc/math-emu/op-4.h index fcdd6d064c54..c9ae626070da 100644 --- a/arch/powerpc/math-emu/op-4.h +++ b/arch/powerpc/math-emu/op-4.h @@ -194,19 +194,39 @@ (X##_f[3] = I3, X##_f[2] = I2, X##_f[1] = I1, X##_f[0] = I0) #ifndef __FP_FRAC_ADD_4 -#define __FP_FR...
93967ae20a04f77effe5e3106d98790d19796195
Analyze and fix the following issue in the Linux kernel code: [POWERPC] Fix incorrect interrupt map on FSL reference boards
Problem Details: The ULI based boards had the interrupt maps for USB on the ULI incorrectly set. Also, the MPC8572DS was missing the interrupt-map-mask for the 3rd PCIe controller. Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
```diff diff --git a/arch/powerpc/boot/dts/mpc8544ds.dts b/arch/powerpc/boot/dts/mpc8544ds.dts index 54b3bdf7fc97..688af9d06382 100644 --- a/arch/powerpc/boot/dts/mpc8544ds.dts +++ b/arch/powerpc/boot/dts/mpc8544ds.dts @@ -304,9 +304,9 @@ interrupt-map = < // IDSEL 0x1c USB e000 0 0 1 &i8259 c 2 - e100 0 ...
f98eeb4eb1c52de89dcefeb538029bcecc6dd42d
Analyze and fix the following issue in the Linux kernel code: [POWERPC] Fix handling of memreserve if the range lands in highmem
Problem Details: There were several issues if a memreserve range existed and happened to be in highmem: * The bootmem allocator is only aware of lowmem so calling reserve_bootmem with a highmem address would cause a BUG_ON * All highmem pages were provided to the buddy allocator Added a lmb_is_reserved() api that w...
```diff diff --git a/arch/powerpc/mm/lmb.c b/arch/powerpc/mm/lmb.c index 8f4d2dc4cafb..4ce23bcf8a57 100644 --- a/arch/powerpc/mm/lmb.c +++ b/arch/powerpc/mm/lmb.c @@ -342,3 +342,16 @@ void __init lmb_enforce_memory_limit(unsigned long memory_limit) } } } + +int __init lmb_is_reserved(unsigned long addr) +{ + int ...
e2d435ea4084022ab88efa74214accb45b1f9e92
Analyze and fix the following issue in the Linux kernel code: [SCSI] initio: fix module hangs on loading
Problem Details: I've verified (on my Initio 9100 with a DAT drive) that the 2.6.24-rc8-git6 initio module still hangs on loading. These fixes (other than the printk) are needed to get the module to load ok (and work correctly) with my adapter & tape drive. a) printk cosmetic fix b) cblk->sglen needs setting for lat...
```diff diff --git a/drivers/scsi/initio.c b/drivers/scsi/initio.c index 01bf0189367d..a10a5c74b48d 100644 --- a/drivers/scsi/initio.c +++ b/drivers/scsi/initio.c @@ -823,7 +823,7 @@ static void initio_append_busy_scb(struct initio_host * host, struct scsi_ctrl_b { #if DEBUG_QUEUE - printk("append busy SCB %o; ", s...
a43cf0f3511585493e3c948f7ec62f659486d0b3
Analyze and fix the following issue in the Linux kernel code: [SCSI] NCR5380: fix section mismatch
Problem Details: Many release() methods that are not __exit or __devexit call this __devexit function, so remove its "__devexit" attribute. scsi/g_NCR5380.c: WARNING: vmlinux.o(.text+0xadaf8c): Section mismatch: reference to .exit.text:NCR5380_exit (between 'generic_NCR5380_release_resources' and 'generic_NCR5380_bios...
```diff diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c index c1fb33292e56..eeddbd19eba5 100644 --- a/drivers/scsi/NCR5380.c +++ b/drivers/scsi/NCR5380.c @@ -932,7 +932,7 @@ static int __devinit NCR5380_init(struct Scsi_Host *instance, int flags) * @instance: adapter to remove */ -static void __devex...
02f8a8586574350a1f3c2cee79cbc0faf630961d
Analyze and fix the following issue in the Linux kernel code: ACPI: Check for any matching CID when walking namespace.
Problem Details: The callback function acpi_ns_get_device_callback called from acpi_get_devices() will check CID's if the HID does not match. This code has a bug where it requires that all CIDs match the HID. Changed the code so that any CID match will do. Signed-off-by: Andrew Patterson <andrew.patterson@hp.com> Sig...
```diff diff --git a/drivers/acpi/namespace/nsxfeval.c b/drivers/acpi/namespace/nsxfeval.c index f39fbc6b9237..b92133faf5b7 100644 --- a/drivers/acpi/namespace/nsxfeval.c +++ b/drivers/acpi/namespace/nsxfeval.c @@ -443,6 +443,7 @@ acpi_ns_get_device_callback(acpi_handle obj_handle, struct acpica_device_id hid; stru...
53474c042c0e1be39557474c945ad4a8e653ad46
Analyze and fix the following issue in the Linux kernel code: [SCSI] sg: fix /proc/scsi/sg/devices when no SCSI devices
Problem Details: The patch "[SCSI] sg: use idr to replace static arrays" in 2.6.24-rc1 causes a bogus line to appear in /proc/scsi/sg/devices containing "-1 -1 -1 -1 -1 -1 -1 -1 -1" when there are no SCSI devices in the system. In 2.6.23, /proc/scsi/sg/devices is empty when there are no SCSI devices in the system. A ...
```diff diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index 78ac48df4de8..17216b76efdc 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c @@ -2529,7 +2529,7 @@ sg_idr_max_id(int id, void *p, void *data) static int sg_last_dev(void) { - int k = 0; + int k = -1; unsigned long iflags; read_lock_irqsave(&...
a0899d4df534d2bcf671b0f647b809842309a9ae
Analyze and fix the following issue in the Linux kernel code: [SCSI] sd: add fix for devices with last sector access problems
Problem Details: This patch adds a new scsi_device flag (last_sector_bug) for devices which contain a bug where the device crashes when the last sector is read in a larger then 1 sector read. This is for example the case with sdcards in the HP PSC1350 printer cardreader and in the HP PSC1610 printer cardreader. Signe...
```diff diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 212f6bcfd457..24eba3118b5a 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -395,6 +395,15 @@ static int sd_prep_fn(struct request_queue *q, struct request *rq) goto out; } + /* + * Some devices (some sdcards for one) don't like it if the...
b523381e325366cc54a2548df418c2a427b2f2ee
Analyze and fix the following issue in the Linux kernel code: [SCSI] fix pcmcia compile problem
Problem Details: This patch commit 8ae732a91df051aba6820068a47b631a06599d84 Author: Tejun Heo <htejun@gmail.com> Date: Fri Dec 7 22:36:23 2007 +0900 [SCSI] make pcmcia directory use obj-y|m instead of subdir-y|m Moved the scsi Makefile into conformance, but also caused the pcmcia subdirectory to get built in f...
```diff diff --git a/drivers/scsi/pcmcia/Kconfig b/drivers/scsi/pcmcia/Kconfig index fa481b515ead..53857c6b6d4d 100644 --- a/drivers/scsi/pcmcia/Kconfig +++ b/drivers/scsi/pcmcia/Kconfig @@ -6,7 +6,8 @@ menuconfig SCSI_LOWLEVEL_PCMCIA bool "PCMCIA SCSI adapter support" depends on SCSI!=n && PCMCIA!=n -if SCSI_LOW...
2ca39c48ea0d2fd265479d0b62f2ac8878900360
Analyze and fix the following issue in the Linux kernel code: [SCSI] aacraid: add new driver features flags
Problem Details: Feature enhancement, adding a 'flags' entry that will reside in the host controller's tree, with a newline separated list of arbitrary ascii named features that indicate whether the combination of driver and controller has support for said feature. Breaking from the one-line output typical of sysfs ent...
```diff diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c index 6650f6fa9890..5ab733d4faf4 100644 --- a/drivers/scsi/aacraid/linit.c +++ b/drivers/scsi/aacraid/linit.c @@ -790,6 +790,23 @@ static ssize_t aac_show_vendor(struct class_device *class_dev, return len; } +static ssize_t aac_show_f...
3776541d8a46347a4924353a192c6ce4a3d04e2e
Analyze and fix the following issue in the Linux kernel code: [SCSI] qla2xxx: Fix for 32-bit platforms with 64-bit resources.
Problem Details: The driver stores the contents of PCI resources into unsigned long's before ioremapping. This breaks on 32-bit platforms which support 64-bit MMIO resources. Correct code by removing the temporary variables used during MMIO PIO mapping and using resource_size_t where applicable. Also correct a small ...
```diff diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index a33d3d57a17e..d0b78af60f7b 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -2271,8 +2271,7 @@ typedef struct scsi_qla_host { int bars; device_reg_t __iomem *iobase; /* Base I/O address ...
d496f94d22d1491ffb25f4000e85f7a4ecf7f2c4
Analyze and fix the following issue in the Linux kernel code: [SCSI] aacraid: fix security weakness
Problem Details: Actually there are several but one is trivially fixed 1. FSACTL_GET_NEXT_ADAPTER_FIB ioctl does not lock dev->fib_list but needs to 2. Ditto for FSACTL_CLOSE_GET_ADAPTER_FIB 3. It is possible to construct an attack via the SRB ioctls where the user obtains assorted elevated privileges. Various approac...
```diff diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c index 0523cc6d895c..143e4c16b079 100644 --- a/drivers/scsi/aacraid/linit.c +++ b/drivers/scsi/aacraid/linit.c @@ -517,6 +517,8 @@ static struct device_attribute *aac_dev_attrs[] = { static int aac_ioctl(struct scsi_device *sdev, int cmd, ...
382db811a8cc1427efabdc959cd1aeef8685ffa6
Analyze and fix the following issue in the Linux kernel code: [SCSI] megaraid: fix section mismatch
Problem Details: Change megaraid_pci_driver_g variable name so that it matches the modpost whitelist that allows pointers to init text/data. WARNING: vmlinux.o(.data+0x1a8e30): Section mismatch: reference to .init.text:megaraid_probe_one (between 'megaraid_pci_driver_g' and 'class_device_attr_megaraid_mbox_app_hndl') ...
```diff diff --git a/drivers/scsi/megaraid/megaraid_mbox.c b/drivers/scsi/megaraid/megaraid_mbox.c index c8923108183a..24e32e446e76 100644 --- a/drivers/scsi/megaraid/megaraid_mbox.c +++ b/drivers/scsi/megaraid/megaraid_mbox.c @@ -300,7 +300,7 @@ static struct pci_device_id pci_id_table_g[] = { MODULE_DEVICE_TABLE(pc...
cc75e8ab6f262a3ea60e8d8268f48da5365f2823
Analyze and fix the following issue in the Linux kernel code: [SCSI] libsas: fix sense_buffer overrun
Problem Details: Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
```diff diff --git a/drivers/scsi/libsas/sas_scsi_host.c b/drivers/scsi/libsas/sas_scsi_host.c index b784089b18d0..828fed1114ee 100644 --- a/drivers/scsi/libsas/sas_scsi_host.c +++ b/drivers/scsi/libsas/sas_scsi_host.c @@ -108,7 +108,7 @@ static void sas_scsi_task_done(struct sas_task *task) break; case SAM_CHEC...