id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
b9732ca1cb2c18129d2f984b8de02db141b7b830
Analyze and fix the following issue in the Linux kernel code: [S390] sclp: fix possible deadlock on cpu rescan.
Problem Details: smp_rescan_cpus() calls get_online_cpus() from a multithreaded workqueue context. This may deadlock. This is the same bug as in arch/s390/kernel/topology.c. This patch can be reverted as soon as Oleg's patch gets merged. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin S...
```diff diff --git a/drivers/s390/char/sclp_config.c b/drivers/s390/char/sclp_config.c index ad05a87bc480..7c9b39cee595 100644 --- a/drivers/s390/char/sclp_config.c +++ b/drivers/s390/char/sclp_config.c @@ -8,6 +8,7 @@ #include <linux/init.h> #include <linux/errno.h> #include <linux/cpu.h> +#include <linux/kthread.h...
727c6742c29e46177951fdc8f6758085e03bb981
Analyze and fix the following issue in the Linux kernel code: pcmcia: Fix ide-cs sparse warning
Problem Details: Sparse shows the following warning: CHECK drivers/ide/legacy/ide-cs.c drivers/ide/legacy/ide-cs.c:378:6: warning: symbol 'ide_release' was not declared. Should it be static? Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> CC: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Signed-off-by: D...
```diff diff --git a/drivers/ide/legacy/ide-cs.c b/drivers/ide/legacy/ide-cs.c index 8b8b20d86915..99af3bb6c461 100644 --- a/drivers/ide/legacy/ide-cs.c +++ b/drivers/ide/legacy/ide-cs.c @@ -376,7 +376,7 @@ failed: ======================================================================*/ -void ide_release(struct pc...
32b23e9a7331fce57eb0af52e19e8409fdef831b
Analyze and fix the following issue in the Linux kernel code: x86: max_low_pfn_mapped fix #4
Problem Details: only add direct mapping for aperture Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com> Cc: Suresh Siddha <suresh.b.siddha@intel.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
```diff diff --git a/arch/x86/kernel/pci-gart_64.c b/arch/x86/kernel/pci-gart_64.c index a614ee10f846..c3fe78406d18 100644 --- a/arch/x86/kernel/pci-gart_64.c +++ b/arch/x86/kernel/pci-gart_64.c @@ -679,11 +679,8 @@ static __init int init_k8_gatt(struct agp_kern_info *info) /* need to map that range */ end_pfn = (a...
94a8c3c2437c8946f1b6c8e0b2c560a7db8ed3c6
Analyze and fix the following issue in the Linux kernel code: x86: let 32bit use apic_ops too - fix
Problem Details: fix for pv - clean up the namespace there too. Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com> Cc: Suresh Siddha <suresh.b.siddha@intel.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
```diff diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c index 4f29ff847ebe..e0f139106c7e 100644 --- a/arch/x86/kernel/paravirt.c +++ b/arch/x86/kernel/paravirt.c @@ -360,11 +360,6 @@ struct pv_cpu_ops pv_cpu_ops = { struct pv_apic_ops pv_apic_ops = { #ifdef CONFIG_X86_LOCAL_APIC -#ifndef CONFIG...
9e4641541e9681a568483133813332cfafa34d86
Analyze and fix the following issue in the Linux kernel code: ALSA: hda - Fix FSC V5505 model
Problem Details: model=laptop-hpmicsense matches better to FSC V5505 laptop. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
```diff diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index 8295994665e7..7c1eb23f0cec 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c @@ -910,7 +910,8 @@ static struct snd_pci_quirk cxt5045_cfg_tbl[] = { SND_PCI_QUIRK(0x152d, 0x0753, "Benq R55E", CXT504...
86376df6ad0f1a7a1118cd53b0cfd679524f5436
Analyze and fix the following issue in the Linux kernel code: ALSA: hda - Fix missing init for unsol events on micsense model
Problem Details: Fixed the missing initialization for unsolicited events on Cx5045 micsense model. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
```diff diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index 71c4072c9266..8295994665e7 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c @@ -962,6 +962,7 @@ static int patch_cxt5045(struct hda_codec *codec) codec->patch_ops.init = cxt5045_init; break; ...
4090dffb1438e03a434e3747b14321440561d956
Analyze and fix the following issue in the Linux kernel code: ALSA: hda - Fix internal mic vref pin setup
Problem Details: Set the vref80 to the internal mic pin 0x12 for Cx5045. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
```diff diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index 95e3367d8879..71c4072c9266 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c @@ -686,7 +686,7 @@ static struct snd_kcontrol_new cxt5045_mixers_hp530[] = { static struct hda_verb cxt5045_init_verb...
404571525db92bafeddb0cf9febb21aac6613dca
Analyze and fix the following issue in the Linux kernel code: [CRIS] Rename boot-linkscripts and fix the path to them.
Problem Details: This makes the CRIS-port directories follow the same naming convention as the rest of the kernel. Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com>
```diff diff --git a/arch/cris/arch-v10/boot/compressed/Makefile b/arch/cris/arch-v10/boot/compressed/Makefile index 08d943ce4be7..6fe0ffaf3be6 100644 --- a/arch/cris/arch-v10/boot/compressed/Makefile +++ b/arch/cris/arch-v10/boot/compressed/Makefile @@ -4,7 +4,7 @@ asflags-y += $(LINUXINCLUDE) ccflags-y += -O2 $(L...
93cbace7a058bce7f99319ef6ceff4b78cf45051
Analyze and fix the following issue in the Linux kernel code: security: remove dummy module fix
Problem Details: Fix small oversight in "security: remove dummy module": CONFIG_SECURITY_FILE_CAPABILITIES doesn't depend on CONFIG_SECURITY Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Signed-off-by: James Morris <jmorris@namei.org>
```diff diff --git a/security/Kconfig b/security/Kconfig index 77def9f9f5f5..62ed4717d334 100644 --- a/security/Kconfig +++ b/security/Kconfig @@ -75,7 +75,7 @@ config SECURITY_NETWORK_XFRM config SECURITY_FILE_CAPABILITIES bool "File POSIX Capabilities (EXPERIMENTAL)" - depends on SECURITY && EXPERIMENTAL + depen...
65fc7668006b537f7ae8451990c0ed9ec882544e
Analyze and fix the following issue in the Linux kernel code: security: fix return of void-valued expressions
Problem Details: Fix several warnings generated by sparse of the form "returning void-valued expression". Signed-off-by: James Morris <jmorris@namei.org> Acked-by: Casey Schaufler <casey@schaufler-ca.com> Acked-by: Serge Hallyn <serue@us.ibm.com>
```diff diff --git a/security/security.c b/security/security.c index c4507ce2a5a0..2c0a5876b939 100644 --- a/security/security.c +++ b/security/security.c @@ -895,7 +895,7 @@ EXPORT_SYMBOL(security_secctx_to_secid); void security_release_secctx(char *secdata, u32 seclen) { - return security_ops->release_secctx(secd...
cea78dc4ca044e9666e8f5d797ec50ab85253e49
Analyze and fix the following issue in the Linux kernel code: SELinux: fix off by 1 reference of class_to_string in context_struct_compute_av
Problem Details: The class_to_string array is referenced by tclass. My code mistakenly was using tclass - 1. If the proceeding class is a userspace class rather than kernel class this may cause a denial/EINVAL even if unknown handling is set to allow. The bug shouldn't be allowing excess privileges since those are g...
```diff diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c index d06df335ee7b..f26a8cad06e7 100644 --- a/security/selinux/ss/services.c +++ b/security/selinux/ss/services.c @@ -325,7 +325,7 @@ static int context_struct_compute_av(struct context *scontext, goto inval_class; if (unlikely(tc...
59dbd1ba9847837aa7095f3e4a29599dae412ac4
Analyze and fix the following issue in the Linux kernel code: selinux: fix endianness bug in network node address handling
Problem Details: Fix an endianness bug in the handling of network node addresses by SELinux. This yields no change on little endian hardware but fixes the incorrect handling on big endian hardware. The network node addresses are stored in network order in memory by checkpolicy, not in cpu/host order, and thus should ...
```diff diff --git a/security/selinux/ss/policydb.c b/security/selinux/ss/policydb.c index 84f8cc73c7db..2391761ae422 100644 --- a/security/selinux/ss/policydb.c +++ b/security/selinux/ss/policydb.c @@ -1478,7 +1478,8 @@ int policydb_read(struct policydb *p, void *fp) struct ocontext *l, *c, *newc; struct genfs *ge...
f5269710789f666a65cf1132c4f1d14fbc8d3c29
Analyze and fix the following issue in the Linux kernel code: SELinux: keep the code clean formating and syntax
Problem Details: Formatting and syntax changes whitespace, tabs to spaces, trailing space put open { on same line as struct def remove unneeded {} after if statements change printk("Lu") to printk("llu") convert asm/uaccess.h to linux/uaacess.h includes remove unnecessary asm/bug.h includes convert all users of simple...
```diff diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 59c6e98f7bea..eca70f42e678 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -53,7 +53,7 @@ #include <net/tcp.h> /* struct or_callable used in sock_rcv_skb */ #include <net/net_namespace.h> #include <net/netlabel.h>...
9a59daa03df72526d234b91dd3e32ded5aebd3ef
Analyze and fix the following issue in the Linux kernel code: SELinux: fix sleeping allocation in security_context_to_sid
Problem Details: Fix a sleeping function called from invalid context bug by moving allocation to the callers prior to taking the policy rdlock. Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov> Signed-off-by: James Morris <jmorris@namei.org>
```diff diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c index b86ac9da6cf3..2d5e5a3a8aa9 100644 --- a/security/selinux/ss/services.c +++ b/security/selinux/ss/services.c @@ -730,15 +730,16 @@ int security_sid_to_context_force(u32 sid, char **scontext, u32 *scontext_len) return security_si...
199a952876adbfc2b6c13b8b07adabebf4ff54b2
Analyze and fix the following issue in the Linux kernel code: rcu classic: update qlen when cpu offline
Problem Details: When callbacks are moved from offline cpu to this cpu, the qlen field of this rdp should be updated. [ Paul E. McKenney: ] The effect of this bug would be for force_quiescent_state() to be invoked when it should not and vice versa -- wasting cycles in the first case and letting RCU callbacks remain p...
```diff diff --git a/kernel/rcuclassic.c b/kernel/rcuclassic.c index 214e1cde9812..529190c485fd 100644 --- a/kernel/rcuclassic.c +++ b/kernel/rcuclassic.c @@ -387,6 +387,10 @@ static void __rcu_offline_cpu(struct rcu_data *this_rdp, rcu_move_batch(this_rdp, rdp->donelist, rdp->donetail); rcu_move_batch(this_rdp, rd...
ec229e830060091b9be63c8f873c1b2407a82821
Analyze and fix the following issue in the Linux kernel code: devcgroup: fix permission check when adding entry to child cgroup
Problem Details: # cat devices.list c 1:3 r # echo 'c 1:3 w' > sub/devices.allow # cat sub/devices.list c 1:3 w As illustrated, the parent group has no write permission to /dev/null, so it's child should not be allowed to add this write permission. Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Acked-by: Serge Hal...
```diff diff --git a/security/device_cgroup.c b/security/device_cgroup.c index 1e2e28afba45..ddd92cec78ed 100644 --- a/security/device_cgroup.c +++ b/security/device_cgroup.c @@ -300,7 +300,7 @@ static int may_access_whitelist(struct dev_cgroup *c, continue; if (whitem->minor != ~0 && whitem->minor != refwh->min...
b552c6231f19d50165bbf59e8b34d3f713ab5c01
Analyze and fix the following issue in the Linux kernel code: dccp ccid-3: Fix a loss detection bug
Problem Details: This fixes a bug in the logic of the TFRC loss detection: * new_loss_indicated() should not be called while a loss is pending; * but the code allows this; * thus, for two subsequent gaps in the sequence space, when loss_count has not yet reached NDUPACK=3, the loss_count is falsely reduced to 1. ...
```diff diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c index 523db262c18f..f6756e0c9e69 100644 --- a/net/dccp/ccids/ccid3.c +++ b/net/dccp/ccids/ccid3.c @@ -825,18 +825,16 @@ static void ccid3_hc_rx_packet_recv(struct sock *sk, struct sk_buff *skb) } /* - * Handle pending losses and otherwise check...
2013c7e35aeba39777f9b3eef8a70207b3931152
Analyze and fix the following issue in the Linux kernel code: dccp ccid-3: Fix error in loss detection
Problem Details: The TFRC loss detection code used the wrong loss condition (RFC 4340, 7.7.1): * the difference between sequence numbers s1 and s2 instead of * the number of packets missing between s1 and s2 (one less than the distance). Since this condition appears in many places of the code, it has been put into ...
```diff diff --git a/net/dccp/ccids/lib/packet_history.c b/net/dccp/ccids/lib/packet_history.c index 20af1a693427..8b5c41ec7ee1 100644 --- a/net/dccp/ccids/lib/packet_history.c +++ b/net/dccp/ccids/lib/packet_history.c @@ -215,22 +215,19 @@ static void __one_after_loss(struct tfrc_rx_hist *h, struct sk_buff *skb, u32 n...
815224293e5aa4c7dc1638807889e345f385b38d
Analyze and fix the following issue in the Linux kernel code: pcmcia: ide-cs debugging bugfix
Problem Details: The code in module ide-cs does not conform to the current standard if setting CONFIG_PCMCIA_DEBUG to "y", and loading the module with the option "pc_debug=N". When that is fixed, then a warning results that version is defined but not used. This patch fixes both situations. Signed-off-by: Larry Finger ...
```diff diff --git a/drivers/ide/legacy/ide-cs.c b/drivers/ide/legacy/ide-cs.c index aa2ea3deac85..8b8b20d86915 100644 --- a/drivers/ide/legacy/ide-cs.c +++ b/drivers/ide/legacy/ide-cs.c @@ -63,11 +63,11 @@ MODULE_LICENSE("Dual MPL/GPL"); #define INT_MODULE_PARM(n, v) static int n = v; module_param(n, int, 0) -#if...
3e84050c81ffb4961ef43d20e1fb1d7607167d83
Analyze and fix the following issue in the Linux kernel code: cpusets, hotplug, scheduler: fix scheduler domain breakage
Problem Details: Commit f18f982ab ("sched: CPU hotplug events must not destroy scheduler domains created by the cpusets") introduced a hotplug-related problem as described below: Upon CPU_DOWN_PREPARE, update_sched_domains() -> detach_destroy_domains(&cpu_online_map) does the following: /* * Force a reinitializa...
```diff diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 9fceb97e989c..798b3ab054eb 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c @@ -1882,7 +1882,7 @@ static void scan_for_empty_cpusets(const struct cpuset *root) * in order to minimize text size. */ -static void common_cpu_mem_hotplug_unplug(void) +stat...
3d88cca7085cffce077f808f36551e9050eb9e3a
Analyze and fix the following issue in the Linux kernel code: x86: fix numaq_tsc_disable calling
Problem Details: got this on a test-system: calling numaq_tsc_disable+0x0/0x39 NUMAQ: disabling TSC initcall numaq_tsc_disable+0x0/0x39 returned 0 after 0 msecs that's because we should not be using arch_initcall to call numaq_tsc_disable. need to call it in setup_arch before time_init()/tsc_init() and call it i...
```diff diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c index fe9224c51d37..70609efdf1da 100644 --- a/arch/x86/kernel/cpu/intel.c +++ b/arch/x86/kernel/cpu/intel.c @@ -226,6 +226,10 @@ static void __cpuinit init_intel(struct cpuinfo_x86 *c) if (cpu_has_bts) ds_init_intel(c); + +#ifdef CONF...
9958e810f8ac92f8a447035ee6555420ba27b847
Analyze and fix the following issue in the Linux kernel code: x86: max_low_pfn_mapped fix, #3
Problem Details: optimization: try to merge the range with same page size in init_memory_mapping, to get the best possible linear mappings set up. thus when GBpages is not there, we could do 2M pages. Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com> Cc: Suresh Siddha <suresh.b.siddha@intel.com> Signed-off-by: Ingo M...
```diff diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index 122bcef222fc..a25cc6fa2207 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c @@ -763,6 +763,20 @@ unsigned long __init_refok init_memory_mapping(unsigned long start, end_pfn = end>>PAGE_SHIFT; nr_range = save_mr(mr, nr_range, star...
965194c15dc9e4f3bc44432b39c441c86af7f11d
Analyze and fix the following issue in the Linux kernel code: x86: max_low_pfn_mapped fix, #2
Problem Details: tighten the boundary checks around max_low_pfn_mapped - dont overmap nor undermap into holes. also print out tseg for AMD cpus, for diagnostic purposes. (this is an SMM area, and we split up any big mappings around that area) Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com> Cc: Suresh Siddha <suresh...
```diff diff --git a/arch/x86/kernel/cpu/amd_64.c b/arch/x86/kernel/cpu/amd_64.c index bd182b7616ee..7c36fb8a28d4 100644 --- a/arch/x86/kernel/cpu/amd_64.c +++ b/arch/x86/kernel/cpu/amd_64.c @@ -200,6 +200,7 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c) * benefit in doing so. */ if (!rdmsrl_safe(M...
7ab073b6e0cde1544f4e79fadb75532528af7595
Analyze and fix the following issue in the Linux kernel code: x86: max_low_pfn_mapped fix, #1
Problem Details: fix crash on Ingo's big box: calling pci_iommu_init+0x0/0x17 PCI-DMA: Disabling AGP. PCI-DMA: aperture base @ d0000000 size 65536 KB PCI-DMA: using GART IOMMU. PCI-DMA: Reserving 64MB of IOMMU area in the AGP aperture BUG: unable to handle kernel paging request at ffff88000003be88 IP: [<ffffffff8026d...
```diff diff --git a/arch/x86/kernel/pci-gart_64.c b/arch/x86/kernel/pci-gart_64.c index d0d18db5d2a4..a614ee10f846 100644 --- a/arch/x86/kernel/pci-gart_64.c +++ b/arch/x86/kernel/pci-gart_64.c @@ -630,6 +630,7 @@ static __init int init_k8_gatt(struct agp_kern_info *info) struct pci_dev *dev; void *gatt; int i, ...
536abdb0802f3fac1b217530741853843d63c281
Analyze and fix the following issue in the Linux kernel code: cifs: fix wksidarr declaration to be big-endian friendly
Problem Details: The current definition of wksidarr works fine on little endian arches (since cpu_to_le32 is a no-op there), but on big-endian arches, it fails to compile with this error: error: braced-group within expression allowed only inside a function The problem is that this static declaration has cpu_to_le32 e...
```diff diff --git a/fs/cifs/cifsacl.c b/fs/cifs/cifsacl.c index 34902cff5400..0e9fc2ba90ee 100644 --- a/fs/cifs/cifsacl.c +++ b/fs/cifs/cifsacl.c @@ -34,11 +34,11 @@ static struct cifs_wksid wksidarr[NUM_WK_SIDS] = { {{1, 0, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0} }, "null user"}, {{1, 1, {0, 0, 0, 0, 0, 1}, {0, 0, 0...
e911d0cc877ff027d5bd09fc33148ab76f0fdf0e
Analyze and fix the following issue in the Linux kernel code: cifs: fix inode leak in cifs_get_inode_info_unix
Problem Details: Try this: mount a share with unix extensions create a file on it umount the share You'll get the following message in the ring buffer: VFS: Busy inodes after unmount of cifs. Self-destruct in 5 seconds. Have a nice day... ...the problem is that cifs_get_inode_info_unix is creating and ...
```diff diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index 722be543ceec..2e904bd111c8 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c @@ -219,15 +219,15 @@ int cifs_get_inode_info_unix(struct inode **pinode, rc = CIFSSMBUnixQPathInfo(xid, pTcon, full_path, &find_data, cifs_sb->local_nls, cifs_sb->mnt_cifs...
d3297a644a0ab784e0c810ceca6bf35a67868ad9
Analyze and fix the following issue in the Linux kernel code: frv: fix irqs_disabled() to return an int, not an unsigned long
Problem Details: Fix FRV irqs_disabled() to return an int, not an unsigned long to avoid this warning: kernel/sched.c: In function '__might_sleep': kernel/sched.c:8198: warning: format '%d' expects type 'int', but argument 3 has type 'long unsigned int' Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by...
```diff diff --git a/include/asm-frv/system.h b/include/asm-frv/system.h index d3a12a9079f7..7742ec000cc4 100644 --- a/include/asm-frv/system.h +++ b/include/asm-frv/system.h @@ -87,7 +87,7 @@ do { \ } while(0) #define irqs_disabled() \ - ({unsigned long flags; local_save_flags(flags); flags; }) + ({unsigned...
876550aa3e5f6448a1abae3704cbebcc50545998
Analyze and fix the following issue in the Linux kernel code: rtc-fm3130: fix chip naming
Problem Details: Fix chip naming from fm3031-rtc to fm3031 Signed-off-by: Alessandro Zummo <a.zummo@towertech.it> Cc: Sergey Lapin <slapin@ossfans.org> Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/drivers/rtc/rtc-fm3130.c b/drivers/rtc/rtc-fm3130.c index 11644c8fca82..abfdfcbaa059 100644 --- a/drivers/rtc/rtc-fm3130.c +++ b/drivers/rtc/rtc-fm3130.c @@ -55,7 +55,7 @@ struct fm3130 { int alarm; }; static const struct i2c_device_id fm3130_id[] = { - { "fm3130-rtc", 0 }, + { "fm3130", 0 },...
bca5c2c550f16d2dc2d21ffb7b4712bd0a7d32a9
Analyze and fix the following issue in the Linux kernel code: ov7670: clean up ov7670_read semantics
Problem Details: Cortland Setlow pointed out a bug in ov7670.c where the result from ov7670_read() was just being checked for !0, rather than <0. This made me realize that ov7670_read's semantics were rather confusing; it both fills in 'value' with the result, and returns it. This is goes against general kernel conve...
```diff diff --git a/drivers/media/video/ov7670.c b/drivers/media/video/ov7670.c index 2bc6bdc9c1f2..d7bfd30f74a9 100644 --- a/drivers/media/video/ov7670.c +++ b/drivers/media/video/ov7670.c @@ -406,8 +406,10 @@ static int ov7670_read(struct i2c_client *c, unsigned char reg, int ret; ret = i2c_smbus_read_byte_dat...
f31ad92f34913043cf008d6e479e92dfbaf02df1
Analyze and fix the following issue in the Linux kernel code: fbdev: bugfix for multiprocess defio
Problem Details: This patch is a bugfix for how defio handles multiple processes manipulating the same framebuffer. Thanks to Bernard Blackham for identifying this bug. It occurs when two applications mmap the same framebuffer and concurrently write to the same page. Normally, this doesn't occur since only a single ...
```diff diff --git a/drivers/video/fb_defio.c b/drivers/video/fb_defio.c index 24843fdd5395..59df132cc375 100644 --- a/drivers/video/fb_defio.c +++ b/drivers/video/fb_defio.c @@ -74,6 +74,7 @@ static int fb_deferred_io_mkwrite(struct vm_area_struct *vma, { struct fb_info *info = vma->vm_private_data; struct fb_def...
4fc89e3911aa5357b55b85b60c4beaeb8a48a290
Analyze and fix the following issue in the Linux kernel code: drivers/isdn/i4l/isdn_common.c fix small resource leak
Problem Details: Coverity CID: 1356 RESOURCE_LEAK I found a very old patch for this that was Acked but did not get applied https://lists.linux-foundation.org/pipermail/kernel-janitors/2006-September/016362.html There looks to be a small leak in isdn_writebuf_stub() in isdn_common.c, when copy_from_user() returns an u...
```diff diff --git a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c index 0f3c66de69bc..8d8c6b736167 100644 --- a/drivers/isdn/i4l/isdn_common.c +++ b/drivers/isdn/i4l/isdn_common.c @@ -1977,8 +1977,10 @@ isdn_writebuf_stub(int drvidx, int chan, const u_char __user * buf, int len) if (!skb) return...
43f77e91eadbc290eb76a08110a039c809dde6c9
Analyze and fix the following issue in the Linux kernel code: drivers/char/pcmcia/ipwireless/hardware.c fix resource leak
Problem Details: Coverity CID: 2172 RESOURCE_LEAK When pool_allocate() tries to enlarge a packet, if it can not allocate enough memory, it returns NULL without first freeing the old packet. This patch just frees the packet first. Signed-off-by: Darren Jenkins <darrenrjenkins@gmail.com> Acked-by: Jiri Kosina <jkosina...
```diff diff --git a/drivers/char/pcmcia/ipwireless/hardware.c b/drivers/char/pcmcia/ipwireless/hardware.c index ba6340ae98af..929101ecbae2 100644 --- a/drivers/char/pcmcia/ipwireless/hardware.c +++ b/drivers/char/pcmcia/ipwireless/hardware.c @@ -590,8 +590,10 @@ static struct ipw_rx_packet *pool_allocate(struct ipw_ha...
d280eadc4fba0bf99fb1c3b60e8c5e007f7da02c
Analyze and fix the following issue in the Linux kernel code: [NET] smc91x: remove "irq_flags" from "struct smc91x_platdata"
Problem Details: IRQ trigger type can be specified in the IRQ resource definition by IORESOURCE_IRQ_*, we need only one way to specify this. This also fixes the following small issue: To allow dynamic support for multiple platforms, when those relevant macros are not defined for one specific platform, the default cas...
```diff diff --git a/arch/sh/boards/renesas/migor/setup.c b/arch/sh/boards/renesas/migor/setup.c index 01af44245b57..963c99322095 100644 --- a/arch/sh/boards/renesas/migor/setup.c +++ b/arch/sh/boards/renesas/migor/setup.c @@ -30,7 +30,6 @@ static struct smc91x_platdata smc91x_info = { .flags = SMC91X_USE_16BIT, -...
4df64c3e58d28ffc5c61bdbdd733c5d0303b9f3c
Analyze and fix the following issue in the Linux kernel code: powerpc/mpc5121: Update device tree for MPC5121ADS evaluation board
Problem Details: Current device tree is only bare bones. This patch adds nodes to make it a complete tree for the MPC5121ads. Added nodes include: mbx - opengl coprocessor nfc - nand flash controller cpld-pic - on board cpld rtc clock - clock control pmc - power management co...
```diff diff --git a/arch/powerpc/boot/dts/mpc5121ads.dts b/arch/powerpc/boot/dts/mpc5121ads.dts index 94ad7b2b241e..1f9036c317b4 100644 --- a/arch/powerpc/boot/dts/mpc5121ads.dts +++ b/arch/powerpc/boot/dts/mpc5121ads.dts @@ -1,7 +1,7 @@ /* - * MPC5121E MDS Device Tree Source + * MPC5121E ADS Device Tree Source * -...
08b6c06de5d3f37295f6dbf7010fb45ae5ee14a7
Analyze and fix the following issue in the Linux kernel code: powerpc/mpc5200: fix compile warnings in bestcomm driver
Problem Details: Fix for the following compiler warnings: CC arch/powerpc/sysdev/bestcomm/bestcomm.o arch/powerpc/sysdev/bestcomm/bestcomm.c: In function 'mpc52xx_bcom_probe': arch/powerpc/sysdev/bestcomm/bestcomm.c:446: warning: format '%08lx' expects type 'long unsigned int', but argument 2 ha...
```diff diff --git a/arch/powerpc/sysdev/bestcomm/bestcomm.c b/arch/powerpc/sysdev/bestcomm/bestcomm.c index 64ec7d629363..446c9ea85b30 100644 --- a/arch/powerpc/sysdev/bestcomm/bestcomm.c +++ b/arch/powerpc/sysdev/bestcomm/bestcomm.c @@ -443,7 +443,7 @@ mpc52xx_bcom_probe(struct of_device *op, const struct of_device_i...
8df5fc042c8e7c08dc438c8198b62407ee1e91a0
Analyze and fix the following issue in the Linux kernel code: [SCSI] bsg: fix oops on remove
Problem Details: If you do a modremove of any sas driver, you run into an oops on shutdown when the host is removed (coming from the host bsg device). The root cause seems to be that there's a use after free of the bsg_class_device: In bsg_kref_release_function, this is used (to do a put_device(bcg->parent) after bcg-...
```diff diff --git a/block/bsg.c b/block/bsg.c index f0b7cd343216..54d617f7df3e 100644 --- a/block/bsg.c +++ b/block/bsg.c @@ -709,11 +709,12 @@ static void bsg_kref_release_function(struct kref *kref) { struct bsg_class_device *bcd = container_of(kref, struct bsg_class_device, ref); + struct device *parent = bcd...
d7f305e9a08040649b0800245e67708df58cdb55
Analyze and fix the following issue in the Linux kernel code: [SCSI] sym53c8xx: Fix bogus sym_que_entry re-implementation of container_of
Problem Details: The sym53c8xx driver, for some reason, seems to mostly re-implement linux/list.h with added bogosity. The main one is it's implementation of sym_que_entry which spits warnings with recent gcc's on some 64 bits architectures. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-b...
```diff diff --git a/drivers/scsi/sym53c8xx_2/sym_misc.h b/drivers/scsi/sym53c8xx_2/sym_misc.h index 0433d5d0caf3..430537183c18 100644 --- a/drivers/scsi/sym53c8xx_2/sym_misc.h +++ b/drivers/scsi/sym53c8xx_2/sym_misc.h @@ -121,9 +121,7 @@ static __inline void sym_que_move(struct sym_quehead *orig, } } -#define sym...
2476b4d0426e1d6d4a42b2f7ae08f668b2cfe510
Analyze and fix the following issue in the Linux kernel code: [SCSI] fix locking in host use of blk_plug_device()
Problem Details: scsi_lib.c:scsi_host_queue_ready() plugs the device with incorrect locking. It should actually have the queue lock held, but it's holding the host lock. Fix this by eliminating the call. The host ready has no need to plug the queue because if it returns 0 in scsi_request_function control transfers t...
```diff diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index aa8d5de58839..0451903452e6 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -1328,7 +1328,6 @@ static inline int scsi_host_queue_ready(struct request_queue *q, printk("scsi%d unblocking host at zero depth\n", sh...
3968ce800f45d8795ceb6f186c1efe420c98e1b0
Analyze and fix the following issue in the Linux kernel code: [SCSI] zfcp: Fix error checking for ELS ADISC requests
Problem Details: Correctly check the status for ELS ADISC requests. 0 means success. Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> Signed-off-by: Swen Schillig <swen@vnet.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
```diff diff --git a/drivers/s390/scsi/zfcp_fc.c b/drivers/s390/scsi/zfcp_fc.c index 34c9b20ce493..5d9367d9a12d 100644 --- a/drivers/s390/scsi/zfcp_fc.c +++ b/drivers/s390/scsi/zfcp_fc.c @@ -263,7 +263,7 @@ static void zfcp_fc_adisc_handler(unsigned long data) struct zfcp_port *port = adisc->els.port; struct zfcp_l...
eac6e8e449647cbb9efee53977c8bfee0aa7d69e
Analyze and fix the following issue in the Linux kernel code: [SCSI] scsi_debug: add support for rotation speed
Problem Details: Add support for VPD page b1 to scsi_debug SCSI VPD page b1 reports the nominal rotation speed of the device. Since scsi_debug is ram-based, claim to be a non-rotating medium. Signed-off-by: Matthew Wilcox <willy@linux.intel.com> Acked-by: Douglas Gilbert <dougg@torque.net> Signed-off-by: James Bottom...
```diff diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 3901125455c9..01d11a01ffbf 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c @@ -643,6 +643,14 @@ static int inquiry_evpd_b0(unsigned char * arr) return sizeof(vpdb0_data); } +static int inquiry_evpd_b1(unsigned c...
f80f868ec463b0463b332cdb704fe5438f013f98
Analyze and fix the following issue in the Linux kernel code: [SCSI] iscsi class: fix endpoint leak
Problem Details: class_find_device gets a ref to the device so we must release it. The class will serialize access to the ep so we do not have to worry about a remove racing with the callers access, so we can simplify the use and drop the ref right away. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-b...
```diff diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c index 8e34f3c08575..3af7cbcc5c5d 100644 --- a/drivers/scsi/scsi_transport_iscsi.c +++ b/drivers/scsi/scsi_transport_iscsi.c @@ -219,6 +219,7 @@ EXPORT_SYMBOL_GPL(iscsi_destroy_endpoint); struct iscsi_endpoint *iscsi_lookup...
8e9a20cee4511be4560f9c858d9994eb6913731e
Analyze and fix the following issue in the Linux kernel code: [SCSI] libiscsi, iscsi_tcp, ib_iser: fix setting of can_queue with old tools.
Problem Details: This patch fixes two bugs that are related. 1. Old tools did not set can_queue/cmds_max. This patch modifies libiscsi so that when we add the host we catch this and set it to the default. 2. iscsi_tcp thought that the scsi command that was passed to the eh functions needed a iscsi_cmd_task allocated ...
```diff diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.c b/drivers/infiniband/ulp/iser/iscsi_iser.c index c02eabd383a1..a56931e03976 100644 --- a/drivers/infiniband/ulp/iser/iscsi_iser.c +++ b/drivers/infiniband/ulp/iser/iscsi_iser.c @@ -595,7 +595,6 @@ static struct scsi_host_template iscsi_iser_sht = { .name ...
c95fddc729fafb43f420747027eeb998c2e5e798
Analyze and fix the following issue in the Linux kernel code: [SCSI] iscsi class: fix refcount leak
Problem Details: Must do a module_out if the endpoint lookup fails. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
```diff diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c index 9fd5c6d87ed1..bc0f74d4ea09 100644 --- a/drivers/scsi/scsi_transport_iscsi.c +++ b/drivers/scsi/scsi_transport_iscsi.c @@ -1422,8 +1422,10 @@ iscsi_if_recv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) break; case ...
495a714c50e2c6ca6357129812f983b3ac0a32f2
Analyze and fix the following issue in the Linux kernel code: [SCSI] lpfc 8.2.7 : Miscellaneous Fixes
Problem Details: Miscellaneous Fixes: - Fix bug in mbox sysfs interface that locked in EAGAIN if discovery stalled. - Fix missing error message when npiv and loop are true when link up occurs. - Fix panic in lpfc_scsi_cmd_iocb_cmpl: scsi_buf was NULL, but created race conditions with other code paths. - Fix error in ...
```diff diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h index e3e5b540e36c..e0e018d12653 100644 --- a/drivers/scsi/lpfc/lpfc.h +++ b/drivers/scsi/lpfc/lpfc.h @@ -33,6 +33,7 @@ struct lpfc_sli2_slim; #define LPFC_MAX_SG_SEG_CNT 256 /* sg element count per scsi cmnd */ #define LPFC_IOCB_LIST_CNT 2250 /...
0d2b6b83030d6a88cbf7db57f84f2daf0e0b251b
Analyze and fix the following issue in the Linux kernel code: [SCSI] lpfc 8.2.7 : Discovery Fixes
Problem Details: - Fix ADISC timeout on initiators causing devloss timeout on targets - Correct FAN processing : port state vs unreg rpi's wasn't consistent - Correct mismatches between ASICs and PLOGI that would skip PLOGI Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <James.Botto...
```diff diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index 886c5f1b11d2..d418c7c1251e 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -1754,29 +1754,34 @@ lpfc_cancel_retry_delay_tmo(struct lpfc_vport *vport, struct lpfc_nodelist *nlp) struct Scsi_Host *shos...
fa04c2816883a49ec518514f6c19767d54be20b5
Analyze and fix the following issue in the Linux kernel code: [SCSI] zfcp: Cleanup code in zfcp_ccw
Problem Details: Overall cleanup in file zfcp_ccw.c. Fix coding style issues, remove useless macros and messages and convert remaining messages to standard macros. Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> Signed-off-by: Swen Schillig <swen@vnet.ibm.com> Signed-off-by: James Bottomley <James.Bottom...
```diff diff --git a/drivers/s390/scsi/zfcp_ccw.c b/drivers/s390/scsi/zfcp_ccw.c index 66d3b88844b0..da472e865e58 100644 --- a/drivers/s390/scsi/zfcp_ccw.c +++ b/drivers/s390/scsi/zfcp_ccw.c @@ -1,64 +1,13 @@ /* - * This file is part of the zfcp device driver for - * FCP adapters for IBM System z9 and zSeries. + * zfc...
090507157f3bc43dd925fda50f8aca7d03b616b6
Analyze and fix the following issue in the Linux kernel code: [SCSI] aacraid: prevent copy_from_user() BUG!
Problem Details: Seen: kernel BUG at arch/i386/lib/usercopy.c:872 under a 2.6.18-8.el5 kernel. Traced it to a garbage-in/garbage-out ioctl condition in the aacraid driver. Adaptec's special ioctl scb passthrough needs to check the validity of the individual scatter gather count fields to the maximum the adapter sup...
```diff diff --git a/drivers/scsi/aacraid/commctrl.c b/drivers/scsi/aacraid/commctrl.c index 5fd83deab36c..a7355260cfcf 100644 --- a/drivers/scsi/aacraid/commctrl.c +++ b/drivers/scsi/aacraid/commctrl.c @@ -41,6 +41,7 @@ #include <linux/kthread.h> #include <linux/semaphore.h> #include <asm/uaccess.h> +#include <scsi...
597136ab70a6dccba5c40ee6eed88e881412429b
Analyze and fix the following issue in the Linux kernel code: [SCSI] scsi_debug: Runtime-configurable sector size
Problem Details: Make scsi_debug sector size configurable at load time instead of being a #define. Handy for testing 4KB sectors. Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Acked-by: Douglas Gilbert <dougg@torque.net> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
```diff diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index f6600bfb5bde..3901125455c9 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c @@ -94,6 +94,7 @@ static const char * scsi_debug_version_date = "20070104"; #define DEF_VIRTUAL_GB 0 #define DEF_FAKE_RW 0 #define DEF_V...
3f27e3ed11e67c5ee19d560a50eafd93cf8c6682
Analyze and fix the following issue in the Linux kernel code: [SCSI] bsg: fix bsg_mutex hang with device removal
Problem Details: We don't need to hold bsg_mutex during bsg_complete_all_commands(). It leads to a problem that we block bsg_unregister_queue during bsg_complete_all_commands (untill all the outstanding commands complete). Thanks to Pete Wyckoff for finding the bug and testing the patch. The detailed bug report is: ...
```diff diff --git a/block/bsg.c b/block/bsg.c index f0b7cd343216..7cdec32205d8 100644 --- a/block/bsg.c +++ b/block/bsg.c @@ -724,8 +724,13 @@ static int bsg_put_device(struct bsg_device *bd) mutex_lock(&bsg_mutex); do_free = atomic_dec_and_test(&bd->ref_count); - if (!do_free) + if (!do_free) { + mutex_unlock(...
3cf7b233ffc45d4fc381221f74d24f10e692c4ea
Analyze and fix the following issue in the Linux kernel code: [SCSI] libiscsi: fix cmds_max setting
Problem Details: Drivers expect that the cmds_max value they pass to the iscsi layer is the max scsi commands + mgmt tasks. This patch implements that and fixes some checks for nr cmd limits. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
```diff diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c index c1af2aa8e4e0..c723e60f02b0 100644 --- a/drivers/scsi/libiscsi.c +++ b/drivers/scsi/libiscsi.c @@ -1893,29 +1893,48 @@ EXPORT_SYMBOL_GPL(iscsi_host_free); * * This can be used by software iscsi_transports that allocate * a session per scs...
d82ff9be733a2e6da4f6c2ab4e9216f3f536503d
Analyze and fix the following issue in the Linux kernel code: [SCSI] iscsi class: add endpoint class
Problem Details: Add sysfs representation for the endpoint, so userspace can match the host and session to the endpoint. This will allow us to set the host's parent correctly at host creation time. The next patches will convert tcp and iser, and fix iser's dma_mask bug. Signed-off-by: Mike Christie <michaelc@cs.wisc....
```diff diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c index ac9d298f54e7..c3c07ccccca7 100644 --- a/drivers/scsi/scsi_transport_iscsi.c +++ b/drivers/scsi/scsi_transport_iscsi.c @@ -33,6 +33,7 @@ #define ISCSI_SESSION_ATTRS 19 #define ISCSI_CONN_ATTRS 13 #define ISCSI_HOST_AT...
7970634b81a6e3561954517bca42615542c4535b
Analyze and fix the following issue in the Linux kernel code: [SCSI] iscsi class: user device_for_each_child instead of duplicating session list
Problem Details: Currently we duplicate the list of sessions, because we were using the test for if a session was on the host list to indicate if the session was bound or unbound. We can instead use the target_id and fix up the class so that drivers like bnx2i do not have to manage the target id space. Signed-off-by: ...
```diff diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.c b/drivers/infiniband/ulp/iser/iscsi_iser.c index 86d9c42f0d33..3a89039e9a96 100644 --- a/drivers/infiniband/ulp/iser/iscsi_iser.c +++ b/drivers/infiniband/ulp/iser/iscsi_iser.c @@ -437,7 +437,7 @@ iscsi_iser_session_create(struct Scsi_Host *shost, cls_sess...
b40977d95fb3a1898ace6a7d97e4ed1a33a440a4
Analyze and fix the following issue in the Linux kernel code: [SCSI] iser: fix handling of scsi cmnds during recovery.
Problem Details: After the stop_conn callback has returned the LLD should not touch the scsi cmds. iscsi_tcp and libiscsi use the conn->recv_lock and suspend_rx field to halt recv path processing, but iser does not have any protection. This patch modifies iser so that userspace can just call the ep_disconnect callback...
```diff diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.c b/drivers/infiniband/ulp/iser/iscsi_iser.c index 9b34946eb00d..8a1bfb7277c8 100644 --- a/drivers/infiniband/ulp/iser/iscsi_iser.c +++ b/drivers/infiniband/ulp/iser/iscsi_iser.c @@ -305,10 +305,18 @@ iscsi_iser_conn_destroy(struct iscsi_cls_conn *cls_conn) {...
ad66dd340f561bdde2285992314d9e4fd9b6191e
Analyze and fix the following issue in the Linux kernel code: x2apic: xen64 paravirt basic apic ops
Problem Details: Define the Xen specific basic apic ops, in additon to paravirt apic ops, with some misc warning fixes. Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com> Cc: Jeremy Fitzhardinge <jeremy@goop.org> Cc: akpm@linux-foundation.org Signed-off-by: Ingo Molnar <mingo@elte.hu>
```diff diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c index 50dad44fb542..0c45df20e2b3 100644 --- a/arch/x86/lguest/boot.c +++ b/arch/x86/lguest/boot.c @@ -783,11 +783,11 @@ static void lguest_wbinvd(void) * code qualifies for Advanced. It will also never interrupt anything. It * does, however, all...
372e92d8b3e433888bf76c36f1c7e1405eae1584
Analyze and fix the following issue in the Linux kernel code: x64, x2apic/intr-remap: Interrupt-remapping and x2apic support
Problem Details: On Thu, Jul 10, 2008 at 12:53:20PM -0700, Ingo Molnar wrote: > > Btw., i threw it at the -tip test-cluster and got back a quick build > bugreport: > > arch/x86/xen/enlighten.c: In function 'xen_patch': > arch/x86/xen/enlighten.c:1084: warning: label 'patch_site' defined but not used > arch/x86/xen/enli...
```diff diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c index b80105a0f474..4f29ff847ebe 100644 --- a/arch/x86/kernel/paravirt.c +++ b/arch/x86/kernel/paravirt.c @@ -360,7 +360,7 @@ struct pv_cpu_ops pv_cpu_ops = { struct pv_apic_ops pv_apic_ops = { #ifdef CONFIG_X86_LOCAL_APIC -#ifnded CONFIG_...
2d7a66d02e11af9ab8e16c76d22767e622b4e3d7
Analyze and fix the following issue in the Linux kernel code: x64, x2apic/intr-remap: Interrupt-remapping and x2apic support, fix
Problem Details: Yinghai Lu wrote: > Setting APIC routing to physical flat > Kernel panic - not syncing: Boot APIC ID in local APIC unexpected (0 vs 4) > Pid: 1, comm: swapper Not tainted 2.6.26-rc9-tip-01763-g74f94b1-dirty #320 > > Call Trace: > [<ffffffff80a21505>] ? set_cpu_sibling_map+0x38c/0x3bd > [<ffffffff802...
```diff diff --git a/arch/x86/kernel/apic_64.c b/arch/x86/kernel/apic_64.c index 9dd4ee4735f5..3963f590c3d4 100644 --- a/arch/x86/kernel/apic_64.c +++ b/arch/x86/kernel/apic_64.c @@ -626,10 +626,10 @@ int __init verify_local_APIC(void) /* * The ID register is read/write in a real APIC. */ - reg0 = read_apic_id(...
2d6b5f85bb4ca919d8ab0f30311309b53fb93bc3
Analyze and fix the following issue in the Linux kernel code: x64, x2apic/intr-remap: Fix the need for RMRR in the DMA-remapping detection
Problem Details: Presence of RMRR structures is not compulsory for enabling DMA-remapping. Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com> Signed-off-by: Yong Y Wang <yong.y.wang@intel.com> Cc: Yong Y Wang <yong.y.wang@intel.com> Cc: akpm@linux-foundation.org Cc: arjan@linux.intel.com Cc: andi@firstfloor.org ...
```diff diff --git a/drivers/pci/dmar.c b/drivers/pci/dmar.c index 5c99f9973987..903f1701edff 100644 --- a/drivers/pci/dmar.c +++ b/drivers/pci/dmar.c @@ -419,10 +419,8 @@ int __init dmar_table_init(void) } #ifdef CONFIG_DMAR - if (list_empty(&dmar_rmrr_units)) { + if (list_empty(&dmar_rmrr_units)) printk(KERN_...
c42d9f32443397aed2d37d37df161392e6a5862f
Analyze and fix the following issue in the Linux kernel code: x64, x2apic/intr-remap: fix the need for sequential array allocation of iommus
Problem Details: Clean up the intel-iommu code related to deferred iommu flush logic. There is no need to allocate all the iommu's as a sequential array. This will be used later in the interrupt-remapping patch series to allocate iommu much early and individually for each device remapping hardware unit. Signed-off-by...
```diff diff --git a/drivers/pci/dmar.c b/drivers/pci/dmar.c index c00e387f5b75..1a59423a8eda 100644 --- a/drivers/pci/dmar.c +++ b/drivers/pci/dmar.c @@ -377,11 +377,18 @@ int __init early_dmar_detect(void) return (ACPI_SUCCESS(status) ? 1 : 0); } -struct intel_iommu *alloc_iommu(struct intel_iommu *iommu, - s...
5ac37f87ff18843aabab84cf75b2f8504c2d81fe
Analyze and fix the following issue in the Linux kernel code: x86: fix ldt limit for 64 bit
Problem Details: Fix size of LDT entries. On x86-64, ldt_desc is a double-sized descriptor. Signed-off-by: Michael Karcher <kernel@mkarcher.dialup.fu-berlin.de> Signed-off-by: Ingo Molnar <mingo@elte.hu>
```diff diff --git a/include/asm-x86/desc.h b/include/asm-x86/desc.h index 268a012bcd79..28bddbcb38be 100644 --- a/include/asm-x86/desc.h +++ b/include/asm-x86/desc.h @@ -192,8 +192,8 @@ static inline void native_set_ldt(const void *addr, unsigned int entries) unsigned cpu = smp_processor_id(); ldt_desc ldt; - ...
eca91e7838ec92e8c12122849ec7539c4765b689
Analyze and fix the following issue in the Linux kernel code: x86_64: fix delayed signals
Problem Details: On three of the several paths in entry_64.S that call do_notify_resume() on the way back to user mode, we fail to properly check again for newly-arrived work that requires another call to do_notify_resume() before going to user mode. These paths set the mask to check only _TIF_NEED_RESCHED, but this i...
```diff diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S index 466b9284ed2f..bb4e22f4892f 100644 --- a/arch/x86/kernel/entry_64.S +++ b/arch/x86/kernel/entry_64.S @@ -306,7 +306,7 @@ sysret_signal: leaq -ARGOFFSET(%rsp),%rdi # &pt_regs -> arg1 xorl %esi,%esi # oldset -> arg2 call ptregscall_co...
38032f72601deac7aab00691c79e83d09b204e2a
Analyze and fix the following issue in the Linux kernel code: acpi_pm clccksource: fix printk format warning
Problem Details: Fix printk format warning in acpi_pm clocksource: linux-next-20080711/drivers/clocksource/acpi_pm.c:231: warning: format '%04lx' expects type 'long unsigned int', but argument 2 has type 'u32' Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Cc: akpm <akpm@linux-foundation.org> Signed-off-by: Th...
```diff diff --git a/drivers/clocksource/acpi_pm.c b/drivers/clocksource/acpi_pm.c index 3baee020afc2..bcd7d0e429e8 100644 --- a/drivers/clocksource/acpi_pm.c +++ b/drivers/clocksource/acpi_pm.c @@ -227,8 +227,8 @@ static int __init parse_pmtmr(char *arg) if (strict_strtoul(arg, 16, &base)) return -EINVAL; - pri...
3e3398a08d6e516675d5af853d625dc7dd90eab1
Analyze and fix the following issue in the Linux kernel code: ext4: delayed allocation i_blocks fix for stat
Problem Details: Right now i_blocks is not getting updated until the blocks are actually allocaed on disk. This means with delayed allocation, right after files are copied, "ls -sF" shoes the file as taking 0 blocks on disk. "du" also shows the files taking zero space, which is highly confusing to the user. Since de...
```diff diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 0962f4e26579..303e41cf7b14 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h @@ -1059,6 +1059,8 @@ int ext4_get_blocks_handle(handle_t *handle, struct inode *inode, extern struct inode *ext4_iget(struct super_block *, unsigned long); extern int ext4_write_ino...
632eaeab1feb5d78c1e2bfb1d2dfc0ebb8ac187f
Analyze and fix the following issue in the Linux kernel code: ext4: fix delalloc i_disksize early update issue
Problem Details: Ext4_da_write_end() used walk_page_buffers() with a callback function of ext4_bh_unmapped_or_delay() to check if it extended the file size without allocating any blocks (since in this case i_disksize needs to be updated). However, this is didn't work proprely because the buffer head has not been marke...
```diff diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index ce47847bb37d..0fbe678d40bb 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -2298,6 +2298,29 @@ out: return ret; } +/* + * Check if we should update i_disksize + * when write to the end of file but not require block allocation + */ +static int ext4_...
61628a3f3a37af2bf25daf8e26fd6b76a78c4f76
Analyze and fix the following issue in the Linux kernel code: ext4: Invert lock ordering of page_lock and transaction start in delalloc
Problem Details: With the reverse locking, we need to start a transation before taking the page lock, so in ext4_da_writepages() we need to break the write-out into chunks, and restart the journal for each chunck to ensure the write-out fits in a single transaction. Updated patch from Aneesh Kumar K.V <aneesh.kumar@li...
```diff diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index dabc3b68d249..42c4c0c892ed 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -2565,6 +2565,7 @@ int ext4_ext_get_blocks(handle_t *handle, struct inode *inode, int err = 0, depth, ret; unsigned long allocated = 0; struct ext4_allocation_reque...
d2a1763791a634e315ec926b62829c1e88842c86
Analyze and fix the following issue in the Linux kernel code: ext4: delayed allocation ENOSPC handling
Problem Details: This patch does block reservation for delayed allocation, to avoid ENOSPC later at page flush time. Blocks(data and metadata) are reserved at da_write_begin() time, the freeblocks counter is updated by then, and the number of reserved blocks is store in per inode counter. At the writepage tim...
```diff diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c index 6369bacf0dcb..495ab21b9832 100644 --- a/fs/ext4/balloc.c +++ b/fs/ext4/balloc.c @@ -1701,7 +1701,12 @@ ext4_fsblk_t ext4_old_new_blocks(handle_t *handle, struct inode *inode, } sbi = EXT4_SB(sb); - *count = ext4_has_free_blocks(sbi, *count); + if (!EX...
64769240bd07f446f83660bb143bb609d8ab4910
Analyze and fix the following issue in the Linux kernel code: ext4: Add delayed allocation support in data=writeback mode
Problem Details: Updated with fixes from Mingming Cao <cmm@us.ibm.com> to unlock and release the page from page cache if the delalloc write_begin failed, and properly handle preallocated blocks. Also added a fix to clear buffer_delay in block_write_full_page() after allocating a delayed buffer. Updated with fixes fro...
```diff diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index f65829bbe7aa..ee9576dc0ba1 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h @@ -536,6 +536,7 @@ do { \ #define EXT4_MOUNT_JOURNAL_ASYNC_COMMIT 0x1000000 /* Journal Async Commit */ #define EXT4_MOUNT_I_VERSION 0x2000000 /* i_version s...
678aaf481496b01473b778685eca231d6784098b
Analyze and fix the following issue in the Linux kernel code: ext4: Use new framework for data=ordered mode in JBD2
Problem Details: This patch makes ext4 use inode-based implementation of data=ordered mode in JBD2. It allows us to unify some data=ordered and data=writeback paths (especially writepage since we don't have to start a transaction anymore) and remove some buffer walking. Updated fix from Aneesh Kumar K.V <aneesh.kumar@...
```diff diff --git a/fs/ext4/ext4_i.h b/fs/ext4/ext4_i.h index abf2744164e0..c2903ef72159 100644 --- a/fs/ext4/ext4_i.h +++ b/fs/ext4/ext4_i.h @@ -150,6 +150,7 @@ struct ext4_inode_info { */ struct rw_semaphore i_data_sem; struct inode vfs_inode; + struct jbd2_inode jinode; unsigned long i_ext_generation; ...
9ddfc3dc75b5cc55ff3cfa586e962d252f1db9d3
Analyze and fix the following issue in the Linux kernel code: ext4: Fix lock inversion in ext4_ext_truncate()
Problem Details: We cannot call ext4_orphan_add() from under i_data_sem because that causes a lock ordering violation between i_data_sem and and the superblock lock. Updated with Aneesh's locking order fix Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Mingming Cao <cmm@us.ibm.com> Signed-off-by: Aneesh Kumar...
```diff diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index b722bce7d662..7844bbb2bac0 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -2768,6 +2768,9 @@ void ext4_ext_truncate(struct inode *inode) if (inode->i_size & (sb->s_blocksize - 1)) ext4_block_truncate_page(handle, mapping, inode->i_size); ...
cf108bca465dde0c015f32dd453b99457d31c7c7
Analyze and fix the following issue in the Linux kernel code: ext4: Invert the locking order of page_lock and transaction start
Problem Details: This changes are needed to support data=ordered mode handling via inodes. This enables us to get rid of the journal heads and buffer heads for data buffers in the ordered mode. With the changes, during tranasaction commit we writeout the inode pages using the writepages()/writepage(). That implies we...
```diff diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 98760d14e2cd..f65829bbe7aa 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h @@ -1066,7 +1066,7 @@ extern void ext4_set_inode_flags(struct inode *); extern void ext4_get_inode_flags(struct ext4_inode_info *); extern void ext4_set_aops(struct inode *inode); ex...
5f21b0e642d7bf6fe4434c9ba12bc9cb96b17cf7
Analyze and fix the following issue in the Linux kernel code: ext4: fix online resize with mballoc
Problem Details: Update group infos when updating a group's descriptor. Add group infos when adding a group's descriptor. Refresh cache pages used by mb_alloc when changes occur. This will probably need modifications when META_BG resizing will be allowed. Signed-off-by: Frederic Bohe <frederic.bohe@bull.net> Signed-of...
```diff diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 2c4b48519c8b..64edb09c481e 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h @@ -1033,6 +1033,10 @@ extern int __init init_ext4_mballoc(void); extern void exit_ext4_mballoc(void); extern void ext4_mb_free_blocks(handle_t *, struct inode *, unsigned long, un...
7061eba75ceb0835ba61e7cbd757a6f9c1e4af92
Analyze and fix the following issue in the Linux kernel code: ext4: Use inode preallocation with -o noextents
Problem Details: When mballoc is enabled, block allocation for old block-based files are allocated using mballoc allocator instead of old block-based allocator. The old ext3 block reservation is turned off when mballoc is turned on. However, the in-core preallocation is not enabled for block-based/ non-extent based fi...
```diff diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c index 1327ac3a04de..816f1dbaeb3c 100644 --- a/fs/ext4/balloc.c +++ b/fs/ext4/balloc.c @@ -1923,7 +1923,7 @@ out: return 0; } -ext4_fsblk_t ext4_new_block(handle_t *handle, struct inode *inode, +ext4_fsblk_t ext4_new_meta_block(handle_t *handle, struct inode ...
6afd670713c9e7d5c5550e379dfedca8ffab4c90
Analyze and fix the following issue in the Linux kernel code: ext4: fix ext4_init_block_bitmap() for metablock block group
Problem Details: When meta_bg feature is enabled and s_first_meta_bg != 0, ext4_init_block_bitmap() miscalculates the number of block used by the group descriptor table (0 or 1 for metablock block group) This patch fixes this by using ext4_bg_num_gdb() Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Cc: Andrew ...
```diff diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c index 6dcbec9b2562..1327ac3a04de 100644 --- a/fs/ext4/balloc.c +++ b/fs/ext4/balloc.c @@ -121,12 +121,7 @@ unsigned ext4_init_block_bitmap(struct super_block *sb, struct buffer_head *bh, le16_to_cpu(sbi->s_es->s_reserved_gdt_blocks); } } else { /* For M...
7477827f6686ce29b6216d9eb26f6b9027742dcc
Analyze and fix the following issue in the Linux kernel code: ext4: Fix sparse warning
Problem Details: Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
```diff diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c index 0b2b7549ac63..6dcbec9b2562 100644 --- a/fs/ext4/balloc.c +++ b/fs/ext4/balloc.c @@ -47,7 +47,7 @@ static int ext4_block_in_group(struct super_block *sb, ext4_fsblk_t block, ext4_group_t block_group) { ext4_group_t actual_group; - ext4_get_group_no_an...
9102e4fa8016af8bf1a263df913ee8fdafd4dfb0
Analyze and fix the following issue in the Linux kernel code: ext4: Fix ext4_ext_journal_restart() to reflect errors up to the caller
Problem Details: Fix ext4_ext_journal_restart() so it returns any errors reported by ext4_journal_extend() and ext4_journal_restart(). Signed-off-by: Shen Feng <shen@cn.fujitsu.com> Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Mingming Cao <cmm@us.ibm.com> Signed-off-by: "Theodore Ts...
```diff diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 3e966daaadee..17ea8bb12aa5 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -92,17 +92,16 @@ static void ext4_idx_store_pblock(struct ext4_extent_idx *ix, ext4_fsblk_t pb) ix->ei_leaf_hi = cpu_to_le16((unsigned long) ((pb >> 31) >> 1) & 0xffff)...
530576bbf379fc45cfb34f246257d8526db44567
Analyze and fix the following issue in the Linux kernel code: jbd2: fix race between jbd2_journal_try_to_free_buffers() and jbd2 commit transaction
Problem Details: journal_try_to_free_buffers() could race with jbd commit transaction when the later is holding the buffer reference while waiting for the data buffer to flush to disk. If the caller of journal_try_to_free_buffers() request tries hard to release the buffers, it will treat the failure as error and return...
```diff diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c index d6e006e67804..ba620c4493d2 100644 --- a/fs/jbd2/transaction.c +++ b/fs/jbd2/transaction.c @@ -41,7 +41,6 @@ static void __jbd2_journal_temp_unlink_buffer(struct journal_head *jh); * new transaction and we can't block without protecting against o...
7e5a8cdd843b7af8d6d38a9bf96306145edb66e0
Analyze and fix the following issue in the Linux kernel code: ext4: fix error processing in mb_free_blocks
Problem Details: The error processing of the return value of mb_free_blocks is meanless because it only returns 0. This fix includes - make mb_free_blocks return void - remove the error processing part in callers - unlock group before calling ext4_error in mb_free_blocks Signed-off-by: Shen Feng <shen@cn.fujitsu.c...
```diff diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index 771a1d608528..b882868f4661 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -1051,7 +1051,7 @@ static void mb_set_bits(spinlock_t *lock, void *bm, int cur, int len) } } -static int mb_free_blocks(struct inode *inode, struct ext4_buddy *e4b, ...
f795e1407343ebe6597653f4a6a7f770676e84c5
Analyze and fix the following issue in the Linux kernel code: ext4: fix build failure if DX_DEBUG is enabled
Problem Details: ext4_next_entry() is used by the debugging function dx_show_leaf(), so it must be defined before that function. Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
```diff diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index 384f1222602a..c7bf01261c7a 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -182,6 +182,16 @@ static struct buffer_head * ext4_dx_find_entry(struct dentry *dentry, static int ext4_dx_add_entry(handle_t *handle, struct dentry *dentry, struct ino...
3537576a707c6df98e883b77b854c6083f844602
Analyze and fix the following issue in the Linux kernel code: ext4: remove double definitions of xattr macros
Problem Details: remove the definitions of macros XATTR_TRUSTED_PREFIX and XATTR_USER_PREFIX since they are defined in linux/xattr.h Signed-off-by: Shen Feng <shen@cn.fujitsu.com> Signed-off-by: Mingming Cao <cmm@us.ibm.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
```diff diff --git a/fs/ext4/xattr_trusted.c b/fs/ext4/xattr_trusted.c index fff33382cadc..ac1a52cf2a37 100644 --- a/fs/ext4/xattr_trusted.c +++ b/fs/ext4/xattr_trusted.c @@ -13,13 +13,11 @@ #include "ext4.h" #include "xattr.h" -#define XATTR_TRUSTED_PREFIX "trusted." - static size_t ext4_xattr_trusted_list(struc...
31b481dc7c249eac0a108ec5dfc0d4aef2217e39
Analyze and fix the following issue in the Linux kernel code: ext4: Fix ext4_mb_init_cache return error
Problem Details: ext4_mb_init_cache() incorrectly always return EIO on success. This causes the caller of ext4_mb_init_cache() fail when it checks the return value. Signed-off-by: Mingming Cao <cmm@us.ibm.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
```diff diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index 6280ad3829d4..d429014071c0 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -809,6 +809,7 @@ static int ext4_mb_init_cache(struct page *page, char *incore) if (!buffer_uptodate(bh[i])) goto out; + err = 0; first_block = page->index * b...
07d45f126712fea3a9f44068bf65e0a26a162286
Analyze and fix the following issue in the Linux kernel code: ext4: Use BUG_ON() instead of BUG()
Problem Details: if (...) BUG(); should be replaced with BUG_ON(...) when the test has no side-effects to allow a definition of BUG_ON that drops the code completely. The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @ disable unlikely @ expression E,f; @@ ( ...
```diff diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c index 9cc80b9cc8d8..c29d774abe55 100644 --- a/fs/ext4/balloc.c +++ b/fs/ext4/balloc.c @@ -409,8 +409,7 @@ restart: prev = rsv; } printk("Window map complete.\n"); - if (bad) - BUG(); + BUG_ON(bad); } #define rsv_window_dump(root, verbose) \ __rsv_wind...
8a35694e1181a5c6d6496dca09407fc7fa4c86c2
Analyze and fix the following issue in the Linux kernel code: ext4: fix comments to say "ext4"
Problem Details: Change second/third to fourth. Signed-off-by: Shen Feng <shen@cn.fujitsu.com> Signed-off-by: Mingming Cao <cmm@us.ibm.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
```diff diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index f7a0758f4689..ea8e4bc097c8 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h @@ -22,7 +22,7 @@ #include "ext4_i.h" /* - * The second extended filesystem constants/structures + * The fourth extended filesystem constants/structures */ /* diff --git a/fs/e...
e7dfb2463e3c1b10c38372023e0186d25dec1fa6
Analyze and fix the following issue in the Linux kernel code: ext4: Fix mb_find_next_bit not to return larger than max
Problem Details: Some architectures implement ext4_find_next_bit and ext4_find_next_zero_bit in such a way that they return greater than max for some input values. Make sure mb_find_next_bit and mb_find_next_zero_bit return the right values. On 2.6.25 we have include/asm-x86/bitops_32.h static inline unsigned find_fir...
```diff diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index c9900aade150..ba3aad27f442 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -381,22 +381,28 @@ static inline void mb_clear_bit_atomic(spinlock_t *lock, int bit, void *addr) static inline int mb_find_next_zero_bit(void *addr, int max, int start...
f3b35f063e9a795495fe2f7a2fe55fab11f8ab12
Analyze and fix the following issue in the Linux kernel code: ext4: validate directory entry data before use
Problem Details: ext4_dx_find_entry uses ext4_next_entry without verifying that the entry is valid. If its rec_len == 0 this causes an infinite loop. Refactor the loop to check the validity of entries before checking whether they match and moving onto the next one. There are other uses of ext4_next_entry in this file ...
```diff diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index ab16beaa830d..384f1222602a 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -993,19 +993,21 @@ static struct buffer_head * ext4_dx_find_entry(struct dentry *dentry, de = (struct ext4_dir_entry_2 *) bh->b_data; top = (struct ext4_dir_entry_2 *) ((ch...
71dc8fbcf5f6363342bd636a646eeac7cfef25c3
Analyze and fix the following issue in the Linux kernel code: ext4: handle deleting corrupted indirect blocks
Problem Details: While freeing indirect blocks we attach a journal head to the parent buffer head, free the blocks, then journal the parent. If the indirect block list is corrupted and points to the parent the journal head will be detached when the block is cleared, causing an OOPS. Check for that explicitly and handl...
```diff diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 269763b66361..7cce96a6935e 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -2179,7 +2179,21 @@ static void ext4_free_data(handle_t *handle, struct inode *inode, if (this_bh) { BUFFER_TRACE(this_bh, "call ext4_journal_dirty_metadata"); - ext4_jou...
91ef4caf800030fa6e5224b8a41f8c74787b303d
Analyze and fix the following issue in the Linux kernel code: ext4: handle corrupted orphan list at mount
Problem Details: If the orphan node list includes valid, untruncatable nodes with nlink > 0 the ext4_orphan_cleanup loop which attempts to delete them will not do so, causing it to loop forever. Fix by checking for such nodes in the ext4_orphan_get function. This patch fixes the second case (image hdb.20000009.softloc...
```diff diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 8158083f7ac0..f7a0758f4689 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h @@ -1039,6 +1039,7 @@ extern void ext4_discard_reservation (struct inode *); extern void ext4_dirty_inode(struct inode *); extern int ext4_change_inode_journal_flag(struct inode *, in...
0ce3a7e5bd305e96c924fab1e3126480c665f017
Analyze and fix the following issue in the Linux kernel code: [SCSI] ipr: Fix HDIO_GET_IDENTITY oops for SATA devices
Problem Details: Currently, ipr does not support HDIO_GET_IDENTITY to SATA devices. An oops occurs if userspace attempts to send the command. Since hald issues the command, ensure we fail the ioctl in ipr. This is a temporary solution to the oops. Once the ipr libata EH conversion is upstream, ipr will fully support HD...
```diff diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index 999e91ea7451..e7a3a6554425 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c @@ -71,6 +71,7 @@ #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/libata.h> +#include <linux/hdreg.h> #include <asm/io.h> #include <asm/irq...
49641f1acfdfd437ed9b0a70b86bf36626c02afe
Analyze and fix the following issue in the Linux kernel code: Fix reference counting race on log buffers
Problem Details: When we release the iclog, we do an atomic_dec_and_lock to determine if we are the last reference and need to trigger update of log headers and writeout. However, in xlog_state_get_iclog_space() we also need to check if we have the last reference count there. If we do, we release the log buffer, othe...
```diff diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index afaee301b0ee..ad3d26ddfe31 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c @@ -2427,13 +2427,20 @@ restart: if (iclog->ic_size - iclog->ic_offset < 2*sizeof(xlog_op_header_t)) { xlog_state_switch_iclogs(log, iclog, iclog->ic_size); - /* If I'm ...
aa92db14270b79f0f91a9060b547a46f9e2639da
Analyze and fix the following issue in the Linux kernel code: stackprotector: better self-test
Problem Details: check stackprotector functionality by manipulating the canary briefly during bootup. far more robust than trying to overflow the stack. (which is architecture dependent, etc.) Signed-off-by: Ingo Molnar <mingo@elte.hu>
```diff diff --git a/kernel/panic.c b/kernel/panic.c index 6729e3f4ebcb..28153aec7100 100644 --- a/kernel/panic.c +++ b/kernel/panic.c @@ -347,22 +347,18 @@ static noinline void __stack_chk_test_func(void) if ((unsigned long)__builtin_return_address(0) == *(((unsigned long *)&foo)+1)) { printk(KERN_ERR "No -...
d9fc3fd3fab186447b5d2e7db3c2ee149064cc7c
Analyze and fix the following issue in the Linux kernel code: x86: fix savesegment() bug causing crashes on 64-bit
Problem Details: i spent a fair amount of time chasing a 64-bit bootup crash that manifested itself as bootup segfaults: S10network[1825]: segfault at 7f3e2b5d16b8 ip 00000031108748c9 sp 00007fffb9c14c70 error 4 in libc-2.7.so[3110800000+14d000] eventually causing init to die and panic the system: Kernel panic -...
```diff diff --git a/include/asm-x86/system.h b/include/asm-x86/system.h index c4946c5964bf..983ce37c491f 100644 --- a/include/asm-x86/system.h +++ b/include/asm-x86/system.h @@ -160,7 +160,7 @@ extern void native_load_gs_index(unsigned); * Save a segment register away */ #define savesegment(seg, value) \ - asm...
36560d255b017dbcaefbf0f8fee7ad4dd1f0fe0a
Analyze and fix the following issue in the Linux kernel code: [MTD] Fix const assignment in the MTD command line partitioning driver
Problem Details: Fix const to non-const pointer assignment in the MTD command line partitioning driver. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
```diff diff --git a/drivers/mtd/cmdlinepart.c b/drivers/mtd/cmdlinepart.c index 68782ab2f0de..71bc07f149b7 100644 --- a/drivers/mtd/cmdlinepart.c +++ b/drivers/mtd/cmdlinepart.c @@ -306,7 +306,7 @@ static int parse_cmdline_partitions(struct mtd_info *master, unsigned long offset; int i; struct cmdline_mtd_partit...
3a3688b6af103e2c86a7cfc2050988655e184ecc
Analyze and fix the following issue in the Linux kernel code: [MTD] [NOR] gen_probe: No debug message when debugging is disabled
Problem Details: Use pr_debug(...) instead of printk(KERN_DEBUG ...) so that the message is only printed when debugging is enabled. Signed-off-by: Jean Delvare <khali@linux-fr.org> Tested-by: John stoffel <john@stoffel.org> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
```diff diff --git a/drivers/mtd/chips/gen_probe.c b/drivers/mtd/chips/gen_probe.c index e53a58ae384f..f061885b2812 100644 --- a/drivers/mtd/chips/gen_probe.c +++ b/drivers/mtd/chips/gen_probe.c @@ -70,8 +70,8 @@ static struct cfi_private *genprobe_ident_chips(struct map_info *map, struct chi interleave and device...
452db2724351ff3d9416a183a7955e00ab4e6ab4
Analyze and fix the following issue in the Linux kernel code: [MTD] [NAND] fsl_elbc_nand: fix OOB workability for large page NAND chips
Problem Details: For large page chips, nand_bbt is looking into OOB area, and checking for "0xff 0xff" pattern at OOB offset 0. That is, two bytes should be reserved for bbt means. But ELBC driver is specifying ecclayout so that oobfree area starts at offset 1, so only one byte left for the bbt purposes. This causes ...
```diff diff --git a/drivers/mtd/nand/fsl_elbc_nand.c b/drivers/mtd/nand/fsl_elbc_nand.c index 1b06d29dd06b..99dc2be620a6 100644 --- a/drivers/mtd/nand/fsl_elbc_nand.c +++ b/drivers/mtd/nand/fsl_elbc_nand.c @@ -116,6 +116,20 @@ static struct nand_ecclayout fsl_elbc_oob_lp_eccm1 = { .oobavail = 48, }; +/* + * fsl_e...
83f5aac18ccd02170f4a61e7289ceabd5101c1a0
Analyze and fix the following issue in the Linux kernel code: x86, AMD IOMMU: fix device table entry size
Problem Details: A device table entry is actually only 256 *bits* large. Not 256 bytes. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com> Cc: iommu@lists.linux-foundation.org Cc: bhavna.sarathy@amd.com Cc: robert.richter@amd.com Signed-off-by: Ingo Molnar <mingo@elte.hu>
```diff diff --git a/include/asm-x86/amd_iommu_types.h b/include/asm-x86/amd_iommu_types.h index 14aaffe38fe5..2e8601b0f006 100644 --- a/include/asm-x86/amd_iommu_types.h +++ b/include/asm-x86/amd_iommu_types.h @@ -27,7 +27,7 @@ /* * some size calculation constants */ -#define DEV_TABLE_ENTRY_SIZE 256 +#define DE...
b2613e370dbeb69edbff989382fa54f2395aa471
Analyze and fix the following issue in the Linux kernel code: ftrace: build fix for ftraced_suspend
Problem Details: fix: kernel/trace/ftrace.c:1615: error: 'ftraced_suspend' undeclared (first use in this function) kernel/trace/ftrace.c:1615: error: (Each undeclared identifier is reported only once kernel/trace/ftrace.c:1615: error: for each function it appears in.) Signed-off-by: Ingo Molnar <mingo@elte.hu>
```diff diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 1359632668a4..4231a3dc224a 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -1612,7 +1612,9 @@ void ftrace_kill_atomic(void) { ftrace_disabled = 1; ftrace_enabled = 0; +#ifdef CONFIG_DYNAMIC_FTRACE ftraced_suspend = -1; +#e...
9076689ab07974a6f5d230fc241448f7a77e9078
Analyze and fix the following issue in the Linux kernel code: ARM: IXP4xx Ethernet NAPI fix
Problem Details: This patch removes some weirdness from IXP4xx Ethernet driver. Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
```diff diff --git a/drivers/net/arm/ixp4xx_eth.c b/drivers/net/arm/ixp4xx_eth.c index c617b64c288e..9b777d9433cd 100644 --- a/drivers/net/arm/ixp4xx_eth.c +++ b/drivers/net/arm/ixp4xx_eth.c @@ -522,7 +522,6 @@ static int eth_poll(struct napi_struct *napi, int budget) #endif if ((n = queue_get_desc(rxq, port, 0))...
2b8a0cf4890d7537a77b51caa8f508e4a05a0e67
Analyze and fix the following issue in the Linux kernel code: sched_clock: fix calculation of other CPU
Problem Details: The algorithm to calculate the 'now' of another CPU is not correct. At each scheduler tick, each CPU records the last sched_clock and gtod (tick_raw and tick_gtod respectively). If the TSC is somewhat the same in speed between two clocks the algorithm would be: tick_gtod1 + (now1 - tick_raw1) = tick...
```diff diff --git a/kernel/sched_clock.c b/kernel/sched_clock.c index 97159e225a77..55fca1e9e12a 100644 --- a/kernel/sched_clock.c +++ b/kernel/sched_clock.c @@ -203,8 +203,8 @@ u64 sched_clock_cpu(int cpu) now -= my_scd->tick_raw; now += scd->tick_raw; - now -= my_scd->tick_gtod; - now += scd->tick_gtod; + ...
72289824423655e67993c25c91a7a86a34917209
Analyze and fix the following issue in the Linux kernel code: [MTD] m25p80: fix bug - ATmel spi flash fails to be copied to
Problem Details: Atmel serial flash tends to power up with the protection status bits set. http://blackfin.uclinux.org/gf/project/uclinux-dist/tracker/?action=TrackerItemEdit&tracker_item_id=4089 [michael.hennerich@analog.com: remove duplicate code] Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signe...
```diff diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c index b402269301f6..b35c3333e210 100644 --- a/drivers/mtd/devices/m25p80.c +++ b/drivers/mtd/devices/m25p80.c @@ -33,6 +33,7 @@ /* Flash opcodes. */ #define OPCODE_WREN 0x06 /* Write enable */ #define OPCODE_RDSR 0x05 /* Read status r...
3c1e3896344063273715b332b1c0534deb9b286c
Analyze and fix the following issue in the Linux kernel code: libata-acpi: don't call sleeping function from invalid context
Problem Details: The problem is introduced by commit 664d080c41463570b95717b5ad86e79dc1be0877. acpi_evaluate_integer is a sleeping function, and it should not be called with spin_lock_irqsave. https://bugzilla.redhat.com/show_bug.cgi?id=451399 Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Jeff Garzik ...
```diff diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c index abea74b42a20..9330b7922f62 100644 --- a/drivers/ata/libata-acpi.c +++ b/drivers/ata/libata-acpi.c @@ -197,6 +197,10 @@ static void ata_acpi_handle_hotplug(struct ata_port *ap, struct ata_device *dev, /* This device does not support hotp...
4abaca17e758e3326c96ced88b2cd9b7b84922f6
Analyze and fix the following issue in the Linux kernel code: [GFS2] Fix GFS2's use of do_div() in its quota calculations
Problem Details: Fix GFS2's need_sync()'s use of do_div() on an s64 by using div_s64() instead. This does assume that gt_quota_scale_den can be cast to an s32. This was introduced by patch b3b94faa5fe5968827ba0640ee9fba4b3e7f736e. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Steven Whitehouse <s...
```diff diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c index 56aaf915c59a..3e073f5144fa 100644 --- a/fs/gfs2/quota.c +++ b/fs/gfs2/quota.c @@ -904,7 +904,7 @@ static int need_sync(struct gfs2_quota_data *qd) do_sync = 0; else { value *= gfs2_jindex_size(sdp) * num; - do_div(value, den); + value = div_s64(valu...
3d0decc4f49e8645cd6369b02ed076bebd3d61ad
Analyze and fix the following issue in the Linux kernel code: x86: fix tsc unification buglet with ftrace and stackprotector
Problem Details: Yinghai Lu reported crashes on 64-bit x86: BUG: unable to handle kernel NULL pointer dereference at 0000000000000000 IP: [<ffffffff80253b17>] hrtick_start_fair+0x89/0x173 [...] And with a long session of debugging and a lot of difficulty, tracked it down to this commit: ---------------> 8fbbc4b...
```diff diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile index 59b14c940a28..4033d8dc745b 100644 --- a/arch/x86/kernel/Makefile +++ b/arch/x86/kernel/Makefile @@ -13,7 +13,7 @@ CPPFLAGS_vmlinux.lds += -U$(UTS_MACHINE) nostackp := $(call cc-option, -fno-stack-protector) CFLAGS_vsyscall_64.o := $(PROFIL...