id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
2047e15be4247efd430d067aae5bd24c11d99999
Analyze and fix the following issue in the Linux kernel code: ali14xx: fix deadlock on error handling
Problem Details: Stop abusing ide_lock lock by switching to a private locking. Fixes same issue as fixed by Alan Cox in atiixp host driver with commit 6c5f8cc33eb2e10b6ab788bbe259fc142a068627. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
```diff diff --git a/drivers/ide/legacy/ali14xx.c b/drivers/ide/legacy/ali14xx.c index 0973c85e49b7..10311ecc674a 100644 --- a/drivers/ide/legacy/ali14xx.c +++ b/drivers/ide/legacy/ali14xx.c @@ -102,6 +102,8 @@ static void outReg (u8 data, u8 reg) outb_p(data, dataPort); } +static DEFINE_SPINLOCK(ali14xx_lock); + ...
8f173b5bf460a85791c131e774dc992f8cd578c1
Analyze and fix the following issue in the Linux kernel code: ide: fix ide_register_hw() to check hwif->io_ports[]
Problem Details: hwif->hw.io_ports[] and hwif->io_ports[] should be the same but "4drives" support and scc_pata host driver set only hwif->io_ports[]. To compensate for this check hwif->io_ports[] instead of hwif->hw.io_ports[] in ide_register_hw() (instead of fixing "4drives" and scc_pata because hwif->hw is to be re...
```diff diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index ce6644f41b21..9284f64bc2ee 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c @@ -707,7 +707,7 @@ int ide_register_hw(hw_regs_t *hw, void (*fixup)(ide_hwif_t *), do { for (index = 0; index < MAX_HWIFS; ++index) { hwif = &ide_hwifs[index]; - ...
cad221aa82c6f434c1d78bee1d485b5b69c626f8
Analyze and fix the following issue in the Linux kernel code: alim15x3: fix CD_ROM DMA and PIO FIFO settings setup
Problem Details: * Setup CD_ROM DMA and PIO FIFO settings in init_chipset_ali15x3() instead of ata66_ali15x3(). The latter is called from init_hwif_common_ali15x3() only if DMA base exists (which insists m5529_revision > 0x20). This changes makes CD_ROM DMA / PIO FIFO bits being set only once and also when "i...
```diff diff --git a/drivers/ide/pci/alim15x3.c b/drivers/ide/pci/alim15x3.c index 8ee2b48d105d..1ab769b31e64 100644 --- a/drivers/ide/pci/alim15x3.c +++ b/drivers/ide/pci/alim15x3.c @@ -1,5 +1,5 @@ /* - * linux/drivers/ide/pci/alim15x3.c Version 0.27 Aug 27 2007 + * linux/drivers/ide/pci/alim15x3.c Version 0.28 Sep...
9601a607cceb3632cde6c66fe28a3673dcd20be5
Analyze and fix the following issue in the Linux kernel code: ide: add hwif_register_devices() helper
Problem Details: Add hwif_register_devices() helper to fix code duplication between probe_hwif_init_with_fixup() and ideprobe_init(). Also remove stale comment while at it. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
```diff diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index e294c7415c27..549174853381 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c @@ -859,6 +859,7 @@ static void probe_hwif(ide_hwif_t *hwif, void (*fixup)(ide_hwif_t *hwif)) } static int hwif_init(ide_hwif_t *hwif); +static v...
cf6e854efb3682322351a21e64058ffc13250914
Analyze and fix the following issue in the Linux kernel code: ide: fix disabled ports reporting for PCI controllers
Problem Details: Report all disabled ports in ide_pci_setup_ports() (prevents the bogus warning when ide_hwif_configure()->ide_match_hwif() fails to find free ide_hwifs[] slots). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
```diff diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c index fff567bcedbe..6903100e3c83 100644 --- a/drivers/ide/setup-pci.c +++ b/drivers/ide/setup-pci.c @@ -526,7 +526,6 @@ out: void ide_pci_setup_ports(struct pci_dev *dev, ide_pci_device_t *d, int pciirq, ata_index_t *index) { int channels = (d->...
9aa5e993fa0f1a8c2c900bdfb80697d77b6dc223
Analyze and fix the following issue in the Linux kernel code: trivial comment wording/typo fix regarding taint flags
Problem Details: Signed-off-by: Daniel Roesen <dr@cluenet.de> Signed-off-by: Adrian Bunk <bunk@kernel.org>
```diff diff --git a/kernel/panic.c b/kernel/panic.c index 3886bd8230fe..6f6e03e91595 100644 --- a/kernel/panic.c +++ b/kernel/panic.c @@ -148,7 +148,7 @@ EXPORT_SYMBOL(panic); * 'F' - Module has been forcibly loaded. * 'S' - SMP with CPUs not designed for SMP. * 'R' - User forced a module unload. - * 'M' - M...
5a56db1c0fe196eea896078338fbf9258ab8365b
Analyze and fix the following issue in the Linux kernel code: LIB: Replace inappropriate include of <linux/bug.h>
Problem Details: Replace an irrelevant include of bug.h with the more appropriate includes of slab.h and module.h. it's not as if the original inclusion is an error, it's simply not related to the contents of that source file, while the other two are. compile-tested on i386. Signed-off-by: Robert P. J. Day <rpjday@m...
```diff diff --git a/lib/argv_split.c b/lib/argv_split.c index fad6ce4f7b57..5205a8dae5bc 100644 --- a/lib/argv_split.c +++ b/lib/argv_split.c @@ -4,7 +4,8 @@ #include <linux/kernel.h> #include <linux/ctype.h> -#include <linux/bug.h> +#include <linux/slab.h> +#include <linux/module.h> static const char *skip_sep...
4aad794a8a4233059334937fea541167a97b395b
Analyze and fix the following issue in the Linux kernel code: BOOT: Show that no_ipi_broadcast() takes a parameter.
Problem Details: a rather obvious fix given the opening of the function: ... static __init int no_ipi_broadcast(char *str) { get_option(&str, &no_broadcast); ... Signed-off-by: Robert P. J. Day <rpjday@mindspring.com> Signed-off-by: Adrian Bunk <bunk@kernel.org>
```diff diff --git a/arch/x86/mach-default/setup.c b/arch/x86/mach-default/setup.c index 3f08010f3517..47207ca71045 100644 --- a/arch/x86/mach-default/setup.c +++ b/arch/x86/mach-default/setup.c @@ -131,7 +131,7 @@ static __init int no_ipi_broadcast(char *str) return 1; } -__setup("no_ipi_broadcast", no_ipi_broadc...
cfd348fd6e2a5dcba68f4195ca642602d3a33cc3
Analyze and fix the following issue in the Linux kernel code: Documentation: Remove reference to non-existent "unwind_debug" kernel parm
Problem Details: Signed-off-by: Robert P. J. Day <rpjday@mindspring.com> Signed-off-by: Adrian Bunk <bunk@kernel.org>
```diff diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index c80ad89080b8..dd90e101a8b6 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt @@ -1990,10 +1990,6 @@ and is between 256 and 4096 characters. It is defined in the file norandmaps...
646b1c9dad52f3ab17e4e44b2bb7f24aad956db6
Analyze and fix the following issue in the Linux kernel code: Documentation: Fix erroneous "dmascc=" documentation
Problem Details: Signed-off-by: Robert P. J. Day <rpjday@mindspring.com> Signed-off-by: Adrian Bunk <bunk@kernel.org>
```diff diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 3ea49f98d405..c80ad89080b8 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt @@ -564,10 +564,6 @@ and is between 256 and 4096 characters. It is defined in the file See driver...
c03983ac9b268d4bbb8c2600baba5798aefa9d5d
Analyze and fix the following issue in the Linux kernel code: Spelling fix: explicitly
Problem Details: From: Jean Delvare <khali@linux-fr.org> Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Adrian Bunk <bunk@kernel.org>
```diff diff --git a/arch/cris/arch-v10/kernel/entry.S b/arch/cris/arch-v10/kernel/entry.S index ae45d4522e65..c5844cb70f09 100644 --- a/arch/cris/arch-v10/kernel/entry.S +++ b/arch/cris/arch-v10/kernel/entry.S @@ -97,7 +97,7 @@ * * Revision 1.36 2001/11/22 13:36:36 bjornw * * In ret_from_intr, check regs->dc...
603c83da19cf42d0f94022ac2fa389a431e32b84
Analyze and fix the following issue in the Linux kernel code: NFSv4: Fix an rpc_cred reference leakage in fs/nfs/delegation.c
Problem Details: Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
```diff diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c index af8b235d405d..11833f4caeaa 100644 --- a/fs/nfs/delegation.c +++ b/fs/nfs/delegation.c @@ -168,7 +168,8 @@ int nfs_inode_set_delegation(struct inode *inode, struct rpc_cred *cred, struct spin_unlock(&inode->i_lock); spin_unlock(&clp->cl_lock); - ...
a49c3c7736a2e77931dabc5bc4a83fb4b2da013e
Analyze and fix the following issue in the Linux kernel code: NFSv4: Ensure that we wait for the CLOSE request to complete
Problem Details: Otherwise, we do end up breaking close-to-open semantics. We also end up breaking some of the silly-rename tests in Connectathon on some setups. Please refer to the bug-report at http://bugzilla.linux-nfs.org/show_bug.cgi?id=150 Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
```diff diff --git a/fs/nfs/file.c b/fs/nfs/file.c index d29f90d00aa2..b3bb89f7d5d2 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c @@ -131,7 +131,7 @@ nfs_file_release(struct inode *inode, struct file *filp) { /* Ensure that dirty pages are flushed out with the right creds */ if (filp->f_mode & FMODE_WRITE) - fil...
565277f63c616e11c37309a1e98c052d18ebbb55
Analyze and fix the following issue in the Linux kernel code: NFS: Fix a race in sillyrename
Problem Details: lookup() and sillyrename() can race one another because the sillyrename() completion cannot take the parent directory's inode->i_mutex since the latter may be held by whoever is calling dput(). We therefore have little option but to add extra locking to ensure that nfs_lookup() and nfs_atomic_open() d...
```diff diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 8ec7fbd8240c..35334539d947 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -562,6 +562,7 @@ static int nfs_readdir(struct file *filp, void *dirent, filldir_t filldir) nfs_fattr_init(&fattr); desc->entry = &my_entry; + nfs_block_sillyrename(dentry); while(!d...
61e930a904966cc37e0a3404276f0b73037e57ca
Analyze and fix the following issue in the Linux kernel code: NFS: Fix a writeback race...
Problem Details: This patch fixes a regression that was introduced by commit 44dd151d5c21234cc534c47d7382f5c28c3143cd We cannot zero the user page in nfs_mark_uptodate() any more, since a) We'd be modifying the page without holding the page lock b) We can race with other updates of the page, most notably bec...
```diff diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 0cf9d1cd9bd2..89527a487ed7 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c @@ -174,8 +174,6 @@ static void nfs_mark_uptodate(struct page *page, unsigned int base, unsigned int return; if (count != nfs_page_length(page)) return; - if (count != PAGE_CACH...
739253765ed55742431866b19330fa0e1012c417
Analyze and fix the following issue in the Linux kernel code: [POWERPC] 4xx: Enable EMAC on Bamboo board
Problem Details: Fix some device tree omissions that prevented the new EMAC driver from setting up ethernet on the Bamboo board correctly and update the Bamboo defconfig. Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
```diff diff --git a/arch/powerpc/boot/dts/bamboo.dts b/arch/powerpc/boot/dts/bamboo.dts index a88ae3d218a5..cb2fb50a281c 100644 --- a/arch/powerpc/boot/dts/bamboo.dts +++ b/arch/powerpc/boot/dts/bamboo.dts @@ -98,11 +98,13 @@ interrupt-parent = <&MAL0>; interrupts = <0 1 2 3 4>; #interrupt-cells = <1>; + ...
b3af7a55da9925b73136d5358573e8962dfd35a0
Analyze and fix the following issue in the Linux kernel code: [POWERPC] 4xx: Enable EMAC for PPC405 Walnut board
Problem Details: This patch enables the ibm_newemac driver for the Walnut board. It fixes the device tree for the walnut board to order the MAL interrupts correctly and adds the local-mac-address property to the EMAC node. The bootwrapper is also updated to extract the MAC address from the OpenBIOS offset where it is...
```diff diff --git a/arch/powerpc/boot/dts/walnut.dts b/arch/powerpc/boot/dts/walnut.dts index ec54f4e04ad6..fa681f5343fe 100644 --- a/arch/powerpc/boot/dts/walnut.dts +++ b/arch/powerpc/boot/dts/walnut.dts @@ -64,10 +64,15 @@ MAL: mcmal { compatible = "ibm,mcmal-405gp", "ibm,mcmal"; dcr-reg = <180 62>; - ...
094624fa66758e9f555587c29b23cf5bc67c10fd
Analyze and fix the following issue in the Linux kernel code: [POWERPC] 4xx: Fix timebase clock selection on Walnut
Problem Details: The current bootwrapper fails to set the timebase clock to the CPU clock which causes the time to increment incorrectly. This fixes it by using the correct #define for the CPC0_CR1 register. Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
```diff diff --git a/arch/powerpc/boot/treeboot-walnut.c b/arch/powerpc/boot/treeboot-walnut.c index 3adf2d08a230..6be76b7edc10 100644 --- a/arch/powerpc/boot/treeboot-walnut.c +++ b/arch/powerpc/boot/treeboot-walnut.c @@ -57,8 +57,8 @@ void ibm405gp_fixup_clocks(unsigned int sysclk, unsigned int ser_clk) } /* se...
1d5499b5ac6515991a5149f934cb6f0ead653dbc
Analyze and fix the following issue in the Linux kernel code: [POWERPC] 4xx: Split early debug output and early boot console for 44x
Problem Details: Currently there's no way to enable early boot console on PowerPC 44x not specifying uart's physical address in kernel config, which is used for very early debug messages. This patch splits very early debug output (which needs uart physical address in kernel config) and early boot console (which searche...
```diff diff --git a/arch/powerpc/Kconfig.debug b/arch/powerpc/Kconfig.debug index c939fe86a9e0..6a79fe43e229 100644 --- a/arch/powerpc/Kconfig.debug +++ b/arch/powerpc/Kconfig.debug @@ -216,7 +216,6 @@ config PPC_EARLY_DEBUG_BEAT config PPC_EARLY_DEBUG_44x bool "Early serial debugging for IBM/AMCC 44x CPUs" depen...
8518609deeacebafd71855f87cc411adb0c3be4e
Analyze and fix the following issue in the Linux kernel code: Explain clearly why kmalloc() can't use __GFP_HIGHMEM.
Problem Details: Fix the wishy-washy comment to clearly explain why kmalloc() can't use the __GFP_HIGHMEM zone modifier. Signed-off-by: Robert P. J. Day <rpjday@mindspring.com> Signed-off-by: Adrian Bunk <bunk@kernel.org>
```diff diff --git a/mm/nommu.c b/mm/nommu.c index 42fb84e9e815..8f09333f78e1 100644 --- a/mm/nommu.c +++ b/mm/nommu.c @@ -175,7 +175,8 @@ EXPORT_SYMBOL(vfree); void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot) { /* - * kmalloc doesn't like __GFP_HIGHMEM for some reason + * You can't specify __G...
2e977c85d78e2ae846d313d0c139d0efbc0c1207
Analyze and fix the following issue in the Linux kernel code: fix typos in drivers/block/Kconfig
Problem Details: Signed-off-by: Adrian Bunk <bunk@kernel.org>
```diff diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig index ca4d7f0d09b7..38a085ea7758 100644 --- a/drivers/block/Kconfig +++ b/drivers/block/Kconfig @@ -351,7 +351,7 @@ config BLK_DEV_RAM_COUNT default "16" depends on BLK_DEV_RAM help - The default value is 16 RAM disks. Change this if you know wh...
7bb9d092de0b21f8f3f0a20dc2ec84395549fb62
Analyze and fix the following issue in the Linux kernel code: kbuild: fix first module build
Problem Details: When building a specific module before doing a total kernel build it failed because $(MORVERDIR) were missing. Creating the MODVERDIR explicit (independent of KBUILD_MODULES) fixed this. As a side-effect the MODVERDIR will be created also for a non-module build - but no harm done by that. Signed-off-b...
```diff diff --git a/Makefile b/Makefile index 784903a63e0f..6d7527cee9fa 100644 --- a/Makefile +++ b/Makefile @@ -884,10 +884,7 @@ prepare2: prepare3 outputmakefile prepare1: prepare2 include/linux/version.h include/linux/utsrelease.h \ include/asm include/config/auto.conf -ifneq ($(KBUILD_MODUL...
910b40468a9ce3f2f5d48c5d260329c27d45adb5
Analyze and fix the following issue in the Linux kernel code: kbuild: introduce cc-cross-prefix
Problem Details: cc-cross-prefix is useful for the architecture that like to provide a default CROSS_COMPILE value, but may have several to select between. Sample usage: ifneq ($(SUBARCH),$(ARCH)) ifeq ($(CROSS_COMPILE),) CROSS_COMPILE := $(call cc-cross-prefix, m68k-linux-gnu- m68k-linux-) ...
```diff diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt index f099b814d383..6166e2d7da76 100644 --- a/Documentation/kbuild/makefiles.txt +++ b/Documentation/kbuild/makefiles.txt @@ -518,6 +518,28 @@ more details, with real examples. In this example for a specific GCC version the b...
1b3e4c706c19dec10b11dac1b23071e3e4b262ad
Analyze and fix the following issue in the Linux kernel code: NULL terminate the pci_device_ids in pasemi_edac
Problem Details: Fixes: drivers/edac/pasemi_edac: struct pci_device_id is 32 bytes. The last of 1 is: 0x00 0x00 0x19 0x59 0x00 0x00 0xa0 0x0a 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 FATAL: drivers/edac/pasemi_edac: struct pci_device_id is ...
```diff diff --git a/drivers/edac/pasemi_edac.c b/drivers/edac/pasemi_edac.c index e66cdd42a392..9007d0677220 100644 --- a/drivers/edac/pasemi_edac.c +++ b/drivers/edac/pasemi_edac.c @@ -270,6 +270,7 @@ static void __devexit pasemi_edac_remove(struct pci_dev *pdev) static const struct pci_device_id pasemi_edac_pci_t...
a39bc51691a0c8880b7d10fa7c2f034f3ba9a037
Analyze and fix the following issue in the Linux kernel code: Uninline fork.c/exit.c
Problem Details: Save ~650 bytes here. add/remove: 4/0 grow/shrink: 0/7 up/down: 430/-1088 (-658) function old new delta __copy_fs_struct - 202 +202 __put_fs_struct - 112 +112 __exit_fs ...
```diff diff --git a/kernel/exit.c b/kernel/exit.c index 7dab2defec63..f1aec27f1df0 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -493,7 +493,7 @@ void reset_files_struct(struct task_struct *tsk, struct files_struct *files) } EXPORT_SYMBOL(reset_files_struct); -static inline void __exit_files(struct task_struct...
31155bc03e35a8d2b2551bc2eea3da5791e1b776
Analyze and fix the following issue in the Linux kernel code: Linux Kernel Markers - Samples
Problem Details: Module example showing how to use the Linux Kernel Markers. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/include/linux/marker.h b/include/linux/marker.h index 8038d89b835d..5f36cf946bcb 100644 --- a/include/linux/marker.h +++ b/include/linux/marker.h @@ -61,7 +61,6 @@ struct marker { __attribute__((section("__markers"), aligned(8))) = \ { __mstrtab_name_##name, __mstrtab_format_##name, \ 0, _...
8256e47cdc8923e9959eb1d7f95d80da538add80
Analyze and fix the following issue in the Linux kernel code: Linux Kernel Markers
Problem Details: The marker activation functions sits in kernel/marker.c. A hash table is used to keep track of the registered probes and armed markers, so the markers within a newly loaded module that should be active can be activated at module load time. marker_query has been removed. marker_get_first, marker_get_n...
```diff diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 5615440027ec..9f584cc5c5fb 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -12,7 +12,11 @@ /* .data section */ #define DATA_DATA \ *(.data) \ - *(.data.init.refok) +...
68318b8e0b61f98f0be833cc862ab6dee69348b4
Analyze and fix the following issue in the Linux kernel code: Hook up group scheduler with control groups
Problem Details: Enable "cgroup" (formerly containers) based fair group scheduling. This will let administrator create arbitrary groups of tasks (using "cgroup" pseudo filesystem) and control their cpu bandwidth usage. [akpm@linux-foundation.org: fix cpp condition] Signed-off-by: Srivatsa Vaddagiri <vatsa@linux.vnet....
```diff diff --git a/include/linux/cgroup_subsys.h b/include/linux/cgroup_subsys.h index 651ff0869b2d..0b9bfbde8168 100644 --- a/include/linux/cgroup_subsys.h +++ b/include/linux/cgroup_subsys.h @@ -30,3 +30,9 @@ SUBSYS(ns) #endif /* */ + +#ifdef CONFIG_FAIR_CGROUP_SCHED +SUBSYS(cpu_cgroup) +#endif + +/* */ diff --...
cb3808532eeb1719667356157fac9222ccb2c4ff
Analyze and fix the following issue in the Linux kernel code: Use extended crashkernel command line on ia64
Problem Details: This patch adapts IA64 to use the generic parse_crashkernel() function instead of its own parsing for the crashkernel command line. Because the total amount of System RAM must be known when calling this function, efi_memmap_init() is modified to return its accumulated total_memory variable. Also, the...
```diff diff --git a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c index 73ca86d03810..8e4894b205e2 100644 --- a/arch/ia64/kernel/efi.c +++ b/arch/ia64/kernel/efi.c @@ -967,7 +967,7 @@ find_memmap_space (void) * to use. We can allocate partial granules only if the unavailable * parts exist, and are WB. */ -voi...
283bb7fada7e33a759d8fc9bd7a44532e4ad420e
Analyze and fix the following issue in the Linux kernel code: IPC: fix error case when idr-cache is empty in ipcget()
Problem Details: With the use of idr to store the ipc, the case where the idr cache is empty, when idr_get_new is called (this may happen even if we call idr_pre_get() before), is not well handled: it lets semget()/shmget()/msgget() return ENOSPC when this cache is empty, what 1. does not reflect the facts and 2. does...
```diff diff --git a/ipc/msg.c b/ipc/msg.c index ccf5f495db7b..fdf3db5731ce 100644 --- a/ipc/msg.c +++ b/ipc/msg.c @@ -203,10 +203,10 @@ static int newque(struct ipc_namespace *ns, struct ipc_params *params) * ipc_addid() locks msq */ id = ipc_addid(&msg_ids(ns), &msq->q_perm, ns->msg_ctlmni); - if (id == -1) {...
3e148c79938aa39035669c1cfa3ff60722134535
Analyze and fix the following issue in the Linux kernel code: fix idr_find() locking
Problem Details: This is a patch that fixes the way idr_find() used to be called in ipc_lock(): in all the paths that don't imply an update of the ipcs idr, it was called without the idr tree being locked. The changes are: . in ipc_ids, the mutex has been changed into a reader/writer semaphore. . ipc_lock() now ta...
```diff diff --git a/ipc/msg.c b/ipc/msg.c index b7274dbf0917..413bf9c7aec3 100644 --- a/ipc/msg.c +++ b/ipc/msg.c @@ -34,7 +34,7 @@ #include <linux/syscalls.h> #include <linux/audit.h> #include <linux/seq_file.h> -#include <linux/mutex.h> +#include <linux/rwsem.h> #include <linux/nsproxy.h> #include <asm/curren...
f4566f04854d78acfc74b9acb029744acde9d033
Analyze and fix the following issue in the Linux kernel code: ipc: fix wrong comments
Problem Details: This patch fixes the wrong / obsolete comments in the ipc code. Also adds a missing lock around ipc_get_maxid() in shm_get_stat(). Signed-off-by: Nadia Derbey <Nadia.Derbey@bull.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/ipc/msg.c b/ipc/msg.c index 9f545826bcf5..b7274dbf0917 100644 --- a/ipc/msg.c +++ b/ipc/msg.c @@ -156,6 +156,13 @@ static inline void msg_rmid(struct ipc_namespace *ns, struct msg_queue *s) ipc_rmid(&msg_ids(ns), &s->q_perm); } +/** + * newque - Create a new msg queue + * @ns: namespace + * @p...
023a53557ea0e987b002e9a844242ef0b0aa1eb3
Analyze and fix the following issue in the Linux kernel code: ipc: integrate ipc_checkid() into ipc_lock()
Problem Details: This patch introduces a new ipc_lock_check() routine interface: . each time ipc_checkid() is called, this is done after calling ipc_lock(). ipc_checkid() is now called from inside ipc_lock_check(). [akpm@linux-foundation.org: build fix] [akpm@linux-foundation.org: fix RCU locking] Signed-off-b...
```diff diff --git a/ipc/msg.c b/ipc/msg.c index c2ee26f01055..74e672035675 100644 --- a/ipc/msg.c +++ b/ipc/msg.c @@ -73,10 +73,7 @@ static struct ipc_ids init_msg_ids; #define msg_ids(ns) (*((ns)->ids[IPC_MSG_IDS])) -#define msg_lock(ns, id) ((struct msg_queue*)ipc_lock(&msg_ids(ns), id)) #define msg_unlock(msq...
d2b20b11547cefc89d6c81937e81afaf3c62808b
Analyze and fix the following issue in the Linux kernel code: Add irq protection in the percpu-counters cpu-hotplug-callback path
Problem Details: Some of the per-cpu counters and thus their locks are accessed from IRQ contexts. This can cause a deadlock if it interrupts a cpu-offline thread which is transferring a dead-cpu's counts to the global counter. Add appropriate IRQ protection in the cpu-hotplug callback path. Signed-off-by: Gautham R...
```diff diff --git a/lib/percpu_counter.c b/lib/percpu_counter.c index 9659eabffc31..393a0e915c23 100644 --- a/lib/percpu_counter.c +++ b/lib/percpu_counter.c @@ -124,12 +124,13 @@ static int __cpuinit percpu_counter_hotcpu_callback(struct notifier_block *nb, mutex_lock(&percpu_counters_lock); list_for_each_entry(f...
73e753a50dcac7d6d4fa8b9552203ef544a70d77
Analyze and fix the following issue in the Linux kernel code: CPU HOTPLUG: avoid hotadd when proper possible_map isn't specified
Problem Details: cpu-hot-add should be fail if cpu is not set in cpu_possible_map. If go ahead, the system will panic soon. Especially, arch which requires additional_cpus= parameter should handle this. Tested on ia64. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu...
```diff diff --git a/kernel/cpu.c b/kernel/cpu.c index ebf6647a2bd4..6b3a0c15144f 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -265,6 +265,15 @@ out_notify: int __cpuinit cpu_up(unsigned int cpu) { int err = 0; + if (!cpu_isset(cpu, cpu_possible_map)) { + printk(KERN_ERR "can't online cpu %d because it is not "...
470fd646444c65a5d062a371f5ec8dcedee61239
Analyze and fix the following issue in the Linux kernel code: hotplug cpu: migrate a task within its cpuset
Problem Details: When a cpu is disabled, move_task_off_dead_cpu() is called for tasks that have been running on that cpu. Currently, such a task is migrated: 1) to any cpu on the same node as the disabled cpu, which is both online and among that task's cpus_allowed 2) to any cpu which is both online and among th...
```diff diff --git a/Documentation/cpu-hotplug.txt b/Documentation/cpu-hotplug.txt index b6d24c22274b..a741f658a3c9 100644 --- a/Documentation/cpu-hotplug.txt +++ b/Documentation/cpu-hotplug.txt @@ -220,7 +220,9 @@ A: The following happen, listed in no particular order :-) CPU_DOWN_PREPARE or CPU_DOWN_PREPARE_FROZEN...
270f722d4d5f94b02fd48eed47e57917ab00a858
Analyze and fix the following issue in the Linux kernel code: Fix tsk->exit_state usage
Problem Details: tsk->exit_state can only be 0, EXIT_ZOMBIE, or EXIT_DEAD. A non-zero test is the same as tsk->exit_state & (EXIT_ZOMBIE | EXIT_DEAD), so just testing tsk->exit_state is sufficient. Signed-off-by: Eugene Teo <eugeneteo@kernel.sg> Cc: Roland McGrath <roland@redhat.com> Cc: Oleg Nesterov <oleg@tv-sign.r...
```diff diff --git a/fs/proc/array.c b/fs/proc/array.c index 04b689f3288f..7a34571203bc 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c @@ -146,8 +146,7 @@ static inline const char *get_task_state(struct task_struct *tsk) TASK_UNINTERRUPTIBLE | TASK_STOPPED | TASK_TRACED)) | - (tsk->e...
14ed9d23aa9acd79210a92ac561a728b42a8e281
Analyze and fix the following issue in the Linux kernel code: remove BITS_TO_TYPE macro
Problem Details: remove BITS_TO_TYPE macro I realized, that it is actually the same as DIV_ROUND_UP, use it instead. [akpm@linux-foundation.org: build fix] Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation....
```diff diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h index 64b4641904fe..acad1105d942 100644 --- a/include/linux/bitmap.h +++ b/include/linux/bitmap.h @@ -6,6 +6,7 @@ #include <linux/types.h> #include <linux/bitops.h> #include <linux/string.h> +#include <linux/kernel.h> /* * bitmaps provide bit ...
532237eff1f271302ed923af6d811a699d582bbc
Analyze and fix the following issue in the Linux kernel code: cyber2000fb: checkpatch fixes
Problem Details: This patch fixes errors and warnings pointed out by the checkpatch.pl script. Antonino Daplas replaced BIT with ENCODE_BIT. Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl> Signed-off-by: Antonino Daplas <adaplas@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Lin...
```diff diff --git a/drivers/video/cyber2000fb.c b/drivers/video/cyber2000fb.c index 5e3edf475bf4..5fb8675e0d6b 100644 --- a/drivers/video/cyber2000fb.c +++ b/drivers/video/cyber2000fb.c @@ -62,7 +62,7 @@ struct cfb_info { struct display_switch *dispsw; struct display *display; struct pci_dev *dev; - unsigned c...
8707d8b8c0cbdf4441507f8dded194167da896c7
Analyze and fix the following issue in the Linux kernel code: Fix cpusets update_cpumask
Problem Details: Cause writes to cpuset "cpus" file to update cpus_allowed for member tasks: - collect batches of tasks under tasklist_lock and then call set_cpus_allowed() on them outside the lock (since this can sleep). - add a simple generic priority heap type to allow efficient collection of batches of tasks ...
```diff diff --git a/include/linux/prio_heap.h b/include/linux/prio_heap.h new file mode 100644 index 000000000000..08094350f26a --- /dev/null +++ b/include/linux/prio_heap.h @@ -0,0 +1,58 @@ +#ifndef _LINUX_PRIO_HEAP_H +#define _LINUX_PRIO_HEAP_H + +/* + * Simple insertion-only static-sized priority heap containing + ...
020958b6272882c1a8bfbe5f3e0927f3845c2698
Analyze and fix the following issue in the Linux kernel code: cpusets: decrustify cpuset mask update code
Problem Details: Decrustify the kernel/cpuset.c 'cpus' and 'mems' updating code. Other than subtle improvements in the consistency of identifying white space at the beginning and end of passed in masks, this doesn't make any visible difference in behaviour. But it's one or two hundred kernel text bytes smaller, and e...
```diff diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 203ca52e78dd..64ad59cfad9b 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c @@ -488,6 +488,14 @@ static int validate_change(const struct cpuset *cur, const struct cpuset *trial) return -EINVAL; } + /* Cpusets with tasks can't have empty cpus_allowed...
c9c5d92211883e9ae22394d1f157ab0d3a7ec895
Analyze and fix the following issue in the Linux kernel code: pid namespaces: create a slab-cache for 'struct pid_namespace'
Problem Details: This will help fixing memory leaks due to bad reference counting. Signed-off-by: Sukadev Bhattiprolu <sukadev@us.ibm.com> Cc: Oleg Nesterov <oleg@tv-sign.ru> Cc: Sukadev Bhattiprolu <sukadev@us.ibm.com> Cc: Paul Menage <menage@google.com> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: ...
```diff diff --git a/kernel/pid.c b/kernel/pid.c index f76097c60475..d88b83eb703e 100644 --- a/kernel/pid.c +++ b/kernel/pid.c @@ -40,6 +40,7 @@ static struct hlist_head *pid_hash; static int pidhash_shift; struct pid init_struct_pid = INIT_STRUCT_PID; +static struct kmem_cache *pid_ns_cachep; int pid_max = PID_M...
30e49c263e36341b60b735cbef5ca37912549264
Analyze and fix the following issue in the Linux kernel code: pid namespaces: allow cloning of new namespace
Problem Details: When clone() is invoked with CLONE_NEWPID, create a new pid namespace and then create a new struct pid for the new process. Allocate pid_t's for the new process in the new pid namespace and all ancestor pid namespaces. Make the newly cloned process the session and process group leader. Since the act...
```diff diff --git a/include/linux/sched.h b/include/linux/sched.h index b0bf326143a9..1301c0875370 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -25,6 +25,7 @@ #define CLONE_NEWUTS 0x04000000 /* New utsname group? */ #define CLONE_NEWIPC 0x08000000 /* New ipcs */ #define CLONE_NEWUSER 0x10000...
198fe21b0a17fe9c68cb519ecc566534b04f122b
Analyze and fix the following issue in the Linux kernel code: pid namespaces: helpers to find the task by its numerical ids
Problem Details: When searching the task by numerical id on may need to find it using global pid (as it is done now in kernel) or by its virtual id, e.g. when sending a signal to a task from one namespace the sender will specify the task's virtual id and we should find the task by this value. [akpm@linux-foundation.o...
```diff diff --git a/fs/proc/base.c b/fs/proc/base.c index 36983e7bb2c1..50e149e08d96 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -2333,7 +2333,7 @@ static struct task_struct *next_tgid(unsigned int tgid) rcu_read_lock(); retry: task = NULL; - pid = find_ge_pid(tgid); + pid = find_ge_pid(tgid, &init_pid_ns...
2e4a707269a409950c3f315010c20f9719c594e2
Analyze and fix the following issue in the Linux kernel code: pid namespaces: move exit_task_namespaces()
Problem Details: Make task release its namespaces after it has reparented all his children to child_reaper, but before it notifies its parent about its death. The reason to release namespaces after reparenting is that when task exits it may send a signal to its parent (SIGCHLD), but if the parent has already exited it...
```diff diff --git a/kernel/exit.c b/kernel/exit.c index 3f2182ccf187..df2eee9c68ce 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -774,6 +774,7 @@ static void exit_notify(struct task_struct *tsk) * jobs, send them a SIGHUP and then a SIGCONT. (POSIX 3.2.2.2) */ forget_original_parent(tsk); + exit_task_name...
d4c5e41f3f1b0c19448fcf2d259bdab1ede75e2e
Analyze and fix the following issue in the Linux kernel code: whitespace fixes: task exit handling
Problem Details: Signed-off-by: Daniel Walker <dwalker@mvista.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/kernel/exit.c b/kernel/exit.c index c5d97af12159..179ac74bf911 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -405,7 +405,7 @@ void daemonize(const char *name, ...) switch_task_namespaces(current, init_task.nsproxy); } - exit_files(current); + exit_files(current); current->files = init...
4e6045f134784f4b158b3c0f7a282b04bd816887
Analyze and fix the following issue in the Linux kernel code: workqueue: debug flushing deadlocks with lockdep
Problem Details: In the following scenario: code path 1: my_function() -> lock(L1); ...; flush_workqueue(); ... code path 2: run_workqueue() -> my_work() -> ...; lock(L1); ... you can get a deadlock when my_work() is queued or running but my_function() has acquired L1 already. This patch adds a pseudo-lock to e...
```diff diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h index f6279f68a827..4c4d236ded18 100644 --- a/include/linux/lockdep.h +++ b/include/linux/lockdep.h @@ -275,6 +275,14 @@ extern void lockdep_init_map(struct lockdep_map *lock, const char *name, lockdep_init_map(&(lock)->dep_map, #lock, \ (l...
cf7b708c8d1d7a27736771bcf4c457b332b0f818
Analyze and fix the following issue in the Linux kernel code: Make access to task's nsproxy lighter
Problem Details: When someone wants to deal with some other taks's namespaces it has to lock the task and then to get the desired namespace if the one exists. This is slow on read-only paths and may be impossible in some cases. E.g. Oleg recently noticed a race between unshare() and the (sent for review in cgroups) ...
```diff diff --git a/fs/proc/base.c b/fs/proc/base.c index fbff900fd5ad..6afca09a6534 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -350,18 +350,21 @@ struct proc_mounts { static int mounts_open(struct inode *inode, struct file *file) { struct task_struct *task = get_proc_task(inode); + struct nsproxy *nsp; ...
b460cbc581a53cc088ceba80608021dd49c63c43
Analyze and fix the following issue in the Linux kernel code: pid namespaces: define is_global_init() and is_container_init()
Problem Details: is_init() is an ambiguous name for the pid==1 check. Split it into is_global_init() and is_container_init(). A cgroup init has it's tsk->pid == 1. A global init also has it's tsk->pid == 1 and it's active pid namespace is the init_pid_ns. But rather than check the active pid namespace, compare the ...
```diff diff --git a/arch/alpha/mm/fault.c b/arch/alpha/mm/fault.c index 25154df3055a..e0593e606140 100644 --- a/arch/alpha/mm/fault.c +++ b/arch/alpha/mm/fault.c @@ -188,7 +188,7 @@ do_page_fault(unsigned long address, unsigned long mmcsr, /* We ran out of memory, or some other thing happened to us that made us...
a47afb0f9d794d525a372c8d69902147cc88222a
Analyze and fix the following issue in the Linux kernel code: pid namespaces: round up the API
Problem Details: The set of functions process_session, task_session, process_group and task_pgrp is confusing, as the names can be mixed with each other when looking at the code for a long time. The proposals are to * equip the functions that return the integer with _nr suffix to represent that fact, * and to make a...
```diff diff --git a/arch/mips/kernel/irixelf.c b/arch/mips/kernel/irixelf.c index b997af713eb3..7852c7cdf29e 100644 --- a/arch/mips/kernel/irixelf.c +++ b/arch/mips/kernel/irixelf.c @@ -1172,8 +1172,8 @@ static int irix_core_dump(long signr, struct pt_regs *regs, struct file *file, u prstatus.pr_sighold = current->b...
858d72ead4864da0fb0b89b919524125ce998e27
Analyze and fix the following issue in the Linux kernel code: cgroups: implement namespace tracking subsystem
Problem Details: When a task enters a new namespace via a clone() or unshare(), a new cgroup is created and the task moves into it. This version names cgroups which are automatically created using cgroup_clone() as "node_<pid>" where pid is the pid of the unsharing or cloned process. (Thanks Pavel for the idea) This ...
```diff diff --git a/include/linux/cgroup_subsys.h b/include/linux/cgroup_subsys.h index cbadc3b5dbc0..651ff0869b2d 100644 --- a/include/linux/cgroup_subsys.h +++ b/include/linux/cgroup_subsys.h @@ -24,3 +24,9 @@ SUBSYS(debug) #endif /* */ + +#ifdef CONFIG_CGROUP_NS +SUBSYS(ns) +#endif + +/* */ diff --git a/include...
846c7bb055747989891f5cd2bb6e8d56243ba1e7
Analyze and fix the following issue in the Linux kernel code: Add cgroupstats
Problem Details: This patch is inspired by the discussion at http://lkml.org/lkml/2007/4/11/187 and implements per cgroup statistics as suggested by Andrew Morton in http://lkml.org/lkml/2007/4/11/263. The patch is on top of 2.6.21-mm1 with Paul's cgroups v9 patches (forward ported) This patch implements per cgroup s...
```diff diff --git a/Documentation/accounting/cgroupstats.txt b/Documentation/accounting/cgroupstats.txt new file mode 100644 index 000000000000..eda40fd39cad --- /dev/null +++ b/Documentation/accounting/cgroupstats.txt @@ -0,0 +1,27 @@ +Control Groupstats is inspired by the discussion at +http://lkml.org/lkml/2007/4/1...
006cb99200a38a8e3b0cbc1be48035a08921e601
Analyze and fix the following issue in the Linux kernel code: Task Control Groups: simple task cgroup debug info subsystem
Problem Details: This example subsystem exports debugging information as an aid to diagnosing refcount leaks, etc, in the cgroup framework. Signed-off-by: Paul Menage <menage@google.com> Cc: Serge E. Hallyn <serue@us.ibm.com> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Cc: Dave Hansen <haveblue@us.ibm.com> Cc: Bal...
```diff diff --git a/include/linux/cgroup_subsys.h b/include/linux/cgroup_subsys.h index a568b8746f18..cbadc3b5dbc0 100644 --- a/include/linux/cgroup_subsys.h +++ b/include/linux/cgroup_subsys.h @@ -19,4 +19,8 @@ SUBSYS(cpuacct) /* */ +#ifdef CONFIG_CGROUP_DEBUG +SUBSYS(debug) +#endif + /* */ diff --git a/init/Kc...
55a230aae650157720becc09cadb7d10efbf5013
Analyze and fix the following issue in the Linux kernel code: cpuset: zero malloc - revert the old cpuset fix
Problem Details: The cpuset code to present a list of tasks using a cpuset to user space could write to an array that it had kmalloc'd, after a kmalloc request of zero size. The problem was that the code didn't check for writes past the allocated end of the array until -after- the first write. This is a race conditio...
```diff diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 64950fa5d321..a40a2c4384b3 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c @@ -1638,9 +1638,9 @@ static int pid_array_load(pid_t *pidarray, int npids, struct cpuset *cs) do_each_thread(g, p) { if (p->cpuset == cs) { + pidarray[n++] = p->pid; i...
8f731f7d83d6c6a3eeb32cce79bfcddbf7fac8cc
Analyze and fix the following issue in the Linux kernel code: kernel-api docbook: fix content problems
Problem Details: Fix kernel-api docbook contents problems. docproc: linux-2.6.23-git13/include/asm-x86/unaligned_32.h: No such file or directory Warning(linux-2.6.23-git13//include/linux/list.h:482): bad line: of list entry Warning(linux-2.6.23-git13//mm/filemap.c:864): No description found for parameter 'ra' Warni...
```diff diff --git a/Documentation/DocBook/kernel-api.tmpl b/Documentation/DocBook/kernel-api.tmpl index d3290c46af51..aa38cc5692a0 100644 --- a/Documentation/DocBook/kernel-api.tmpl +++ b/Documentation/DocBook/kernel-api.tmpl @@ -46,7 +46,7 @@ <sect1><title>Atomic and pointer manipulation</title> !Iinclude/as...
3ee1667042c350003b9d3f35e5666cc8c43ce8aa
Analyze and fix the following issue in the Linux kernel code: reiserfs: fix usage of signed ints for block numbers
Problem Details: Do a quick signedness check for block numbers. There are a number of places where signed integers are used for block numbers, which limits the usable file system size to 8 TiB. The disk format, excepting a problem which will be fixed in the following patch, supports file systems up to 16 TiB in size....
```diff diff --git a/fs/reiserfs/bitmap.c b/fs/reiserfs/bitmap.c index 28a1b06081fc..f7275176305e 100644 --- a/fs/reiserfs/bitmap.c +++ b/fs/reiserfs/bitmap.c @@ -47,7 +47,9 @@ test_bit(_ALLOC_ ## optname , &SB_ALLOC_OPTS(s)) static inline void get_bit_address(struct super_block *s, - b_blocknr_t block, i...
6c57c2c8d3862c8d5b908669654f6565da74ec19
Analyze and fix the following issue in the Linux kernel code: reiserfs: fix memset byte count during resize
Problem Details: Correct the memset in reiserfs_resize to clear the memory allocated for the new bitmap info structs. Previously, it would clear the memory used by the old size. Depending on the contents of memory, this could cause incorrect caching behavior for bitmap blocks in the newly allocated area. Signed-off-...
```diff diff --git a/fs/reiserfs/resize.c b/fs/reiserfs/resize.c index 976cc7887a0d..3bec2f96242a 100644 --- a/fs/reiserfs/resize.c +++ b/fs/reiserfs/resize.c @@ -119,7 +119,7 @@ int reiserfs_resize(struct super_block *s, unsigned long block_count_new) return -ENOMEM; } memset(bitmap, 0, - sizeof(stru...
8e186e454e871678c01b7eec4da5865111076095
Analyze and fix the following issue in the Linux kernel code: reiserfs: dont use BUG when panicking
Problem Details: Change reiserfs_panic() to use panic() initially instead of BUG(). Using BUG() ignores the configurable panic behavior, so systems that should be failing and rebooting are left hanging. This causes problems in active/standby HA scenarios. Signed-off-by: Jeff Mahoney <jeffm@suse.com> Signed-off-by: A...
```diff diff --git a/fs/reiserfs/prints.c b/fs/reiserfs/prints.c index bc808a91eeaa..5e7388b32d02 100644 --- a/fs/reiserfs/prints.c +++ b/fs/reiserfs/prints.c @@ -356,13 +356,11 @@ extern struct tree_balance *cur_tb; void reiserfs_panic(struct super_block *sb, const char *fmt, ...) { do_reiserfs_warning(fmt); - pri...
7598392894f6455cf2114f29a98a0289df788056
Analyze and fix the following issue in the Linux kernel code: reiserfs: fix up lockdep warnings
Problem Details: Add I_MUTEX_XATTR annotations to the inode locking in the reiserfs xattr code. Signed-off-by: Jeff Mahoney <jeffm@suse.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c index fab4b9b2664f..1597f6b649e0 100644 --- a/fs/reiserfs/xattr.c +++ b/fs/reiserfs/xattr.c @@ -484,7 +484,7 @@ reiserfs_xattr_set(struct inode *inode, const char *name, const void *buffer, /* Resize it so we're ok to write there */ newattrs.ia_size = b...
9ad163ae0df8a3adab6d521475142392e3efb7a6
Analyze and fix the following issue in the Linux kernel code: JBD: Fix JBD warnings when compiling with CONFIG_JBD_DEBUG
Problem Details: Note from Mingming's JBD2 fix: Noticed all warnings are occurs when the debug level is 0. Then found the "jbd2: Move jbd2-debug file to debugfs" patch http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0f49d5d019afa4e94253bfc92f0daca3badb990b changed the jbd2_journal_enable_...
```diff diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c index 3dec003b773e..9b162cd6c16c 100644 --- a/fs/ext3/inode.c +++ b/fs/ext3/inode.c @@ -2954,7 +2954,7 @@ int ext3_write_inode(struct inode *inode, int wait) return 0; if (ext3_journal_current_handle()) { - jbd_debug(0, "called recursively, non-PF_MEMALLOC!...
7a266e75cf5a1efd20d084408a1b7f1a185496dd
Analyze and fix the following issue in the Linux kernel code: jbd: fix commit code to properly abort journal
Problem Details: We should really call journal_abort() and not __journal_abort_hard() in case of errors. The latter call does not record the error in the journal superblock and thus filesystem won't be marked as with errors later (and user could happily mount it without any warning). Signed-off-by: Jan Kara <jack@sus...
```diff diff --git a/fs/jbd/commit.c b/fs/jbd/commit.c index a263d82761df..8f1f2aa5fb39 100644 --- a/fs/jbd/commit.c +++ b/fs/jbd/commit.c @@ -466,7 +466,7 @@ void journal_commit_transaction(journal_t *journal) spin_unlock(&journal->j_list_lock); if (err) - __journal_abort_hard(journal); + journal_abort(journal...
c2a9159cdd8b334a0dfaf69d8b07cd57b5272baa
Analyze and fix the following issue in the Linux kernel code: jbd: config_jbd_debug cannot create /proc entry
Problem Details: The jbd-debug file used to be located in /proc/sys/fs/jbd-debug, but create_proc_entry() does not do lookups on file names that are more that one directory deep. This causes the entry creation to fail and hence, no proc file is created. Instead of fixing this on procfs might as well move the jbd2-deb...
```diff diff --git a/fs/Kconfig b/fs/Kconfig index e31f3691b151..cc28a69246a7 100644 --- a/fs/Kconfig +++ b/fs/Kconfig @@ -220,7 +220,7 @@ config JBD config JBD_DEBUG bool "JBD (ext3) debugging support" - depends on JBD + depends on JBD && DEBUG_FS help If you are using the ext3 journaled file system (or pot...
1c099244485ff8bb93c2cd41304a445adc7f54e6
Analyze and fix the following issue in the Linux kernel code: jbd: remove printk() from J_ASSERT macros
Problem Details: Remove printk from J_ASSERT to preserve registers during BUG. Signed-off-by: Chris Snook <csnook@redhat.com> Cc: "Stephen C. Tweedie" <sct@redhat.com> Cc: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org...
```diff diff --git a/include/linux/jbd.h b/include/linux/jbd.h index a3abf51e488f..d77f67d954f8 100644 --- a/include/linux/jbd.h +++ b/include/linux/jbd.h @@ -248,17 +248,7 @@ typedef struct journal_superblock_s #include <linux/fs.h> #include <linux/sched.h> -#define JBD_ASSERTIONS -#ifdef JBD_ASSERTIONS -#define J...
feea6d4d1247aa10648dcd9a328ea210a6321def
Analyze and fix the following issue in the Linux kernel code: isdn: fix random hard freeze with AVM T1 cards
Problem Details: This fixes the hard freeze debugged for AVM C4 cards for the AVM T1 cards. Signed-off-by: Karsten Keil <kkeil@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/drivers/isdn/hardware/avm/t1isa.c b/drivers/isdn/hardware/avm/t1isa.c index c925020fe9b7..6130724e46e7 100644 --- a/drivers/isdn/hardware/avm/t1isa.c +++ b/drivers/isdn/hardware/avm/t1isa.c @@ -180,8 +180,8 @@ static irqreturn_t t1isa_interrupt(int interrupt, void *devptr) ApplId = (unsigned)...
1e9c7813723c925623f2e21a93e2d5dc05ea8d12
Analyze and fix the following issue in the Linux kernel code: isdn: fix random hard freeze with AVM cards using b1dma
Problem Details: This fixes the hard freeze debugded for AVM C4 cards using the b1dma interface. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Karsten Keil <kkeil@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/drivers/isdn/hardware/avm/b1dma.c b/drivers/isdn/hardware/avm/b1dma.c index 428872b653e9..669f6f67449c 100644 --- a/drivers/isdn/hardware/avm/b1dma.c +++ b/drivers/isdn/hardware/avm/b1dma.c @@ -486,11 +486,13 @@ static void b1dma_handle_rx(avmcard *card) card->name); } else { memcpy(sk...
eac141deb4f0136059372923ac3f0eab0bef5bce
Analyze and fix the following issue in the Linux kernel code: isdn: fix random hard freeze with AVM c4 card part 2
Problem Details: One call was missing in the previous patch. Signed-off-by: Karsten Keil <kkeil@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/drivers/isdn/hardware/avm/c4.c b/drivers/isdn/hardware/avm/c4.c index 8710cf6214d9..4bbbbe688077 100644 --- a/drivers/isdn/hardware/avm/c4.c +++ b/drivers/isdn/hardware/avm/c4.c @@ -678,7 +678,9 @@ static irqreturn_t c4_handle_interrupt(avmcard *card) for (i=0; i < card->nr_control...
477116e69dc48aaa70cca47668cd4aa82f39e05c
Analyze and fix the following issue in the Linux kernel code: fix a trivial typo in scripts/checkstack.pl
Problem Details: Trivial change in a comment. Signed-off-by: Joern Engel <joern@logfs.org> Signed-off-by: Andre Haupt <andre@finow14.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/scripts/checkstack.pl b/scripts/checkstack.pl index b458e2acb4ac..28e480c8100f 100755 --- a/scripts/checkstack.pl +++ b/scripts/checkstack.pl @@ -15,7 +15,7 @@ # AVR32 port by Haavard Skinnemoen <hskinnemoen@atmel.com> # # Usage: -# objdump -d vmlinux | stackcheck.pl [arch] +# objdump -d vmlinux...
b293d758470e971253eec42b817bc9ef1213b228
Analyze and fix the following issue in the Linux kernel code: Console events and accessibility
Problem Details: Some external modules like Speakup need to monitor console output. This adds a VT notifier that such modules can use to get console output events: allocation, deallocation, writes, other updates (cursor position, switch, etc.) [akpm@linux-foundation.org: fix headers_check] Signed-off-by: Samuel Thiba...
```diff diff --git a/drivers/char/vt.c b/drivers/char/vt.c index 1764c67b585f..7a5badfb7d84 100644 --- a/drivers/char/vt.c +++ b/drivers/char/vt.c @@ -99,6 +99,7 @@ #include <linux/pm.h> #include <linux/font.h> #include <linux/bitops.h> +#include <linux/notifier.h> #include <asm/io.h> #include <asm/system.h> @@ ...
22124c9999f00340b062fff740db30187bf18454
Analyze and fix the following issue in the Linux kernel code: kmap leak fix for x86_32 kdump
Problem Details: copy_oldmem_page should not return leaving a page frame from the previous kernel mapped. Signed-off-by: Fernando Luis Vázquez Cao <fernando@oss.ntt.co.jp> Acked-by: Vivek Goyal <vgoyal@in.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-fo...
```diff diff --git a/arch/x86/kernel/crash_dump_32.c b/arch/x86/kernel/crash_dump_32.c index 32e75d0731a9..72d0c56c1b48 100644 --- a/arch/x86/kernel/crash_dump_32.c +++ b/arch/x86/kernel/crash_dump_32.c @@ -47,6 +47,7 @@ ssize_t copy_oldmem_page(unsigned long pfn, char *buf, if (!kdump_buf_page) { printk(KERN_WA...
41ab4396e19fba338baf28044d3e48385744b930
Analyze and fix the following issue in the Linux kernel code: Console keyboard events and accessibility
Problem Details: Some blind people use a kernel engine called Speakup which uses hardware synthesis to speak what gets displayed on the screen. They use the PC keyboard to control this engine (start/stop, accelerate, ...) and also need to get keyboard feedback (to make sure to know what they are typing, the caps lock ...
```diff diff --git a/drivers/char/keyboard.c b/drivers/char/keyboard.c index 212276affa1f..d54f4a3ae340 100644 --- a/drivers/char/keyboard.c +++ b/drivers/char/keyboard.c @@ -42,6 +42,7 @@ #include <linux/sysrq.h> #include <linux/input.h> #include <linux/reboot.h> +#include <linux/notifier.h> extern void ctrl_alt...
50899561aa15b9227009ae40e58852c32fc81944
Analyze and fix the following issue in the Linux kernel code: advansys: depends on VIRT_TO_BUS
Problem Details: Fix powerpc allmodconfig build: advansys requires virt_to_bus() but powerpc doesn't implement it. Cc: James Bottomley <James.Bottomley@steeleye.com> Cc: Paul Mackerras <paulus@samba.org> Acked-by: Matthew Wilcox <willy@linux.intel.com> Cc: "David S. Miller" <davem@davemloft.net> Signed-off-by: Andrew ...
```diff diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig index 30905cebefbb..a5763c6e9362 100644 --- a/drivers/scsi/Kconfig +++ b/drivers/scsi/Kconfig @@ -521,7 +521,7 @@ config SCSI_DPT_I2O config SCSI_ADVANSYS tristate "AdvanSys SCSI support" - depends on SCSI + depends on SCSI && VIRT_TO_BUS depends o...
f9e26291be31cb494c1845e356daba84b39ab059
Analyze and fix the following issue in the Linux kernel code: sched: fix guest time accounting going faster than user time accounting
Problem Details: cputime_add already adds, dont do it twice. Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
```diff diff --git a/fs/proc/array.c b/fs/proc/array.c index 27b59f5f3bd1..b9be6e355cc6 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c @@ -446,7 +446,7 @@ static int do_task_stat(struct task_struct *task, char *buffer, int whole) maj_flt += sig->maj_flt; utime = cputime_add(utime, sig->utime); stime = c...
71b31233a215be27e2efbcc0e739cbebb0bde078
Analyze and fix the following issue in the Linux kernel code: x86: acpi use cpu_physical_id
Problem Details: This is from an earlier message from Christoph Lameter: processor_core.c currently tries to determine the apicid by special casing for IA64 and x86. The desired information is readily available via cpu_physical_id() on IA64, i386 and x86_64. Signed-off-by: Christoph Lameter <cl...
```diff diff --git a/arch/x86/kernel/mpparse_64.c b/arch/x86/kernel/mpparse_64.c index 4336c0fc3b81..ef4aab123581 100644 --- a/arch/x86/kernel/mpparse_64.c +++ b/arch/x86/kernel/mpparse_64.c @@ -57,6 +57,8 @@ unsigned long mp_lapic_addr = 0; /* Processor that is doing the boot up */ unsigned int boot_cpu_id = -1U; ...
9d975ebda56699c1b8480e9736caf33a61ccb810
Analyze and fix the following issue in the Linux kernel code: i386: consolidate show_regs and show_registers for i386
Problem Details: Both functions printk the same information, except for CRx and debug registers in the show_registers() one and a bit different manner. So move the common code into one place. This is already done for x86_64, so I think it's worth having the same on i386. This saves 100 bytes of .rodata section :) ... ...
```diff diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c index 097aeafce5ff..ba4b64117084 100644 --- a/arch/x86/kernel/process_32.c +++ b/arch/x86/kernel/process_32.c @@ -295,34 +295,52 @@ static int __init idle_setup(char *str) } early_param("idle", idle_setup); -void show_regs(struct pt_re...
54ffaa45c5f572ff6c344ca583137d0edf2d78cc
Analyze and fix the following issue in the Linux kernel code: x86: fix CONFIG_NUMA and nosmp | maxcpus=0/1 crash
Problem Details: x86 NUMA kernels crash in the scheduler setup code if "nosmp" or "maxcpus=0" is passed on the boot command line: | Brought up 1 CPUs | BUG: unable to handle kernel NULL pointer dereference at virtual address 00000000 | printing eip: c011f0b5 *pde = 00000000 | Oops: 0000 [#1] SMP | | Pid: 1, comm: swap...
```diff diff --git a/arch/x86/kernel/smpboot_32.c b/arch/x86/kernel/smpboot_32.c index be3faac04719..65e5de7d64db 100644 --- a/arch/x86/kernel/smpboot_32.c +++ b/arch/x86/kernel/smpboot_32.c @@ -1008,6 +1008,7 @@ static void __init smp_boot_cpus(unsigned int max_cpus) printk(KERN_ERR "... forcing use of dummy APIC e...
957ff882f9db86e017f730e77322ec5193178e5e
Analyze and fix the following issue in the Linux kernel code: x86, vsyscall: fix the oops crash with __pa_vsymbol()
Problem Details: Appended patch fixes an oops while changing the vsyscall sysctl. I am sure no one tested this code before integrating into mainline :( BTW, using ioremap() in vsyscall_sysctl_change() to get the virtual address of a kernel symbol sounds like an over kill.. I wonder if we can define a simple __va_vsymb...
```diff diff --git a/arch/x86/kernel/vsyscall_64.c b/arch/x86/kernel/vsyscall_64.c index 585541ca1a7e..4a2c340ab0f3 100644 --- a/arch/x86/kernel/vsyscall_64.c +++ b/arch/x86/kernel/vsyscall_64.c @@ -48,7 +48,7 @@ ({unsigned long v; \ extern char __vsyscall_0; \ asm("" : "=r" (v) : "0" (x)); \ - ((v - VSYS...
f887b93e17448552eb6761d21277c33177bb904b
Analyze and fix the following issue in the Linux kernel code: [MIPS] SMTC: Build fix.
Problem Details: Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
```diff diff --git a/arch/mips/kernel/cevt-r4k.c b/arch/mips/kernel/cevt-r4k.c index 08b84d476c87..a915e5693421 100644 --- a/arch/mips/kernel/cevt-r4k.c +++ b/arch/mips/kernel/cevt-r4k.c @@ -10,6 +10,7 @@ #include <linux/interrupt.h> #include <linux/percpu.h> +#include <asm/smtc_ipi.h> #include <asm/time.h> sta...
9a24d04a3c26c223f22493492c5c9085b8773d4a
Analyze and fix the following issue in the Linux kernel code: x86: fix global_flush_tlb() bug
Problem Details: While we were reviewing pageattr_32/64.c for unification, Thomas Gleixner noticed the following serious SMP bug in global_flush_tlb(): down_read(&init_mm.mmap_sem); list_replace_init(&deferred_pages, &l); up_read(&init_mm.mmap_sem); this is SMP-unsafe because list_replace_init() done on two CPUs i...
```diff diff --git a/arch/x86/mm/pageattr_64.c b/arch/x86/mm/pageattr_64.c index 8a4f65bf956e..c7b7dfe1d405 100644 --- a/arch/x86/mm/pageattr_64.c +++ b/arch/x86/mm/pageattr_64.c @@ -230,9 +230,14 @@ void global_flush_tlb(void) struct page *pg, *next; struct list_head l; - down_read(&init_mm.mmap_sem); + /* + * ...
ce0e32e65f70337e0732c97499b643205fa8ea31
Analyze and fix the following issue in the Linux kernel code: [NET]: Fix possible dev_deactivate race condition
Problem Details: The function dev_deactivate is supposed to only return when all outstanding transmissions have completed. Unfortunately it is possible for store operations in the driver's transmit function to only become visible after dev_deactivate returns. This patch fixes this by taking the queue lock after we se...
```diff diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index e01d57692c9a..fa1a6f45dc41 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c @@ -556,6 +556,7 @@ void dev_deactivate(struct net_device *dev) { struct Qdisc *qdisc; struct sk_buff *skb; + int running; spin_lock_bh(&dev...
9b013e05e0289c190a53d78ca029e2f21c0e4485
Analyze and fix the following issue in the Linux kernel code: [NET]: Fix bug in sk_filter race cures.
Problem Details: Looks like this might be causing problems, at least for me on ppc. This happened during a normal boot, right around first interface config/dhcp run.. cpu 0x0: Vector: 300 (Data Access) at [c00000000147b820] pc: c000000000435e5c: .sk_filter_delayed_uncharge+0x1c/0x60 lr: c0000000004360d0: .sk_a...
```diff diff --git a/net/core/filter.c b/net/core/filter.c index 1f0068eae501..e0a06942c025 100644 --- a/net/core/filter.c +++ b/net/core/filter.c @@ -447,7 +447,8 @@ int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk) rcu_assign_pointer(sk->sk_filter, fp); rcu_read_unlock_bh(); - sk_filter_delayed_un...
ed67b92385a5afddc98d5ff0894b2854c4a54dac
Analyze and fix the following issue in the Linux kernel code: ide: add IDE_HFLAG_ERROR_STOPS_FIFO host flag
Problem Details: Add IDE_HFLAG_ERROR_STOPS_FIFO host flag and use it instead of hwif->err_stops_fifo. As a side-effect this change fixes hwif->err_stops_fifo not being restored by ide_hwif_restore(). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
```diff diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c index ec835e37e729..5c8b008676fb 100644 --- a/drivers/ide/ide-io.c +++ b/drivers/ide/ide-io.c @@ -484,7 +484,8 @@ static ide_startstop_t ide_ata_error(ide_drive_t *drive, struct request *rq, u8 } } - if ((stat & DRQ_STAT) && rq_data_dir(rq) == READ...
fbf47840fe679bf370d07267df6f851b4f53e78d
Analyze and fix the following issue in the Linux kernel code: hpt366: remove ->init_setup
Problem Details: * Split off hpt{374,371,366}_init() helper from init_setup_hpt{374,371,366}(). * Merge init_setup_{374,372n,371,372a,302,366}() into hpt366_init_one(). While at it: * Use "HPT36x" name for HPT366/HPT368 chipsets. * Add .chip_name to struct hpt_info and use it to set set d->name. * Convert .max_ult...
```diff diff --git a/drivers/ide/pci/hpt366.c b/drivers/ide/pci/hpt366.c index 26c15f20537e..3817c7db616e 100644 --- a/drivers/ide/pci/hpt366.c +++ b/drivers/ide/pci/hpt366.c @@ -1,9 +1,10 @@ /* - * linux/drivers/ide/pci/hpt366.c Version 1.15 Oct 1, 2007 + * linux/drivers/ide/pci/hpt366.c Version 1.20 Oct 1, 2007 ...
238e4f142c33bb34440cc64029dde7b9fbc4e65f
Analyze and fix the following issue in the Linux kernel code: ide: add IDE_HFLAG_NO_LBA48 and IDE_HFLAG_NO_LBA48_DMA host flags
Problem Details: Add IDE_HFLAG_NO_LBA48[_DMA] host flags, use it instead of hwif->no_lba48[_dma] and then remove no longer needed hwif->no_lba48[_dma]. As a side-effect this change fixes hwif->no_lba48_dma not being restored by ide_hwif_restore(). Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bar...
```diff diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c index 92177ca48b4d..2722d9165b6b 100644 --- a/drivers/ide/ide-disk.c +++ b/drivers/ide/ide-disk.c @@ -169,7 +169,7 @@ static ide_startstop_t __ide_do_rw_disk(ide_drive_t *drive, struct request *rq, nsectors.all = (u16) rq->nr_sectors; - if (hwi...
9ffcf364f9d0aca3ea79e9987c368eb75925460e
Analyze and fix the following issue in the Linux kernel code: ide: remove ->init_setup_dma from ide_pci_device_t (take 2)
Problem Details: * Make ide_pci_device_t.host_flags u32 and add IDE_HFLAG_CS5520 host flag. * Pass ide_pci_device_t *d to setup-pci.c::ide_get_or_set_dma_base() and use d->name instead of hwif->cds->name. * Set IDE_HFLAG_CS5520 host flag in cs5520 host driver and use it in ide_get_or_set_dma_base() to find out wh...
```diff diff --git a/drivers/ide/pci/cs5520.c b/drivers/ide/pci/cs5520.c index 17d35ca61351..4fb43206621a 100644 --- a/drivers/ide/pci/cs5520.c +++ b/drivers/ide/pci/cs5520.c @@ -105,18 +105,6 @@ static void cs5520_set_dma_mode(ide_drive_t *drive, const u8 speed) cs5520_set_pio_mode(drive, 0); } -/* - * We provide...
15d8061bf02aa299b2447f7a22fd18b4a503ea9d
Analyze and fix the following issue in the Linux kernel code: ide: Fix cs5535 driver accessing beyond array boundary
Problem Details: The cs5535 uses an incorrect construct to access the other drive of a pair, causing it to access beyond an array boundary on the secondary interface. This fixes it by using the new ide_get_paired_drive() helper instead. Bart: patch description fixes Signed-off-by: Benjamin Herrenschmidt <benh@kernel...
```diff diff --git a/drivers/ide/pci/cs5535.c b/drivers/ide/pci/cs5535.c index e4891a16afef..c141b7306179 100644 --- a/drivers/ide/pci/cs5535.c +++ b/drivers/ide/pci/cs5535.c @@ -84,7 +84,7 @@ static void cs5535_set_speed(ide_drive_t *drive, const u8 speed) /* Set the PIO timings */ if ((speed & XFER_MODE) == XFE...
a87a87ccdc541e0a0cc8c7d01a365be8d9153a7b
Analyze and fix the following issue in the Linux kernel code: ide: Fix siimage driver accessing beyond array boundary
Problem Details: The siimage uses an incorrect construct to access the other drive of a pair, causing it to access beyond an array boundary on the secondary interface. This fixes it by using the new ide_get_paired_drive() helper instead. Bart: patch description fixes Signed-off-by: Benjamin Herrenschmidt <benh@kerne...
```diff diff --git a/drivers/ide/pci/siimage.c b/drivers/ide/pci/siimage.c index 85d0afd00e66..8254260c5e6b 100644 --- a/drivers/ide/pci/siimage.c +++ b/drivers/ide/pci/siimage.c @@ -180,7 +180,7 @@ static void sil_set_pio_mode(ide_drive_t *drive, u8 pio) const u16 data_speed[] = { 0x328a, 0x2283, 0x1104, 0x10c3, 0x1...
27db71a2f1399f00c2a00a908def75e72b59f475
Analyze and fix the following issue in the Linux kernel code: [PARISC] Fix palo target
Problem Details: Hunk missing from previous commit, oops. Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
```diff diff --git a/arch/parisc/Makefile b/arch/parisc/Makefile index 3f1faca724ab..f93c4cd77980 100644 --- a/arch/parisc/Makefile +++ b/arch/parisc/Makefile @@ -79,7 +79,7 @@ PALO := $(shell if which palo; then : ; \ fi) palo: vmlinux - @if [ -x $PALO ]; then \ + @if [ ! -x $(PALO) ]; then \ echo 'ERROR: Plea...
952184304fbf030f0133d8b66a91b2847dce729e
Analyze and fix the following issue in the Linux kernel code: I/OAT: Add completion callback for async_tx interface use
Problem Details: The async_tx interface includes a completion callback. This adds support for using that callback, including using interrupts on completion. [akpm@linux-foundation.org: various fixes] Signed-off-by: Shannon Nelson <shannon.nelson@intel.com> Cc: Dan Williams <dan.j.williams@intel.com> Signed-off-by: An...
```diff diff --git a/drivers/dma/ioat_dma.c b/drivers/dma/ioat_dma.c index 15906027c8de..7e4a785c2dff 100644 --- a/drivers/dma/ioat_dma.c +++ b/drivers/dma/ioat_dma.c @@ -212,6 +212,18 @@ static dma_cookie_t ioat_tx_submit(struct dma_async_tx_descriptor *tx) } while (len && (new = ioat_dma_get_next_descriptor(ioat_ch...
7df7cf0676060d778486359676734447347e1caf
Analyze and fix the following issue in the Linux kernel code: I/OAT: cleanup pci issues
Problem Details: Reorder the pci release actions Letting go of the resources in the right order helps get rid of occasional kernel complaints. Fix the pci_driver object name [Randy Dunlap] Rename the struct pci_driver data so that false section mismatch warnings won't be produced. Cc: Randy Dunlap <ra...
```diff diff --git a/drivers/dma/ioat.c b/drivers/dma/ioat.c index f7276bf2fe7e..54fdeb7c4945 100644 --- a/drivers/dma/ioat.c +++ b/drivers/dma/ioat.c @@ -55,9 +55,7 @@ struct ioat_device { static int __devinit ioat_probe(struct pci_dev *pdev, const struct pci_device_id *id); -#ifdef IOAT_DMA_REMOVE static voi...
ac0191517c3b5f2cf68ab36756d64ef035c4a770
Analyze and fix the following issue in the Linux kernel code: IPMI: fix hotmod remove lock
Problem Details: The removal of proc entries was done holding a lock, which is no longer allowed. There is no need for the lock, only a mutex is required, so switch over to a mutex. Signed-off-by: Corey Minyard <cminyard@mvista.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvald...
```diff diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c index 46d14ac16212..5dc1265ce1d5 100644 --- a/drivers/char/ipmi/ipmi_msghandler.c +++ b/drivers/char/ipmi/ipmi_msghandler.c @@ -221,10 +221,8 @@ struct ipmi_smi void *send_info; #ifdef CONFIG_PROC_FS ...
650dd0c7faf8126aaa261833dc9171a070deeaf3
Analyze and fix the following issue in the Linux kernel code: IPMI: documentation fixes
Problem Details: Clean up IPMI documentation to remove references to high-res timers and add info about the polling thread. Also fix an doc error for a parameter. Signed-off-by: Corey Minyard <cminyard@mvista.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-f...
```diff diff --git a/Documentation/IPMI.txt b/Documentation/IPMI.txt index 24dc3fcf1594..83b05459eb5c 100644 --- a/Documentation/IPMI.txt +++ b/Documentation/IPMI.txt @@ -441,17 +441,20 @@ ACPI, and if none of those then a KCS device at the spec-specified 0xca2. If you want to turn this off, set the "trydefaults" opt...
c80544dc0b87bb65038355e7aafdc30be16b26ab
Analyze and fix the following issue in the Linux kernel code: sparse pointer use of zero as null
Problem Details: Get rid of sparse related warnings from places that use integer as NULL pointer. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Cc: Andi Kleen <ak@suse.de> Cc: Jeff Garzik <jeff@garzik.org> Cc: Matt Mackall <mpm@selenic.com> Cc: Ian K...
```diff diff --git a/arch/x86/kernel/vsyscall_64.c b/arch/x86/kernel/vsyscall_64.c index cf7a47b35e10..585541ca1a7e 100644 --- a/arch/x86/kernel/vsyscall_64.c +++ b/arch/x86/kernel/vsyscall_64.c @@ -172,7 +172,7 @@ time_t __vsyscall(1) vtime(time_t *t) if (unlikely(!__vsyscall_gtod_data.sysctl_enabled)) return tim...
c79e322f63592c00b25b17af6a1782fad6c6fe6e
Analyze and fix the following issue in the Linux kernel code: fuse: add file handle to getattr operation
Problem Details: Add necessary protocol changes for supplying a file handle with the getattr operation. Step the API version to 7.9. This patch doesn't actually supply the file handle, because that needs some kind of VFS support, which we haven't yet been able to agree upon. [akpm@linux-foundation.org: coding-style ...
```diff diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index a058b664859c..8c5d156284a0 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c @@ -705,10 +705,12 @@ static void fuse_fillattr(struct inode *inode, struct fuse_attr *attr, stat->blksize = (1 << inode->i_blkbits); } -static int fuse_do_getattr(struct inode *inode,...
1fb69e7817296da8a6824804bb206ca1e7f31425
Analyze and fix the following issue in the Linux kernel code: fuse: fix race between getattr and write
Problem Details: Getattr and lookup operations can be running in parallel to attribute changing operations, such as write and setattr. This means, that if for example getattr was slower than a write, the cached size attribute could be set to a stale value. To prevent this race, introduce a per-filesystem attribute ve...
```diff diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index b18e06daeffb..a058b664859c 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c @@ -63,13 +63,21 @@ static u64 time_to_jiffies(unsigned long sec, unsigned long nsec) * Set dentry and possibly attribute timeouts from the lookup/mk* * replies */ -static void fuse_c...
e57ac68378a287d6336d187b26971f35f7ee7251
Analyze and fix the following issue in the Linux kernel code: fuse: fix allowing operations
Problem Details: The following operation didn't check if sending the request was allowed: setattr listxattr statfs Some other operations don't explicitly do the check, but VFS calls ->permission() which checks this. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-found...
```diff diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index d1acab931330..b18e06daeffb 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c @@ -721,7 +721,7 @@ static int fuse_refresh_attributes(struct inode *inode) * for which the owner of the mount has ptrace privilege. This * excludes processes started by other users, s...
42a2b6ad71b011144d21d88a124140bb2bf1023f
Analyze and fix the following issue in the Linux kernel code: ext3: fix setup_new_group_blocks locking
Problem Details: setup_new_group_blocks() manipulates the group descriptor block bh under the block_bitmap bh's lock. It shouldn't matter since nobody but resize should be touching these blocks, but it's worth fixing up. Signed-off-by: Eric Sandeen <sandeen@redhat.com> C: <linux-ext4@vger.kernel.org> Signed-off-by: A...
```diff diff --git a/fs/ext3/resize.c b/fs/ext3/resize.c index 771f7ada15d9..44de1453c301 100644 --- a/fs/ext3/resize.c +++ b/fs/ext3/resize.c @@ -245,10 +245,10 @@ static int setup_new_group_blocks(struct super_block *sb, brelse(gdb); goto exit_bh; } - lock_buffer(bh); - memcpy(gdb->b_data, sbi->s_group_d...
0f0a89ebe1ccf7c280534f69577cdd182941eb6a
Analyze and fix the following issue in the Linux kernel code: ext3: support large blocksize up to PAGESIZE
Problem Details: This patch set supports large block size(>4k, <=64k) in ext3 just enlarging the block size limit. But it is NOT possible to have 64kB blocksize on ext3 without some changes to the directory handling code. The reason is that an empty 64kB directory block would have a rec_len == (__u16)2^16 == 0, and t...
```diff diff --git a/fs/ext3/super.c b/fs/ext3/super.c index 141573de7a9a..81868c0bc40e 100644 --- a/fs/ext3/super.c +++ b/fs/ext3/super.c @@ -1620,7 +1620,11 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent) } brelse (bh); - sb_set_blocksize(sb, blocksize); + if (!sb_set_blocksiz...
c8f30ae54714abf494d79826d90b5e4844fbf355
Analyze and fix the following issue in the Linux kernel code: mips: fix bitops
Problem Details: Documentation/atomic_ops.txt defines these primitives must contain a memory barrier both before and after their memory operation. This is consistent with the atomic ops implementation on mips. Signed-off-by: Nick Piggin <npiggin@suse.de> Cc: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Andrew Mo...
```diff diff --git a/include/asm-mips/bitops.h b/include/asm-mips/bitops.h index 0d3373f64920..5478d947e289 100644 --- a/include/asm-mips/bitops.h +++ b/include/asm-mips/bitops.h @@ -240,6 +240,8 @@ static inline int test_and_set_bit(unsigned long nr, unsigned short bit = nr & SZLONG_MASK; unsigned long res; + sm...
7c29ca5b8d13287ed67d2863f4c5f7bfc1a15279
Analyze and fix the following issue in the Linux kernel code: alpha: fix bitops
Problem Details: Documentation/atomic_ops.txt defines these primitives must contain a memory barrier both before and after their memory operation. This is consistent with the atomic ops implementation on alpha. Signed-off-by: Nick Piggin <npiggin@suse.de> Cc: Richard Henderson <rth@twiddle.net> Cc: Ivan Kokshaysky <i...
```diff diff --git a/include/asm-alpha/bitops.h b/include/asm-alpha/bitops.h index ca667d121898..f1bbe6cf0e84 100644 --- a/include/asm-alpha/bitops.h +++ b/include/asm-alpha/bitops.h @@ -117,6 +117,9 @@ test_and_set_bit(unsigned long nr, volatile void *addr) int *m = ((int *) addr) + (nr >> 5); __asm__ __volatile...
761bb431908e84d1793c5eb6c2ae2cc4926bed3e
Analyze and fix the following issue in the Linux kernel code: Redefine {un}register_hotcpu_notifier() !HOTPLUG_CPU stubs
Problem Details: The return of the present "do {} while" based stub definition of register_hotcpu_notifier() cannot be checked. This makes the stub asymmetric w.r.t. the real HOTPLUG_CPU=y implementation that is int-returning. So let us redefine this to be consistent with the full version. Also do the same for unre...
```diff diff --git a/include/linux/cpu.h b/include/linux/cpu.h index 0ad72c4cf312..b79c57569367 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h @@ -119,8 +119,9 @@ static inline void cpuhotplug_mutex_unlock(struct mutex *cpu_hp_mutex) #define lock_cpu_hotplug() do { } while (0) #define unlock_cpu_hotplug()...