id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
fd079facb3fdd1b0517f0b2087ac05c30ea09cfe
Analyze and fix the following issue in the Linux kernel code: KVM: fix TASK_DELAY_ACCT kconfig warning
Problem Details: Fix kconfig dependency warning: warning: (KVM) selects TASK_DELAY_ACCT which has unmet direct dependencies (TASKSTATS) Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Avi Kivity <avi@redhat.com>
```diff diff --git a/arch/x86/kvm/Kconfig b/arch/x86/kvm/Kconfig index 988724b236b6..0a09b58bb1cb 100644 --- a/arch/x86/kvm/Kconfig +++ b/arch/x86/kvm/Kconfig @@ -31,6 +31,7 @@ config KVM select KVM_ASYNC_PF select USER_RETURN_NOTIFIER select KVM_MMIO + select TASKSTATS select TASK_DELAY_ACCT ---help--- S...
0a96e9754d6c4a2a31e50ee6c6e36ec13f80bc25
Analyze and fix the following issue in the Linux kernel code: [SCSI] lpfc 8.3.25: PCI and SR-IOV Fixes
Problem Details: PCI and SR-IOV Fixes - Call pci_save_state after the pci_restore_state completes. - After calling pci_enable_pcie_error_reporting() and checking the return value for logging messages from rc, reset rc to 0 to it will not later be interpreted for error. - Read PCI config space SR-IOV capability to ...
```diff diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c index bffd86f204dd..80ca11c5158c 100644 --- a/drivers/scsi/lpfc/lpfc_attr.c +++ b/drivers/scsi/lpfc/lpfc_attr.c @@ -1466,80 +1466,10 @@ lpfc_sriov_hw_max_virtfn_show(struct device *dev, struct Scsi_Host *shost = class_to_shost(dev); ...
5248a7498e5f6f3d6d276080466946f82f0ea56a
Analyze and fix the following issue in the Linux kernel code: [SCSI] lpfc 8.3.25: Fabric and Target Discovery Fixes
Problem Details: Fabric and Target Discovery Fixes - Clear FC_VPORT_NEEDS_INIT_VPI flag during completion of REG_VFI mailbox command. - Prevent SLI3 Code from unregistering the physical VPI. - Add an else clause to the code that checks and sets sp->cmn.request_multiple_Nport to clear the bit. - Remove a redundant ...
```diff diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index d3a712a27e31..1725b81770e9 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -647,21 +647,15 @@ lpfc_cmpl_els_flogi_fabric(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, } lpfc_cleanup_pendi...
7851fe2c7f294d0beccf4c3d6af52e8247b89f00
Analyze and fix the following issue in the Linux kernel code: [SCSI] lpfc 8.3.25: Adapter Interface fixes and changes
Problem Details: Adapter Interface fixes and changes - Modify the macro field from lpfc_init_vpi_vpi to lpfc_init_vfi_vpi - Add the new CQE_CODE_RECEIVE_V1 CQE Code, add code in the driver to handle the new Code the same as the CQE_CODE_RECEIVE code except that there are two new checks for this code that will caus...
```diff diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h index 42b583b26139..0441361c79c8 100644 --- a/drivers/scsi/lpfc/lpfc.h +++ b/drivers/scsi/lpfc/lpfc.h @@ -470,9 +470,10 @@ enum intr_type_t { struct unsol_rcv_ct_ctx { uint32_t ctxt_id; uint32_t SID; - uint32_t oxid; uint32_t flags; #defin...
88a2cfbb8bf3802ca5a90c7d1567a1e542e6ef0c
Analyze and fix the following issue in the Linux kernel code: [SCSI] lpfc 8.3.25: Miscellaneous Bug fixes and code cleanup
Problem Details: Miscellaneous Bug fixes and code cleanup - Fix 16G link speed reporting by adding check for 16G check. - Change the check and enforcement of MAILBOX_EXT_SIZE (2048B) to the check and enforcement of BSG_MBOX_SIZE - sizeof(MAILBOX_t) (3840B). - Instead of waiting for a fixed amount of time after perfo...
```diff diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h index 8ec2c86a49d4..42b583b26139 100644 --- a/drivers/scsi/lpfc/lpfc.h +++ b/drivers/scsi/lpfc/lpfc.h @@ -20,6 +20,11 @@ *******************************************************************/ #include <scsi/scsi_host.h> + +#if defined(CONFIG_DE...
7c56b9fd3b6d2d933075d12abee67ceb7c90d04a
Analyze and fix the following issue in the Linux kernel code: [SCSI] lpfc 8.3.25: T10 DIF Fixes
Problem Details: T10 DIF Fixes - Fix the case where the SCSI Host supplies the CRC and driver to controller protection is on. - Only support T10 DIF type 1. LBA always goes in ref tag and app tag is not checked. - Change the format of the sense data passed up to the SCSI layer to match the Descriptor Format Sens...
```diff diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c index 135a53baa735..29ccb1519226 100644 --- a/drivers/scsi/lpfc/lpfc_attr.c +++ b/drivers/scsi/lpfc/lpfc_attr.c @@ -3678,7 +3678,9 @@ LPFC_ATTR_R(enable_bg, 0, 0, 1, "Enable BlockGuard Support"); # - Default will result in registering c...
767cd365b22820df07b962b49ce04b220b98e537
Analyze and fix the following issue in the Linux kernel code: ALSA: asihpi - bug fix pa use before init.
Problem Details: Fixes bug introduced by 1c073b67. Also declare pa local to block in which it is used. Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
```diff diff --git a/sound/pci/asihpi/hpioctl.c b/sound/pci/asihpi/hpioctl.c index 65fcf4770731..e0cff0c72e51 100644 --- a/sound/pci/asihpi/hpioctl.c +++ b/sound/pci/asihpi/hpioctl.c @@ -107,7 +107,6 @@ long asihpi_hpi_ioctl(struct file *file, unsigned int cmd, unsigned long arg) union hpi_response_buffer_v1 *hr; u...
1c4f33296e8e79a6bbfffc8457d547ffc31d5dee
Analyze and fix the following issue in the Linux kernel code: xfs: encapsulate a block of debug code
Problem Details: Pull into a helper function some debug-only code that validates a xfs_da_blkinfo structure that's been read from disk. Signed-off-by: Alex Elder <aelder@sgi.com> Reviewed-by: Christoph Hellwig <hch@infradead.org>
```diff diff --git a/fs/xfs/xfs_da_btree.c b/fs/xfs/xfs_da_btree.c index 2925726529f8..5bfcb8779f9f 100644 --- a/fs/xfs/xfs_da_btree.c +++ b/fs/xfs/xfs_da_btree.c @@ -692,6 +692,24 @@ xfs_da_join(xfs_da_state_t *state) return(error); } +#ifdef DEBUG +static void +xfs_da_blkinfo_onlychild_validate(struct xfs_da_blk...
2b79b09d13e35577151bd13ba08809911baccd1c
Analyze and fix the following issue in the Linux kernel code: ext4: fix a typo in ext4_group_extend()
Problem Details: Signed-off-by: Yongqiang Yang <xiaoqiangnk@gmail.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
```diff diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c index 4c041e37f61f..5f0aefdc8599 100644 --- a/fs/ext4/resize.c +++ b/fs/ext4/resize.c @@ -986,7 +986,7 @@ int ext4_group_extend(struct super_block *sb, struct ext4_super_block *es, o_blocks_count = ext4_blocks_count(es); if (test_opt(sb, DEBUG)) - printk(K...
654e8b5abc0a793f0c029128db6e4804691a383e
Analyze and fix the following issue in the Linux kernel code: MD: raid1 s/sysfs_notify_dirent/sysfs_notify_dirent_safe
Problem Details: If device-mapper creates a RAID1 array that includes devices to be rebuilt, it will deref a NULL pointer when finished because sysfs is not used by device-mapper instantiated RAID devices. Signed-off-by: Jonathan Brassow <jbrassow@redhat.com> Signed-off-by: NeilBrown <neilb@suse.de>
```diff diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index a7e69081187f..3cbf0ac2aaad 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -1031,7 +1031,7 @@ static int raid1_spare_active(mddev_t *mddev) && !test_bit(Faulty, &rdev->flags) && !test_and_set_bit(In_sync, &rdev->flags)) { c...
8cfa7b0f67b4d899efc7f39eb7e172fd79237811
Analyze and fix the following issue in the Linux kernel code: md/raid5: Avoid BUG caused by multiple failures.
Problem Details: While preparing to write a stripe we keep the parity block or blocks locked (R5_LOCKED) - towards the end of schedule_reconstruction. If the array is discovered to have failed before this write completes we can leave those blocks LOCKED, and init_stripe will notice that a free stripe still has a locke...
```diff diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index a81eca6434dd..b874f42694e2 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -340,7 +340,7 @@ static void init_stripe(struct stripe_head *sh, sector_t sector, int previous) (unsigned long long)sh->sector, i, dev->toread, ...
9d3d80113df824a266c5db3fac357a036ebc0b62
Analyze and fix the following issue in the Linux kernel code: md/raid1: move rdev->corrected_errors counting
Problem Details: Read errors are considered to corrected if write-back and re-read cycle is finished without further problems. Thus moving the rdev-> corrected_errors counting after the re-reading looks more reasonable IMHO. Also included a couple of whitespace fixes on sync_page_io(). Signed-off-by: Namhyung Kim <nam...
```diff diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 44069b38d6dd..a7e69081187f 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -1224,9 +1224,7 @@ static int fix_sync_read_error(r1bio_t *r1_bio) * active, and resync is currently active */ rdev = conf->mirrors[d].rdev; - if ...
a478a069b6adf186373a6648c54fc5f1d3c2f8eb
Analyze and fix the following issue in the Linux kernel code: md: remove ro check in md_check_recovery()
Problem Details: Commit c89a8eee6154 ("Allow faulty devices to be removed from a readonly array.") added some work on ro array in the function, but it couldn't be done since we didn't allow the ro array to be handled from the beginning. Fix it. Signed-off-by: Namhyung Kim <namhyung@gmail.com> Signed-off-by: NeilBrown ...
```diff diff --git a/drivers/md/md.c b/drivers/md/md.c index 0398dc42a956..77bd8d8708e4 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -7163,9 +7163,6 @@ void md_check_recovery(mddev_t *mddev) if (mddev->bitmap) bitmap_daemon_work(mddev); - if (mddev->ro) - return; - if (signal_pending(current)) { i...
f6081bd3f8152cdd3d857f55631bbb4b72182b82
Analyze and fix the following issue in the Linux kernel code: asm-generic/atomic.h: fix type used in atomic_clear_mask
Problem Details: The atomic helpers are supposed to take an atomic_t pointer, not a random unsigned long pointer. So convert atomic_clear_mask over. While we're here, also add some nice documentation to the func. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Cc: Arun Sharma <asharma@fb.com> Cc: Arnd Bergmann <ar...
```diff diff --git a/include/asm-generic/atomic.h b/include/asm-generic/atomic.h index 2a23da03365e..4e8ecf0693e9 100644 --- a/include/asm-generic/atomic.h +++ b/include/asm-generic/atomic.h @@ -140,13 +140,20 @@ static inline int __atomic_add_unless(atomic_t *v, int a, int u) return c; } -static inline void atom...
13aefd7293e7a697bbf452fca65e69cc1fa8a31c
Analyze and fix the following issue in the Linux kernel code: ramoops: use module parameters instead of platform data if not available
Problem Details: Use generic module parameters instead of platform data, if platform data are not available. This limitation has been introduced with commit c3b92ce9e75 ("ramoops: use the platform data structure instead of module params"). [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Marco Stornelli...
```diff diff --git a/drivers/char/ramoops.c b/drivers/char/ramoops.c index 1a9f5f6d6ac5..32aa233df300 100644 --- a/drivers/char/ramoops.c +++ b/drivers/char/ramoops.c @@ -26,6 +26,7 @@ #include <linux/io.h> #include <linux/ioport.h> #include <linux/platform_device.h> +#include <linux/slab.h> #include <linux/ramoops...
beda94da38d2a3bf7f40c01f0a8e6d86067c91cc
Analyze and fix the following issue in the Linux kernel code: Vmware balloon: switch to using sysem-wide freezable workqueue
Problem Details: With the arrival of concurrency-managed workqueues there is no need for our driver to use dedicated workqueue; system-wide one should suffice just fine. [akpm@linux-foundation.org: fix comment layout & grammar] Signed-off-by: Dmitry Torokhov <dtor@vmware.com> Acked-by: Tejun Heo <tj@kernel.org> Signed...
```diff diff --git a/drivers/misc/vmw_balloon.c b/drivers/misc/vmw_balloon.c index 6df5a55da110..053d36caf955 100644 --- a/drivers/misc/vmw_balloon.c +++ b/drivers/misc/vmw_balloon.c @@ -45,7 +45,7 @@ MODULE_AUTHOR("VMware, Inc."); MODULE_DESCRIPTION("VMware Memory Control (Balloon) Driver"); -MODULE_VERSION("1.2.1...
4302fbc8ec2ccae279c939f241bf8ce64e1a0bb7
Analyze and fix the following issue in the Linux kernel code: panic: panic=-1 for immediate reboot
Problem Details: When a kernel BUG or oops occurs, ChromeOS intends to panic and immediately reboot, with stacktrace and other messages preserved in RAM across reboot. But the longer we delay, the more likely the user is to poweroff and lose the info. panic_timeout (seconds before rebooting) is set by panic= boot opt...
```diff diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index a70e43edcb65..4ca93898fbd3 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt @@ -1846,7 +1846,9 @@ bytes respectively. Such letter suffixes can also be entirely omitted. See ...
3f0fb4e85b3842a2606c647c0a66afe2073574b4
Analyze and fix the following issue in the Linux kernel code: Documentation/DMA-API-HOWTO.txt: fix misleading example
Problem Details: See: DMA-API.txt, part Id, DMA_FROM_DEVICE description. Signed-off-by: Michal Miroslaw <mirq-linux@rere.qmqm.pl> Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/Documentation/DMA-API-HOWTO.txt b/Documentation/DMA-API-HOWTO.txt index d568bc235bc0..a0b6250add79 100644 --- a/Documentation/DMA-API-HOWTO.txt +++ b/Documentation/DMA-API-HOWTO.txt @@ -613,13 +613,13 @@ to use the dma_sync_*() interfaces. pass_to_upper_layers(cp->rx_buf); make_and_setup_...
b34a6b1da371ed8af1221459a18c67970f7e3d53
Analyze and fix the following issue in the Linux kernel code: ipc: introduce shm_rmid_forced sysctl
Problem Details: Add support for the shm_rmid_forced sysctl. If set to 1, all shared memory objects in current ipc namespace will be automatically forced to use IPC_RMID. The POSIX way of handling shmem allows one to create shm objects and call shmdt(), leaving shm object associated with no process, thus consuming me...
```diff diff --git a/Documentation/sysctl/kernel.txt b/Documentation/sysctl/kernel.txt index 1c7fb0a94e28..704e474a93df 100644 --- a/Documentation/sysctl/kernel.txt +++ b/Documentation/sysctl/kernel.txt @@ -61,6 +61,7 @@ show up in /proc/sys/kernel: - rtsig-nr - sem - sg-big-buff [ generic SCSI devic...
d40dcdb0172a1ba853464983a059fb45e0aaf61a
Analyze and fix the following issue in the Linux kernel code: ipc/mqueue.c: fix mq_open() return value
Problem Details: We return ENOMEM from mqueue_get_inode even when we have enough memory. Namely in case the system rlimit of mqueue was reached. This error propagates to mq_queue and user sees the error unexpectedly. So fix this up to properly return EMFILE as described in the manpage: EMFILE The process already ha...
```diff diff --git a/ipc/mqueue.c b/ipc/mqueue.c index d43c30f72f1d..ed049ea568f4 100644 --- a/ipc/mqueue.c +++ b/ipc/mqueue.c @@ -113,6 +113,7 @@ static struct inode *mqueue_get_inode(struct super_block *sb, { struct user_struct *u = current_user(); struct inode *inode; + int ret = -ENOMEM; inode = new_inode(...
04715206c0c2fd4ec5ca77fa51e3a5b41ce71492
Analyze and fix the following issue in the Linux kernel code: ipc/mqueue.c: refactor failure handling
Problem Details: If new_inode fails to allocate an inode we need only to return with NULL. But now we test the opposite and have all the work in a nested block. So do the opposite to save one indentation level (and remove unnecessary line breaks). This is only a preparation/cleanup for the next patch where we fix up...
```diff diff --git a/ipc/mqueue.c b/ipc/mqueue.c index 14fb6d67e6a3..d43c30f72f1d 100644 --- a/ipc/mqueue.c +++ b/ipc/mqueue.c @@ -115,69 +115,70 @@ static struct inode *mqueue_get_inode(struct super_block *sb, struct inode *inode; inode = new_inode(sb); - if (inode) { - inode->i_ino = get_next_ino(); - inode->...
fb0a685cb95a0267a96153af2f72486f27be5847
Analyze and fix the following issue in the Linux kernel code: kernel/fork.c: fix a few coding style issues
Problem Details: Signed-off-by: Daniel Rebelo de Oliveira <psykon@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/kernel/fork.c b/kernel/fork.c index e33177edb3bf..e7ceaca89609 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -80,7 +80,7 @@ * Protected counters by write_lock_irq(&tasklist_lock) */ unsigned long total_forks; /* Handle normal Linux uptimes. */ -int nr_threads; /* The idle threads do not ...
293eb1e7772b25a93647c798c7b89bf26c2da2e0
Analyze and fix the following issue in the Linux kernel code: proc: fix a race in do_io_accounting()
Problem Details: If an inode's mode permits opening /proc/PID/io and the resulting file descriptor is kept across execve() of a setuid or similar binary, the ptrace_may_access() check tries to prevent using this fd against the task with escalated privileges. Unfortunately, there is a race in the check against execve()...
```diff diff --git a/fs/proc/base.c b/fs/proc/base.c index c9e3f650f23c..08e3eccf9a12 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -2706,9 +2706,16 @@ static int do_io_accounting(struct task_struct *task, char *buffer, int whole) { struct task_io_accounting acct = task->ioac; unsigned long flags; + int resu...
99b64567486716d18b2156cad188d86478816e4f
Analyze and fix the following issue in the Linux kernel code: do_coredump: fix the "ispipe" error check
Problem Details: do_coredump() assumes that if format_corename() fails it should return -ENOMEM. This is not true, for example cn_print_exe_file() can propagate the error from d_path. Even if it was true, this is too fragile. Change the code to check "ispipe < 0". Signed-off-by: Oleg Nesterov <oleg@redhat.com> Sign...
```diff diff --git a/fs/exec.c b/fs/exec.c index 27d487f913d3..f8fad7fc0e5f 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -2133,16 +2133,16 @@ void do_coredump(long signr, int exit_code, struct pt_regs *regs) ispipe = format_corename(&cn, signr); - if (ispipe == -ENOMEM) { - printk(KERN_WARNING "format_corename fail...
2c563731fee0f625924f72e854957bc77601e8b3
Analyze and fix the following issue in the Linux kernel code: coredump: escape / in hostname and comm
Problem Details: Change every occurence of / in comm and hostname to !. If the process changes its name to contain /, the core is not dumped (if the directory tree doesn't exist like that). The same with hostname being something like myhost/3. Fix this behaviour by using the escape loop used in %E. (We extract it to...
```diff diff --git a/fs/exec.c b/fs/exec.c index a682624de572..27d487f913d3 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -1649,15 +1649,26 @@ expand_fail: return ret; } +static void cn_escape(char *str) +{ + for (; *str; str++) + if (*str == '/') + *str = '!'; +} + static int cn_print_exe_file(struct core_name *c...
778d3b0ff0654ad7092bf823fd32010066b12365
Analyze and fix the following issue in the Linux kernel code: cpusets: randomize node rotor used in cpuset_mem_spread_node()
Problem Details: [ This patch has already been accepted as commit 0ac0c0d0f837 but later reverted (commit 35926ff5fba8) because it itroduced arch specific __node_random which was defined only for x86 code so it broke other archs. This is a followup without any arch specific code. Other than that there are no ...
```diff diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h index dcafe0bf0005..3bac44cce142 100644 --- a/include/linux/bitmap.h +++ b/include/linux/bitmap.h @@ -144,6 +144,7 @@ extern int bitmap_find_free_region(unsigned long *bitmap, int bits, int order); extern void bitmap_release_region(unsigned long *bit...
8521fc50d433507a7cdc96bec280f9e5888a54cc
Analyze and fix the following issue in the Linux kernel code: memcg: get rid of percpu_charge_mutex lock
Problem Details: percpu_charge_mutex protects from multiple simultaneous per-cpu charge caches draining because we might end up having too many work items. At least this was the case until commit 26fe61684449 ("memcg: fix percpu cached charge draining frequency") when we introduced a more targeted draining for async m...
```diff diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 79f23a189941..5f84d2351ddb 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -2092,7 +2092,6 @@ struct memcg_stock_pcp { #define FLUSHING_CACHED_CHARGE (0) }; static DEFINE_PER_CPU(struct memcg_stock_pcp, memcg_stock); -static DEFINE_MUTEX(percpu_charg...
d38144b7a5f8d0a5e05d549177191374c6911009
Analyze and fix the following issue in the Linux kernel code: memcg: unify sync and async per-cpu charge cache draining
Problem Details: Currently we have two ways how to drain per-CPU caches for charges. drain_all_stock_sync will synchronously drain all caches while drain_all_stock_async will asynchronously drain only those that refer to a given memory cgroup or its subtree in hierarchy. Targeted async draining has been introduced by ...
```diff diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 2f5534e1968c..af920d0f9025 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -2154,19 +2154,14 @@ static void refill_stock(struct mem_cgroup *mem, unsigned int nr_pages) } /* - * Tries to drain stocked charges in other cpus. This function is asynchron...
108b6a78463bb8c7163e4f9779f36ad8bbade334
Analyze and fix the following issue in the Linux kernel code: memcg: fix behavior of mem_cgroup_resize_limit()
Problem Details: Commit 22a668d7c3ef ("memcg: fix behavior under memory.limit equals to memsw.limit") introduced "memsw_is_minimum" flag, which becomes true when mem_limit == memsw_limit. The flag is checked at the beginning of reclaim, and "noswap" is set if the flag is true, because using swap is meaningless in this...
```diff diff --git a/mm/memcontrol.c b/mm/memcontrol.c index c0b065ec1571..dfeca594fd7a 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -1653,7 +1653,7 @@ static int mem_cgroup_hierarchical_reclaim(struct mem_cgroup *root_mem, excess = res_counter_soft_limit_excess(&root_mem->res) >> PAGE_SHIFT; /* If memsw...
4508378b9523e22a2a0175d8bf64d932fb10a67d
Analyze and fix the following issue in the Linux kernel code: memcg: fix vmscan count in small memcgs
Problem Details: Commit 246e87a93934 ("memcg: fix get_scan_count() for small targets") fixes the memcg/kswapd behavior against small targets and prevent vmscan priority too high. But the implementation is too naive and adds another problem to small memcg. It always force scan to 32 pages of file/anon and doesn't hand...
```diff diff --git a/mm/vmscan.c b/mm/vmscan.c index 91cee9dfc501..f87702a376d0 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -1795,6 +1795,7 @@ static void get_scan_count(struct zone *zone, struct scan_control *sc, enum lru_list l; int noswap = 0; int force_scan = 0; + unsigned long nr_force_scan[2]; anon ...
79dfdaccd1d5b40ff7cf4a35a0e63696ebb78b4d
Analyze and fix the following issue in the Linux kernel code: memcg: make oom_lock 0 and 1 based rather than counter
Problem Details: Commit 867578cb ("memcg: fix oom kill behavior") introduced a oom_lock counter which is incremented by mem_cgroup_oom_lock when we are about to handle memcg OOM situation. mem_cgroup_handle_oom falls back to a sleep if oom_lock > 1 to prevent from multiple oom kills at the same time. The counter is th...
```diff diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 85599662bd90..95d6c256b54c 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -246,7 +246,10 @@ struct mem_cgroup { * Should the accounting and control be hierarchical, per subtree? */ bool use_hierarchy; - atomic_t oom_lock; + + bool oom_lock; + ...
bb2a0de92c891b8feeedc0178acb3ae009d899a8
Analyze and fix the following issue in the Linux kernel code: memcg: consolidate memory cgroup lru stat functions
Problem Details: In mm/memcontrol.c, there are many lru stat functions as.. mem_cgroup_zone_nr_lru_pages mem_cgroup_node_nr_file_lru_pages mem_cgroup_nr_file_lru_pages mem_cgroup_node_nr_anon_lru_pages mem_cgroup_nr_anon_lru_pages mem_cgroup_node_nr_unevictable_lru_pages mem_cgroup_nr_unevictable_lru_pag...
```diff diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 50940da6adf3..affd5b19b86c 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -111,8 +111,7 @@ int mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg); int mem_cgroup_inactive_file_is_low(struct mem_cgroup...
b830ac1d9a2262093bb0f3f6a2fd2a1c8278daf5
Analyze and fix the following issue in the Linux kernel code: rtc: fix hrtimer deadlock
Problem Details: Ben reported a lockup related to rtc. The lockup happens due to: CPU0 CPU1 rtc_irq_set_state() __run_hrtimer() spin_lock_irqsave(&rtc->irq_task_lock) rtc_handle_legacy_irq(); spin_lock(&rtc->irq_task_lock); hrtimer_cancel() while (cal...
```diff diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c index 601b053bc0e5..3195dbd3ec34 100644 --- a/drivers/rtc/interface.c +++ b/drivers/rtc/interface.c @@ -636,6 +636,29 @@ void rtc_irq_unregister(struct rtc_device *rtc, struct rtc_task *task) } EXPORT_SYMBOL_GPL(rtc_irq_unregister); +static int ...
fc92805a8e25e5e2b0ba7c413cc15d9f05962ee8
Analyze and fix the following issue in the Linux kernel code: drivers/base/power/opp.c: fix dev_opp initial value
Problem Details: Dev_opp initial value shoule be ERR_PTR(), IS_ERR() is used to check error. Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com> Cc: "Rafael J. Wysocki" <rjw@sisk.pl> Cc: Greg KH <greg@kroah.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-f...
```diff diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c index 5cc12322ef32..b23de185cb04 100644 --- a/drivers/base/power/opp.c +++ b/drivers/base/power/opp.c @@ -453,7 +453,7 @@ int opp_add(struct device *dev, unsigned long freq, unsigned long u_volt) static int opp_set_availability(struct device *dev...
07e729ce894487e92405d3b221cffe587420a376
Analyze and fix the following issue in the Linux kernel code: i2c-eg20t : Fix the issue of Combined R/W transfer mode
Problem Details: issue-1 In case combined transfer mode fails halfway, the processing must be stopped halfway. However currently, the processing is continued. This patch breaks the processing. issue-2 Currently, pch_i2c_xfer returns read/write size at that time. However pch_i2c_xfer must return the number of messages ...
```diff diff --git a/drivers/i2c/busses/i2c-eg20t.c b/drivers/i2c/busses/i2c-eg20t.c index 9b072fd42108..ce1a32b71e47 100644 --- a/drivers/i2c/busses/i2c-eg20t.c +++ b/drivers/i2c/busses/i2c-eg20t.c @@ -673,7 +673,7 @@ static s32 pch_i2c_xfer(struct i2c_adapter *i2c_adap, /* transfer not completed */ adap->pch_i2c_...
3c8bb90efb6e3105206e4aaa9127395feeda5492
Analyze and fix the following issue in the Linux kernel code: rtc: Fix hrtimer deadlock
Problem Details: Ben reported a lockup related to rtc. The lockup happens due to: CPU0 CPU1 rtc_irq_set_state() __run_hrtimer() spin_lock_irqsave(&rtc->irq_task_lock) rtc_handle_legacy_irq(); spin_lock(&rtc->irq_task_lock); hrtimer_cancel() while (cal...
```diff diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c index b6bf57f25cc9..a1ba2caa8308 100644 --- a/drivers/rtc/interface.c +++ b/drivers/rtc/interface.c @@ -636,6 +636,29 @@ void rtc_irq_unregister(struct rtc_device *rtc, struct rtc_task *task) } EXPORT_SYMBOL_GPL(rtc_irq_unregister); +static int ...
5bc91db8933bce07c3af86da2bd956414aa5a725
Analyze and fix the following issue in the Linux kernel code: wireless: fix a typo in ignore_reg_update
Problem Details: Just a typo fix changing regulaotry to regulatory. Signed-off-by: Mihai Moldovan <ionic@ionic.de> CC: John W. Linville <linville@tuxdriver.com> CC: Mohammed Shafi <shafi.wireless@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
```diff diff --git a/net/wireless/reg.c b/net/wireless/reg.c index 4453eb721e13..02751dbc5a97 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c @@ -903,7 +903,7 @@ static bool ignore_reg_update(struct wiphy *wiphy, initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE && !is_world_regdom(last_request->alpha2...
e61b52d1309df08b86a35e54a61f0cc932b28291
Analyze and fix the following issue in the Linux kernel code: b43: fix invalid memory access in b43_ssb_remove()
Problem Details: wldev is freed in b43_one_core_detach() and should not be accessed after that call. Keep wldev->dev in a local variable. Signed-off-by: Pavel Roskin <proski@gnu.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
```diff diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c index d9f53b791b21..85d6a1f03a08 100644 --- a/drivers/net/wireless/b43/main.c +++ b/drivers/net/wireless/b43/main.c @@ -5350,6 +5350,7 @@ static void b43_ssb_remove(struct ssb_device *sdev) { struct b43_wl *wl = ssb_get_devtypedat...
f76f424353e678f904c6c13f997851efb6077419
Analyze and fix the following issue in the Linux kernel code: b43: bus: fix memory corruption when setting driver's data
Problem Details: Fixes bug described in: https://bugzilla.kernel.org/show_bug.cgi?id=39172 Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
```diff diff --git a/drivers/net/wireless/b43/bus.c b/drivers/net/wireless/b43/bus.c index 64c3f65ff8c0..05f6c7bff6ab 100644 --- a/drivers/net/wireless/b43/bus.c +++ b/drivers/net/wireless/b43/bus.c @@ -244,10 +244,12 @@ void b43_bus_set_wldev(struct b43_bus_dev *dev, void *wldev) #ifdef CONFIG_B43_BCMA case B43_BUS...
a203c2aa4cefccb879c879b8e1cad1a09a679e55
Analyze and fix the following issue in the Linux kernel code: cfg80211: really ignore the regulatory request
Problem Details: At the beginning of wiphy_update_regulatory() a check is performed whether the request is to be ignored. Then the request is sent to the driver nevertheless. This happens even if last_request points to NULL, leading to a crash in the driver: [<bf01d864>] (lbs_set_11d_domain_info+0x28/0x1e4 [libertas]...
```diff diff --git a/net/wireless/reg.c b/net/wireless/reg.c index 1ad0f39fe091..4453eb721e13 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c @@ -1125,12 +1125,13 @@ void wiphy_update_regulatory(struct wiphy *wiphy, enum ieee80211_band band; if (ignore_reg_update(wiphy, initiator)) - goto out; + return...
03209378b4b25775bf5e6a86e86f074a1057a439
Analyze and fix the following issue in the Linux kernel code: xfs: fix misspelled S_IS...()
Problem Details: mode_t is not a bitmap... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
```diff diff --git a/fs/xfs/linux-2.6/xfs_ioctl.c b/fs/xfs/linux-2.6/xfs_ioctl.c index 14fc00e32f6b..f7ce7debe14c 100644 --- a/fs/xfs/linux-2.6/xfs_ioctl.c +++ b/fs/xfs/linux-2.6/xfs_ioctl.c @@ -265,7 +265,7 @@ xfs_open_by_handle( return PTR_ERR(filp); } - if (inode->i_mode & S_IFREG) { + if (S_ISREG(inode->i_mo...
9ea71503a8ed9184d2d0b8ccc4d269d05f7940ae
Analyze and fix the following issue in the Linux kernel code: futex: Fix regression with read only mappings
Problem Details: commit 7485d0d3758e8e6491a5c9468114e74dc050785d (futexes: Remove rw parameter from get_futex_key()) in 2.6.33 fixed two problems: First, It prevented a loop when encountering a ZERO_PAGE. Second, it fixed RW MAP_PRIVATE futex operations by forcing the COW to occur by unconditionally performing a write...
```diff diff --git a/kernel/futex.c b/kernel/futex.c index fe28dc282eae..70bb54bd2468 100644 --- a/kernel/futex.c +++ b/kernel/futex.c @@ -218,6 +218,8 @@ static void drop_futex_key_refs(union futex_key *key) * @uaddr: virtual address of the futex * @fshared: 0 for a PROCESS_PRIVATE futex, 1 for PROCESS_SHARED * ...
243dd2809a5edd2e0e3e62781083aa44049af37d
Analyze and fix the following issue in the Linux kernel code: gma500: udelay(20000) it too long again
Problem Details: so replace it with mdelay(20). Fixes build error: ERROR: "__bad_udelay" [drivers/staging/gma500/psb_gfx.ko] undefined! Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/drivers/staging/gma500/mrst_hdmi.c b/drivers/staging/gma500/mrst_hdmi.c index d6a517971ba8..e66607eb3d3e 100644 --- a/drivers/staging/gma500/mrst_hdmi.c +++ b/drivers/staging/gma500/mrst_hdmi.c @@ -129,7 +129,7 @@ static void wait_for_vblank(struct drm_device *dev) { /* FIXME: Can we do this as ...
9c646cfc3d98f2e595f7757e42ff59286c6f327e
Analyze and fix the following issue in the Linux kernel code: USB / Renesas: Fix build issue related to struct scatterlist
Problem Details: Fix build issue caused by undefined struct scatterlist in drivers/usb/renesas_usbhs/fifo.c. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c index 406893e4422b..a34430f55fb7 100644 --- a/drivers/usb/renesas_usbhs/fifo.c +++ b/drivers/usb/renesas_usbhs/fifo.c @@ -16,6 +16,7 @@ */ #include <linux/delay.h> #include <linux/io.h> +#include <linux/scatterlist.h> #include...
6c0cbef6662aa685c6a47a18039b9d4f1d5abcb1
Analyze and fix the following issue in the Linux kernel code: MMC / TMIO: Fix build issue related to struct scatterlist
Problem Details: Fix build issue caused by undefined struct scatterlist in drivers/mmc/host/tmio_mmc.c. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h index 087d88023ba1..eeaf64391fbe 100644 --- a/drivers/mmc/host/tmio_mmc.h +++ b/drivers/mmc/host/tmio_mmc.h @@ -21,6 +21,7 @@ #include <linux/mutex.h> #include <linux/pagemap.h> #include <linux/spinlock.h> +#include <linux/scatterlist.h> ...
e5f86dc377e7ff2b4195831153a85a3e76fefff2
Analyze and fix the following issue in the Linux kernel code: ceph: avoid d_parent in ceph_dentry_hash; fix ceph_encode_fh() hashing bug
Problem Details: Have caller pass in a safely-obtained reference to the parent directory for calculating a dentry's hash valud. While we're here, simpify the flow through ceph_encode_fh() so that there is a single exit point and cleanup. Also fix a bug with the dentry hash calculation: calculate the hash for the dent...
```diff diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c index 31d27f8f8261..33a19df72288 100644 --- a/fs/ceph/dir.c +++ b/fs/ceph/dir.c @@ -1244,9 +1244,8 @@ void ceph_dentry_lru_del(struct dentry *dn) * Return name hash for a given dentry. This is dependent on * the parent directory's hash function. */ -unsigned cep...
5f21c96dd5c615341963036ae8f5e4f5227a818d
Analyze and fix the following issue in the Linux kernel code: ceph: protect access to d_parent
Problem Details: d_parent is protected by d_lock: use it when looking up a dentry's parent directory inode. Also take a reference and drop it in the caller to avoid a use-after-free. Reported-by: Al Viro <viro@ZenIV.linux.org.uk> Reviewed-by: Yehuda Sadeh <yehuda@hq.newdream.net> Signed-off-by: Sage Weil <sage@newdre...
```diff diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c index 883c9546111d..ed296ec121d1 100644 --- a/fs/ceph/dir.c +++ b/fs/ceph/dir.c @@ -71,6 +71,21 @@ out_unlock: return 0; } +struct inode *ceph_get_dentry_parent_inode(struct dentry *dentry) +{ + struct inode *inode = NULL; + + if (!dentry) + return NULL; + + spin...
468640e32c7f6bfdaaa011095cc388786755d159
Analyze and fix the following issue in the Linux kernel code: ceph: fix ceph_lookup_open intent usage
Problem Details: We weren't properly calling lookup_instantiate_filp when setting up the lookup intent, which could lead to file leakage on errors. So: - use separate helper for the hidden snapdir translation, immediately following the mds request - use ceph_finish_lookup for the final dentry/return value dance ...
```diff diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c index 53b441fe78f1..f39a409db0ea 100644 --- a/fs/ceph/dir.c +++ b/fs/ceph/dir.c @@ -482,18 +482,10 @@ static loff_t ceph_dir_llseek(struct file *file, loff_t offset, int origin) } /* - * Process result of a lookup/open request. - * - * Mainly, make sure we return t...
acda76578813ef893004ecad0e5ad2bb6039e5f7
Analyze and fix the following issue in the Linux kernel code: ceph: fix bad parent_inode calc in ceph_lookup_open
Problem Details: We were always getting NULL here because the intent file f_dentry is always NULL at this point, which means we were always passing NULL to ceph_mdsc_do_request. In reality, this was fine, since this isn't currently ever a write operation that needs to get strung on the dir's unsafe list. Use the dir ...
```diff diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 6c90cf090601..9b667e9abf4c 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c @@ -223,7 +223,6 @@ struct dentry *ceph_lookup_open(struct inode *dir, struct dentry *dentry, struct ceph_fs_client *fsc = ceph_sb_to_client(dir->i_sb); struct ceph_mds_client *mdsc...
af0ed569d7019f1b49e9e51e77b47092e656b00e
Analyze and fix the following issue in the Linux kernel code: ceph: fix snap writeback when racing with writes
Problem Details: There are two problems that come up when we try to queue a capsnap while a write is in progress: - The FILE_WR cap is held, but not yet dirty, so we may queue a capsnap with dirty == 0. That will crash later in __ceph_flush_snaps(). Or on the FILE_WR cap if a write is in progress. - We may n...
```diff diff --git a/fs/ceph/snap.c b/fs/ceph/snap.c index 54b14de2e729..ac030c9d9959 100644 --- a/fs/ceph/snap.c +++ b/fs/ceph/snap.c @@ -449,6 +449,15 @@ void ceph_queue_cap_snap(struct ceph_inode_info *ci) spin_lock(&inode->i_lock); used = __ceph_caps_used(ci); dirty = __ceph_caps_dirty(ci); + + /* + * If the...
6913200a566b6d2866d46d7b947a2326c4e11f55
Analyze and fix the following issue in the Linux kernel code: Xen: fix braces and tabs coding style issue in xenbus_probe.c
Problem Details: This is a patch to the xenbus_probe.c file that fixed up braces and tabs errors found by the checkpatch.pl tools. Signed-off-by: Ruslan Pisarev <ruslan@rpisarev.org.ua> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
```diff diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c index bd2f90c9ac8b..d4c7a9ffbcb9 100644 --- a/drivers/xen/xenbus/xenbus_probe.c +++ b/drivers/xen/xenbus/xenbus_probe.c @@ -309,8 +309,7 @@ void xenbus_unregister_driver(struct xenbus_driver *drv) } EXPORT_SYMBOL_GPL(xenbus_unr...
822a259aa17e977892bf9dbb546522c477f7b7cb
Analyze and fix the following issue in the Linux kernel code: Xen: fix braces coding style issue in xenbus_probe.h
Problem Details: This is a patch to the xenbus_probe.h file that fixed up braces errors found by the checkpatch.pl tools. Signed-off-by: Ruslan Pisarev <ruslan@rpisarev.org.ua> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
```diff diff --git a/drivers/xen/xenbus/xenbus_probe.h b/drivers/xen/xenbus/xenbus_probe.h index b814935378c7..9b1de4e34c64 100644 --- a/drivers/xen/xenbus/xenbus_probe.h +++ b/drivers/xen/xenbus/xenbus_probe.h @@ -36,8 +36,7 @@ #define XEN_BUS_ID_SIZE 20 -struct xen_bus_type -{ +struct xen_bus_type { char *ro...
4b0109830842fa645c7f7460dc713cedfe4473f6
Analyze and fix the following issue in the Linux kernel code: Xen: fix whitespaces,tabs coding style issue in drivers/xen/pci.c
Problem Details: This is a patch to the pci.c file that fixed up whitespaces, tabs warnings found by the checkpatch.pl tools. Signed-off-by: Ruslan Pisarev <ruslan@rpisarev.org.ua> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
```diff diff --git a/drivers/xen/pci.c b/drivers/xen/pci.c index cef4bafc07dc..c4448ee5595f 100644 --- a/drivers/xen/pci.c +++ b/drivers/xen/pci.c @@ -36,7 +36,7 @@ static int xen_add_device(struct device *dev) struct physdev_manage_pci_ext manage_pci_ext = { .bus = pci_dev->bus->number, .devfn = pci_dev->...
7b0ac956d91b91a1e05e4e0b454d65710fc73cd8
Analyze and fix the following issue in the Linux kernel code: Xen: fix braces coding style issue in gntdev.c and grant-table.c
Problem Details: This is a patch to the gntdev.c and grant-table.c files that fixed up braces errors found by the checkpatch.pl tools. Signed-off-by: Ruslan Pisarev <ruslan@rpisarev.org.ua> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
```diff diff --git a/drivers/xen/gntdev.c b/drivers/xen/gntdev.c index f914b26cf0c2..772a5b8bbf2e 100644 --- a/drivers/xen/gntdev.c +++ b/drivers/xen/gntdev.c @@ -188,9 +188,8 @@ static void gntdev_put_map(struct grant_map *map) atomic_sub(map->count, &pages_mapped); - if (map->notify.flags & UNMAP_NOTIFY_SEND_EV...
088c05a845da821fba9e5434bbcc6329368de34e
Analyze and fix the following issue in the Linux kernel code: Xen: fix whitespaces,tabs coding style issue in drivers/xen/events.c
Problem Details: This is a patch to the events.c file that fixed up whitespaces, tabs and braces errors found by the checkpatch.pl tools. Signed-off-by: Ruslan Pisarev <ruslan@rpisarev.org.ua> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
```diff diff --git a/drivers/xen/events.c b/drivers/xen/events.c index da70f5c32eb9..8876ffd08771 100644 --- a/drivers/xen/events.c +++ b/drivers/xen/events.c @@ -85,8 +85,7 @@ enum xen_irq_type { * IPI - IPI vector * EVTCHN - */ -struct irq_info -{ +struct irq_info { struct list_head list; enum xen_irq...
e882dc9c8e10db52dd509fbd67240ce0cc09c201
Analyze and fix the following issue in the Linux kernel code: Xen: fix whitespaces,tabs coding style issue in drivers/xen/balloon.c
Problem Details: This is a patch to the balloon.c file that fixed up whitespaces, tabs errors found by the checkpatch.pl tools. Signed-off-by: Ruslan Pisarev <ruslan@rpisarev.org.ua> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
```diff diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c index f54290baa3db..61c0ee7aa7dd 100644 --- a/drivers/xen/balloon.c +++ b/drivers/xen/balloon.c @@ -84,8 +84,8 @@ static unsigned long frame_list[PAGE_SIZE / sizeof(unsigned long)]; #define inc_totalhigh_pages() (totalhigh_pages++) #define dec_totalhi...
0642d2edc858a1f08716bb32e1ab890db8dac246
Analyze and fix the following issue in the Linux kernel code: xen/balloon: Fix compile errors - missing header files.
Problem Details: With a specific enough .config file compile errors show for missing workqueue declarations. Reported-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
```diff diff --git a/drivers/xen/xen-selfballoon.c b/drivers/xen/xen-selfballoon.c index 010937b5a7c9..1b4afd81f872 100644 --- a/drivers/xen/xen-selfballoon.c +++ b/drivers/xen/xen-selfballoon.c @@ -70,10 +70,10 @@ #include <linux/kernel.h> #include <linux/mm.h> #include <linux/mman.h> - +#include <linux/workqueue.h...
272800dc4fc10190604e4f8ee8898e9810f358ba
Analyze and fix the following issue in the Linux kernel code: xen/grant: Fix compile warning.
Problem Details: drivers/xen/grant-table.c:85: warning: ‘rc’ may be used uninitialized in this function Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
```diff diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c index fd725cde6ad1..4f44b347b24a 100644 --- a/drivers/xen/grant-table.c +++ b/drivers/xen/grant-table.c @@ -82,7 +82,7 @@ static inline grant_ref_t *__gnttab_entry(grant_ref_t entry) static int get_free_entries(unsigned count) { unsigned lon...
41c96486f238e6a545f52215f95fe69748abf603
Analyze and fix the following issue in the Linux kernel code: omfs: fix (mode & S_IFDIR) abuse
Problem Details: granted, on a filesystem that has only regular files and directories it happens to work, but really should be S_ISDIR(mode)... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
```diff diff --git a/fs/omfs/dir.c b/fs/omfs/dir.c index 3b8d3979e03b..98e544274390 100644 --- a/fs/omfs/dir.c +++ b/fs/omfs/dir.c @@ -93,7 +93,7 @@ int omfs_make_empty(struct inode *inode, struct super_block *sb) memset(bh->b_data, 0, sizeof(struct omfs_inode)); - if (inode->i_mode & S_IFDIR) { + if (S_ISDIR(ino...
56487c279fe9fc23c5f15e2b935eb896ab7ba280
Analyze and fix the following issue in the Linux kernel code: ALSA: hda - Cirrus Logic CS421x support
Problem Details: This update includes the changes necessary for supporting the CS421x family of codecs. Previously this file only supported the CS420x family of codecs. This file also contains init verbs to correct several issues in the CS421x hardware. Behavior between the CS421x and CS420x codec families is simila...
```diff diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c index 7f93739b1e33..47d6ffc9b5b5 100644 --- a/sound/pci/hda/patch_cirrus.c +++ b/sound/pci/hda/patch_cirrus.c @@ -25,6 +25,7 @@ #include <sound/core.h> #include "hda_codec.h" #include "hda_local.h" +#include <sound/tlv.h> /* */ @@ ...
1dd75f91ae713049eb6baaa640078f3a6549e522
Analyze and fix the following issue in the Linux kernel code: genirq: Fix wrong bit operation
Problem Details: (!msk & 0x01) should be !(msk & 0x01) Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com> Link: http://lkml.kernel.org/r/1311229754-6003-1-git-send-email-jhbird.choi@samsung.com Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: stable@kernel.org
```diff diff --git a/kernel/irq/generic-chip.c b/kernel/irq/generic-chip.c index 3a2cab407b93..e38544dddb18 100644 --- a/kernel/irq/generic-chip.c +++ b/kernel/irq/generic-chip.c @@ -246,7 +246,7 @@ void irq_setup_generic_chip(struct irq_chip_generic *gc, u32 msk, gc->mask_cache = irq_reg_readl(gc->reg_base + ct->re...
2d859db3e4a82a365572592d57624a5f996ed0ec
Analyze and fix the following issue in the Linux kernel code: ext4: fix data corruption in inodes with journalled data
Problem Details: When journalling data for an inode (either because it is a symlink or because the filesystem is mounted in data=journal mode), ext4_evict_inode() can discard unwritten data by calling truncate_inode_pages(). This is because we don't mark the buffer / page dirty when journalling data but only add the bu...
```diff diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index de50b16a8f67..43e4abd67be7 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -121,6 +121,33 @@ void ext4_evict_inode(struct inode *inode) trace_ext4_evict_inode(inode); if (inode->i_nlink) { + /* + * When journalling data dirty buffers are tracke...
11ccf116d0d756d06989775288e41f737d98e0c5
Analyze and fix the following issue in the Linux kernel code: block: fix warning with calling smp_processor_id() in preemptible section
Problem Details: After commit 5757a6d7 introduced an unsafe calling of smp_processor_id(), with preempt debuggin turned on we spew a lot of: BUG: using smp_processor_id() in preemptible [00000000] code: kjournald/514 caller is __make_request+0x1b8/0x308 [<c0019f44>] (unwind_backtrace+0x0/0xe8) from [<c024b4cc>] (debug...
```diff diff --git a/block/blk-core.c b/block/blk-core.c index f8cb09951830..f9255815a5bb 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -1283,7 +1283,7 @@ get_rq: if (test_bit(QUEUE_FLAG_SAME_COMP, &q->queue_flags) || bio_flagged(bio, BIO_CPU_AFFINE)) - req->cpu = smp_processor_id(); + req->cpu = ...
5a96a899bbdee86024ab9ea6d02b9e242faacbed
Analyze and fix the following issue in the Linux kernel code: drm/radeon/kms: fix DP training for DPEncoderService revision bigger than 1.1
Problem Details: DPEncoderService newer than 1.1 can't properly program the DP (display port) link training. When facing such version use the DIGxEncoderControl method instead. Fix DP link training on some R7XX. Signed-off-by: Jerome Glisse <jglisse@redhat.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Cc:...
```diff diff --git a/drivers/gpu/drm/radeon/atombios_dp.c b/drivers/gpu/drm/radeon/atombios_dp.c index 8c0f9e36ff8e..645b84b3d203 100644 --- a/drivers/gpu/drm/radeon/atombios_dp.c +++ b/drivers/gpu/drm/radeon/atombios_dp.c @@ -627,6 +627,7 @@ struct radeon_dp_link_train_info { u8 train_set[4]; u8 link_status[DP_LIN...
4639dd21e759e32125adc7171abf6cb8140d54cf
Analyze and fix the following issue in the Linux kernel code: drm/radeon/kms: add missing vddci setting on NI+
Problem Details: Need to add vddci setting to pm init as well as resume. Fixes hangs on load on some boards. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=38754 Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@kernel.org Signed-off-by: Dave Airlie <airlied@redhat.com>
```diff diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c index aaa19dc418a0..6fabe89fa6a1 100644 --- a/drivers/gpu/drm/radeon/radeon_pm.c +++ b/drivers/gpu/drm/radeon/radeon_pm.c @@ -594,6 +594,9 @@ int radeon_pm_init(struct radeon_device *rdev) if (rdev->pm.default_vddc) ra...
2a9778ed83b142e88cb38acc496a573a3472d27f
Analyze and fix the following issue in the Linux kernel code: dma: mxs-dma: fix unterminated platform_device_id table
Problem Details: Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
```diff diff --git a/drivers/dma/mxs-dma.c b/drivers/dma/mxs-dma.c index 2870d919f112..f22a237b7dd6 100644 --- a/drivers/dma/mxs-dma.c +++ b/drivers/dma/mxs-dma.c @@ -709,6 +709,8 @@ static struct platform_device_id mxs_dma_type[] = { }, { .name = "mxs-dma-apbx", .driver_data = MXS_DMA_APBX, + }, { + /* end of...
82a452581230b3ffc9d6475dffdb2568497b5fec
Analyze and fix the following issue in the Linux kernel code: [SCSI] mpt2sas: WarpDrive Infinite command retries due to wrong scsi command entry in MPI message
Problem Details: Issue: This issue is seen on LSI H/W WarpDrive SSS6200 When filed direct I/O is tried as volume I/O the scmd field in internal lookup table get cleared and because of that the retried volume I/O never gets reported as completed to SML. Result: I/O timeout and Error handling thread will kicking off ...
```diff diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c b/drivers/scsi/mpt2sas/mpt2sas_scsih.c index 939f283d0c28..6abd2fcc43e2 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c +++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c @@ -4258,6 +4258,7 @@ _scsih_io_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index, u32 re...
10bd2473b10b394eed7ed6c94248be47ab6ed369
Analyze and fix the following issue in the Linux kernel code: eventpoll: fix comment typo 'evenpoll'
Problem Details: Signed-off-by: Paul Bolle <pebolle@tiscali.nl> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
```diff diff --git a/fs/eventpoll.c b/fs/eventpoll.c index f9cfd168fbe2..5e480d555049 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c @@ -700,7 +700,7 @@ static const struct file_operations eventpoll_fops = { .llseek = noop_llseek, }; -/* Fast test to see if the file is an evenpoll file */ +/* Fast test to see i...
6dbd3085c3c3a53dfa4491ebcbf7847955b16f26
Analyze and fix the following issue in the Linux kernel code: Revert "microblaze: PCI fix typo fault in of_node pointer moving into pci_bus"
Problem Details: This reverts commit c9d761b7c4b658a937a941aea2781f511a0ff3ec. Ben' commit "microblaze/pci: Move the remains of pci_32.c to pci-common.c" (sha1: bf13a6fa09b8db7f1fd59b5e2ed3674a89a6a25c) completely removed pci_32.c that's why my fixing commit caused the problem with merging and need to be revert. Sign...
```diff diff --git a/arch/microblaze/pci/pci_32.c b/arch/microblaze/pci/pci_32.c index 9fafb0dd9c2a..92728a6cfd80 100644 --- a/arch/microblaze/pci/pci_32.c +++ b/arch/microblaze/pci/pci_32.c @@ -332,7 +332,7 @@ static void __devinit pcibios_scan_phb(struct pci_controller *hose) hose->global_number); return...
19237039919088781b4191a00bdc1284d8fea1dd
Analyze and fix the following issue in the Linux kernel code: GFS2: Fix mount hang caused by certain access pattern to sysfs files
Problem Details: Depending upon the order of userspace/kernel during the mount process, this can result in a hang without the _all version of the completion. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
```diff diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c index 516516e0c2a2..3bc073a4cf82 100644 --- a/fs/gfs2/ops_fstype.c +++ b/fs/gfs2/ops_fstype.c @@ -1018,13 +1018,13 @@ hostdata_error: fsname++; if (lm->lm_mount == NULL) { fs_info(sdp, "Now mounting FS...\n"); - complete(&sdp->sd_locking_init); +...
1c4b45d8f6bda8e457f674f3a67aa9b2e57830c7
Analyze and fix the following issue in the Linux kernel code: ARM: board-mx51_babbage: Fix UART2 registration
Problem Details: On MX51 Babbage board the RTS/CTS pins are not used on UART2 port. Fix the registration of this port. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
```diff diff --git a/arch/arm/mach-mx5/board-mx51_babbage.c b/arch/arm/mach-mx5/board-mx51_babbage.c index c7b3fabf50f9..98b40aae8aff 100644 --- a/arch/arm/mach-mx5/board-mx51_babbage.c +++ b/arch/arm/mach-mx5/board-mx51_babbage.c @@ -347,7 +347,7 @@ static void __init mx51_babbage_init(void) ARRAY_SIZE(mx51babba...
d02667e6206fb3be0990c38af8447a4ed2b74c11
Analyze and fix the following issue in the Linux kernel code: ALSA: hda - Fix invalid mute led state on resume of IDT codecs
Problem Details: Codec state is not restored immediately on resume but on the first access when power-save is enabled. That leads to an invalid mute led state after resume until either sound is played or some control is changed. This patch adds a possibility for a vendor specific patch to restore codec state immediat...
```diff diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 9c27a3a4c4d5..c0e83ed0b351 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c @@ -5103,6 +5103,8 @@ int snd_hda_resume(struct hda_bus *bus) struct hda_codec *codec; list_for_each_entry(codec, &bus->codec_list, lis...
fbd60a7e87213f702889be21ac14c59fa62defe9
Analyze and fix the following issue in the Linux kernel code: efika: Fix board id detection
Problem Details: Current code is assuming that gpio_get_value() is returning 0 or 1 but it should be checking if the value is 0 or not. Not doing it properly is breaking the detection of the board (and thus the reboot of efika mx to2) when using the new mxc gpio driver, which relies on basic mmio gpio. Signed-off-by: ...
```diff diff --git a/arch/arm/mach-mx5/board-mx51_efikamx.c b/arch/arm/mach-mx5/board-mx51_efikamx.c index 6e362315291b..5e8dd6ad6934 100644 --- a/arch/arm/mach-mx5/board-mx51_efikamx.c +++ b/arch/arm/mach-mx5/board-mx51_efikamx.c @@ -108,9 +108,9 @@ static void __init mx51_efikamx_board_id(void) gpio_request(EFIKAMX...
f7db3d5f4c27fa93304ead2d7e76d00df3981f02
Analyze and fix the following issue in the Linux kernel code: efikasb: fix gpio keys.
Problem Details: While testing the keys, I only checked that the key were generating an input event but unfortunately, they were not generating the right event. Fix that. Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
```diff diff --git a/arch/arm/mach-mx5/board-mx51_efikasb.c b/arch/arm/mach-mx5/board-mx51_efikasb.c index 474fc6e4c6df..8054f3f7f491 100644 --- a/arch/arm/mach-mx5/board-mx51_efikasb.c +++ b/arch/arm/mach-mx5/board-mx51_efikasb.c @@ -163,23 +163,24 @@ static struct gpio_keys_button mx51_efikasb_keys[] = { { .code...
37df0e5de7612979354593df8edec5c5f3d0b475
Analyze and fix the following issue in the Linux kernel code: efikasb/mx: fix usbh1 initialisation
Problem Details: mx51_initialize_usb_hw() support introduced a small error. The usbh1 has pdev->id equal to 1 not 0, so use pdev->id to make things less error-prone and to fix that. Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
```diff diff --git a/arch/arm/mach-mx5/mx51_efika.c b/arch/arm/mach-mx5/mx51_efika.c index 56739c23aca7..1105ef3d22a4 100644 --- a/arch/arm/mach-mx5/mx51_efika.c +++ b/arch/arm/mach-mx5/mx51_efika.c @@ -186,7 +186,7 @@ static int initialize_usbh1_port(struct platform_device *pdev) mdelay(10); - return mx51_initia...
f07c7d6730fa65414f0becf2c50ca1c9ffac9e96
Analyze and fix the following issue in the Linux kernel code: ARM: mach-imx/mx31lilly: Fix section mismatches
Problem Details: Fix the following section mismatches: WARNING: vmlinux.o(.text+0x1026c): Section mismatch in reference from the function lilly1131_usb_init() to the variable .init.rodata:imx31_mxc_ehci_hs_data The function lilly1131_usb_init() references the variable __initconst imx31_mxc_ehci_hs_data. This is often ...
```diff diff --git a/arch/arm/mach-imx/mach-mx31lilly.c b/arch/arm/mach-imx/mach-mx31lilly.c index 410e676ae087..4bf1debfe357 100644 --- a/arch/arm/mach-imx/mach-mx31lilly.c +++ b/arch/arm/mach-imx/mach-mx31lilly.c @@ -192,7 +192,7 @@ static struct mxc_usbh_platform_data usbh2_pdata __initdata = { .portsc = MXC_EHCI_...
ea7aed6bfba3b0638de6f657ab831f1d94b97103
Analyze and fix the following issue in the Linux kernel code: ARM: mach-imx/mx31ads: Fix section mismatches
Problem Details: Fix the following section mismatches: WARNING: vmlinux.o(.text+0x101cc): Section mismatch in reference from the function mxc_init_i2c() to the (unknown reference) .init.data:(unknown) The function mxc_init_i2c() references the (unknown reference) __initdata (unknown). This is often because mxc_init_i2...
```diff diff --git a/arch/arm/mach-imx/mach-mx31ads.c b/arch/arm/mach-imx/mach-mx31ads.c index f4dee0254634..2ce3af8bce6d 100644 --- a/arch/arm/mach-imx/mach-mx31ads.c +++ b/arch/arm/mach-imx/mach-mx31ads.c @@ -468,7 +468,7 @@ static struct i2c_board_info __initdata mx31ads_i2c1_devices[] = { #endif }; -static void...
8882f081329a82737b7471b97e59ce8c407f6655
Analyze and fix the following issue in the Linux kernel code: [SCSI] mvsas: fix 94xx hotplug issue
Problem Details: Fix 94xx A0/B0 revision hotplug issue. Remove unused macro: DISABLE_HOTPLUG_DMA_FIX Signed-off-by: Xiangliang Yu <yuxiangl@marvell.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
```diff diff --git a/drivers/scsi/mvsas/mv_64xx.c b/drivers/scsi/mvsas/mv_64xx.c index c88b8a7ed398..b02dd800af38 100644 --- a/drivers/scsi/mvsas/mv_64xx.c +++ b/drivers/scsi/mvsas/mv_64xx.c @@ -744,11 +744,13 @@ int mvs_64xx_spi_waitdataready(struct mvs_info *mvi, u32 timeout) return -1; } -#ifndef DISABLE_HOTPLU...
bf28607fbe529e20180080c4a0295b0a47834fde
Analyze and fix the following issue in the Linux kernel code: MIPS: Close races in TLB modify handlers.
Problem Details: Page table entries are made invalid by writing a zero into the the PTE slot in a page table. This creates a race condition with the TLB modify handlers when they are updating the PTE. CPU0 CPU1 Test for _PAGE_PRESENT . set to not _PAGE_PRE...
```diff diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c index 424ed4b92e6d..b6e1cff50667 100644 --- a/arch/mips/mm/tlbex.c +++ b/arch/mips/mm/tlbex.c @@ -42,6 +42,18 @@ extern void tlb_do_page_fault_0(void); extern void tlb_do_page_fault_1(void); +struct work_registers { + int r1; + int r2; + int r3; +}; +...
84635d68be4b846ba984a89f386524153330c597
Analyze and fix the following issue in the Linux kernel code: vfs: fix check_acl compile error when CONFIG_FS_POSIX_ACL is not set
Problem Details: Commit e77819e57f08 ("vfs: move ACL cache lookup into generic code") didn't take the FS_POSIX_ACL config variable into account - when that is not set, ACL's go away, and the cache helper functions do not exist, causing compile errors like fs/namei.c: In function 'check_acl': fs/namei.c:191:10: err...
```diff diff --git a/fs/namei.c b/fs/namei.c index ef00b984fb20..f8c69d373793 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -176,6 +176,7 @@ EXPORT_SYMBOL(putname); static int check_acl(struct inode *inode, int mask) { +#ifdef CONFIG_FS_POSIX_ACL struct posix_acl *acl; /* @@ -219,6 +220,7 @@ static int check_ac...
f19da2ce8ef5e49b8b8ea199c3601dd45d71b262
Analyze and fix the following issue in the Linux kernel code: drivers/connector/cn_proc.c: remove unused local
Problem Details: Fix the warning drivers/connector/cn_proc.c: In function 'proc_ptrace_connector': drivers/connector/cn_proc.c:176: warning: unused variable 'tracer' Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/drivers/connector/cn_proc.c b/drivers/connector/cn_proc.c index 281902d3f7ec..0debc17c8e28 100644 --- a/drivers/connector/cn_proc.c +++ b/drivers/connector/cn_proc.c @@ -173,7 +173,6 @@ void proc_ptrace_connector(struct task_struct *task, int ptrace_id) struct proc_event *ev; struct timespec ts...
df2694d80a84fb0b61ce9fa31353eb9c5f36ad36
Analyze and fix the following issue in the Linux kernel code: Documentation/SubmitChecklist: add RCU debug config options
Problem Details: There have been persistent lockdep RCU splats, indicating that submitters are not testing with CONFIG_PROVE_RCU. Add this config option to the list in Documentation/SubmitChecklist. Also add CONFIG_DEBUG_OBJECTS_RCU_HEAD for good measure. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> ...
```diff diff --git a/Documentation/SubmitChecklist b/Documentation/SubmitChecklist index 7b13be41c085..dc0e33210d7e 100644 --- a/Documentation/SubmitChecklist +++ b/Documentation/SubmitChecklist @@ -53,8 +53,8 @@ kernel patches. 12: Has been tested with CONFIG_PREEMPT, CONFIG_DEBUG_PREEMPT, CONFIG_DEBUG_SLAB, C...
29df8d8f8702f0f53c1375015f09f04bc8d023c1
Analyze and fix the following issue in the Linux kernel code: pnpacpi: register disabled resources
Problem Details: When parsing PnP ACPI resource structures, it may happen that some of the resources are disabled (in which case "the size" of the resource equals zero). The current solution is to skip these resources completely - with the unfortunate side effect that they are not registered despite the fact that they...
```diff diff --git a/drivers/pnp/pnpacpi/rsparser.c b/drivers/pnp/pnpacpi/rsparser.c index 100e4d9372f1..4a07cd96f787 100644 --- a/drivers/pnp/pnpacpi/rsparser.c +++ b/drivers/pnp/pnpacpi/rsparser.c @@ -509,15 +509,15 @@ static __init void pnpacpi_parse_dma_option(struct pnp_dev *dev, struct acpi_resource_dma...
7afe1845dd1e7c90828c942daed7e57ffa7c38d6
Analyze and fix the following issue in the Linux kernel code: init: skip calibration delay if previously done
Problem Details: For each CPU, do the calibration delay only once. For subsequent calls, use the cached per-CPU value of loops_per_jiffy. This saves about 200ms of resume time on dual core Intel Atom N5xx based systems. This helps bring down the kernel resume time on such systems from about 500ms to about 300ms. [a...
```diff diff --git a/init/calibrate.c b/init/calibrate.c index aae2f40fea4c..24df7976816c 100644 --- a/init/calibrate.c +++ b/init/calibrate.c @@ -9,6 +9,7 @@ #include <linux/init.h> #include <linux/timex.h> #include <linux/smp.h> +#include <linux/percpu.h> unsigned long lpj_fine; unsigned long preset_lpj; @@ -2...
06b4501e88ad10f02849a3f9d7408ed6ae15a53f
Analyze and fix the following issue in the Linux kernel code: misc/eeprom: add driver for microwire 93xx46 EEPROMs
Problem Details: Add EEPROM driver for 93xx46 chips. It can also be used with spi_gpio driver to access 93xx46 EEPROMs connected over GPIO lines. This driver supports read/write/erase access to the EEPROM chips over sysfs files. [rdunlap@xenotime.net: fix printk format] Signed-off-by: Anatolij Gustschin <agust@denx....
```diff diff --git a/drivers/misc/eeprom/Kconfig b/drivers/misc/eeprom/Kconfig index 9118613af321..620de283b40b 100644 --- a/drivers/misc/eeprom/Kconfig +++ b/drivers/misc/eeprom/Kconfig @@ -70,4 +70,17 @@ config EEPROM_93CX6 If unsure, say N. +config EEPROM_93XX46 + tristate "Microwire EEPROM 93XX46 support" +...
6e60c02e9d9427f59842192bdb123cbeaf8bc9a0
Analyze and fix the following issue in the Linux kernel code: checkpatch.pl: update $logFunctions
Problem Details: Previous behavior allowed only alphabetic prefixes like pr_info to exceed the 80 column line length limit. ath6kl wants to add a digit into the prefix, so allow numbers as well as digits in the <prefix>_<level> printks. <prefix>_<level>_ratelimited and <prefix>_<level>_once and WARN_RATELIMIT and WAR...
```diff diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 8dd720ac0069..9d761c95eca2 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -257,9 +257,9 @@ our $typeTypedefs = qr{(?x: )}; our $logFunctions = qr{(?x: - printk| - [a-z]+_(emerg|alert|crit|err|warning|warn|notice|info|debug|d...
165e72a6c374ed03c57d03c88406d32745e1add2
Analyze and fix the following issue in the Linux kernel code: checkpatch: add __rcu as a sparse modifier
Problem Details: Fix "need consistent spacing around '*'" error after a __rcu sparse annotation which was caused by the missing __rcu entry in the checkpatch.pl internal list of sparse keywords. Signed-off-by: Sven Eckelmann <sven@narfation.org> Cc: Andy Whitcroft <apw@canonical.com> Cc: Joe Perches <joe@perches.com> ...
```diff diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 5ba62d8b5e52..63cca81b1105 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -145,7 +145,8 @@ our $Sparse = qr{ __must_check| __init_refok| __kprobes| - __ref + __ref| + __rcu }x; # Notes to $Attribute: ```
27c46a2546c75c6814562e85b751e3d64c188ad5
Analyze and fix the following issue in the Linux kernel code: drivers/firmware/sigma.c needs MODULE_LICENSE
Problem Details: Fix module tainting message: sigma: module license 'unspecified' taints kernel. Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Acked-by: Mike Frysinger <vapier@gentoo.org> Cc: <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@li...
```diff diff --git a/drivers/firmware/sigma.c b/drivers/firmware/sigma.c index c19cd2c39fa6..f10fc521951b 100644 --- a/drivers/firmware/sigma.c +++ b/drivers/firmware/sigma.c @@ -11,6 +11,7 @@ #include <linux/firmware.h> #include <linux/kernel.h> #include <linux/i2c.h> +#include <linux/module.h> #include <linux/sig...
75fb8f269305fc066c4c6ec6e7232df0c92f434d
Analyze and fix the following issue in the Linux kernel code: lib: make _tolower() public
Problem Details: This function is required by *printf and kstrto* functions that are located in the different modules. This patch makes _tolower() public. However, it's good idea to not use the helper outside of mentioned functions. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Andy Shevchenko <andri...
```diff diff --git a/include/linux/ctype.h b/include/linux/ctype.h index a3d6ee0044f9..8acfe312f947 100644 --- a/include/linux/ctype.h +++ b/include/linux/ctype.h @@ -52,4 +52,13 @@ static inline unsigned char __toupper(unsigned char c) #define tolower(c) __tolower(c) #define toupper(c) __toupper(c) +/* + * Fast im...
2504f6da50f4d9656cad353798bf07657ec12eea
Analyze and fix the following issue in the Linux kernel code: drivers/leds/leds-netxbig: make LEDS_NETXBIG depend on LEDS_CLASS
Problem Details: We call led_classdev_register/led_classdev_unregister in create_netxbig_led/delete_netxbig_led, thus make LEDS_NETXBIG depend on LEDS_CLASS. This patch fixes below build error if LEDS_CLASS is not configured. LD .tmp_vmlinux1 drivers/built-in.o: In function `create_netxbig_led': drivers/...
```diff diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig index 6c21c2986ca1..b591e726a6fa 100644 --- a/drivers/leds/Kconfig +++ b/drivers/leds/Kconfig @@ -365,6 +365,7 @@ config LEDS_NS2 config LEDS_NETXBIG tristate "LED support for Big Network series LEDs" depends on MACH_NET2BIG_V2 || MACH_NET5BIG_V2 + d...
e179840ba88c342d215631356cbfe4e62c9f175b
Analyze and fix the following issue in the Linux kernel code: drivers/leds/leds-sunfire.c: fix sunfire_led_generic_probe() error handling
Problem Details: - return -ENOMEM if kzalloc fails, rather than the current -EINVAL - fix a memory leak in the case of goto out_unregister_led_cdevs Signed-off-by: Axel Lin <axel.lin@gmail.com> Cc: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvald...
```diff diff --git a/drivers/leds/leds-sunfire.c b/drivers/leds/leds-sunfire.c index ab6d18f5c39f..1757396b20b3 100644 --- a/drivers/leds/leds-sunfire.c +++ b/drivers/leds/leds-sunfire.c @@ -127,17 +127,19 @@ static int __devinit sunfire_led_generic_probe(struct platform_device *pdev, struct led_type *type...
005bdad7b80ac017ca21d795639d4214b9844a84
Analyze and fix the following issue in the Linux kernel code: eisa/pci_eisa.c: fix section mismatch
Problem Details: Fixes WARNING: vmlinux.o(.data+0x15d3ac): Section mismatch in reference from the variable pci_eisa_driver to the function .init.text:pci_eisa_init() The variable pci_eisa_driver references the function __init pci_eisa_init() If the reference is valid then annotate the variable with __init* or __...
```diff diff --git a/drivers/eisa/pci_eisa.c b/drivers/eisa/pci_eisa.c index 0dd0f633b18d..30da70d06a6d 100644 --- a/drivers/eisa/pci_eisa.c +++ b/drivers/eisa/pci_eisa.c @@ -45,13 +45,13 @@ static int __init pci_eisa_init(struct pci_dev *pdev, return 0; } -static struct pci_device_id pci_eisa_pci_tbl[] = { +stati...
9d00f92f437f0ff682876cab9f2d94cf3b6e5d17
Analyze and fix the following issue in the Linux kernel code: include/linux/kernel.h: fix a headers_check warning
Problem Details: Fix the warning: usr/include/linux/kernel.h:65: userspace cannot reference function or variable defined in the kernel As Michal noted, BUILD_BUG_ON stuffs should be moved under #ifdef __KERNEL__. Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com> Cc: Michal Marek <mmarek@suse.cz> Signed-off-by: A...
```diff diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 567a6f7bbeed..bf66f068368b 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -646,29 +646,6 @@ static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { } const typeof( ((type *)0)->member ) *__mptr = (ptr); \ ...
ae891a1b93bf62e9aaa116a7a71312375047fc9f
Analyze and fix the following issue in the Linux kernel code: devres: fix possible use after free
Problem Details: devres uses the pointer value as key after it's freed, which is safe but triggers spurious use-after-free warnings on some static analysis tools. Rearrange code to avoid such warnings. Signed-off-by: Maxin B. John <maxin.john@gmail.com> Reviewed-by: Rolf Eike Beer <eike-kernel@sf-tec.de> Acked-by: Tej...
```diff diff --git a/kernel/irq/devres.c b/kernel/irq/devres.c index 1ef4ffcdfa55..bd8e788d71e0 100644 --- a/kernel/irq/devres.c +++ b/kernel/irq/devres.c @@ -87,8 +87,8 @@ void devm_free_irq(struct device *dev, unsigned int irq, void *dev_id) { struct irq_devres match_data = { irq, dev_id }; - free_irq(irq, dev_i...
9a8beb93067764344523386e0e5388d3fd78add7
Analyze and fix the following issue in the Linux kernel code: uml: drivers/slip_user.c memory leak fix
Problem Details: Do not free memory when you failed to allocate it. Signed-off-by: Vitaliy Ivanov <vitalivanov@gmail.com> Signed-off-by: Richard Weinberger <richard@nod.at> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/arch/um/drivers/slip_user.c b/arch/um/drivers/slip_user.c index a1c2d2c98a94..cbacfc4e63e6 100644 --- a/arch/um/drivers/slip_user.c +++ b/arch/um/drivers/slip_user.c @@ -102,7 +102,7 @@ static int slip_tramp(char **argv, int fd) "buffer\n"); os_kill_process(pid, 1); err = -ENOMEM; -...
2fdf2130926f07881c75e3905ece472c37d7703f
Analyze and fix the following issue in the Linux kernel code: uml: helper.c warning corrections
Problem Details: Fix this warning: arch/um/os-Linux/helper.c: In function `helper_child': arch/um/os-Linux/helper.c:38:7: warning: ignoring return value of `write', declared with attribute warn_unused_result [richard@nod.at: happens only with -D_FORTIFY_SOURCE=2] Signed-off-by: Vitaliy Ivanov <vitalivanov@gmail.c...
```diff diff --git a/arch/um/os-Linux/helper.c b/arch/um/os-Linux/helper.c index b6b1096152aa..feff22d64672 100644 --- a/arch/um/os-Linux/helper.c +++ b/arch/um/os-Linux/helper.c @@ -28,14 +28,14 @@ static int helper_child(void *arg) { struct helper_data *data = arg; char **argv = data->argv; - int err; + int err,...
7a99ae7c57d2de5cad9562bed32addf064521116
Analyze and fix the following issue in the Linux kernel code: uml: cow_user.c warning corrections
Problem Details: Fix this warning: arch/um/drivers/cow_user.c: In function `absolutize': arch/um/drivers/cow_user.c:189:7: warning: ignoring return value of `chdir', declared with attribute warn_unused_result [richard@nod.at: happens only with -D_FORTIFY_SOURCE=2] Signed-off-by: Vitaliy Ivanov <vitalivanov@gmail....
```diff diff --git a/arch/um/drivers/cow_user.c b/arch/um/drivers/cow_user.c index 93f227a25ba4..9cbb426c0b91 100644 --- a/arch/um/drivers/cow_user.c +++ b/arch/um/drivers/cow_user.c @@ -186,7 +186,11 @@ static int absolutize(char *to, int size, char *from) strcat(to, "/"); strcat(to, from); } - chdir(save_cwd)...
fbee8d933c775cdb9daac3063659cda38c1776c2
Analyze and fix the following issue in the Linux kernel code: uml: drivers/net_user.c memory leak fix
Problem Details: Perform memory cleanup on exit. On receiving invalid 'pid' we still should clean 'output' variable. Signed-off-by: Vitaliy Ivanov <vitalivanov@gmail.com> Signed-off-by: Richard Weinberger <richard@nod.at> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds...
```diff diff --git a/arch/um/drivers/net_user.c b/arch/um/drivers/net_user.c index 9415dd9e63ef..520118888f16 100644 --- a/arch/um/drivers/net_user.c +++ b/arch/um/drivers/net_user.c @@ -228,7 +228,10 @@ static void change(char *dev, char *what, unsigned char *addr, "buffer\n"); pid = change_tramp(argv, o...
7fa38e7e9ead2dc7a346db10dd27a40dd83b2a26
Analyze and fix the following issue in the Linux kernel code: um: reinstate kernel version in generated .config
Problem Details: Commit 0954828fcbf3 ("kconfig: replace KERNELVERSION usage by the mainmenu's prompt") made the kernel version disappear from the generated .config file when configuring for UML. As UML's Kconfig doesn't have a mainmenu, kconfig falls back to the default string "Linux Kernel Configuration". Add a suit...
```diff diff --git a/arch/um/Kconfig.x86 b/arch/um/Kconfig.x86 index 8aae429a56e2..d31ecf346b4e 100644 --- a/arch/um/Kconfig.x86 +++ b/arch/um/Kconfig.x86 @@ -1,3 +1,5 @@ +mainmenu "User Mode Linux/$SUBARCH $KERNELVERSION Kernel Configuration" + source "arch/um/Kconfig.common" menu "UML-specific options" ```
f956b3e40ad7b9f7c0d33b80fe78f57fedb74f49
Analyze and fix the following issue in the Linux kernel code: um: fix _FORTIFY_SOURCE=2 support for kernel modules
Problem Details: When UML is compiled with _FORTIFY_SOURCE we have to export all _chk() functions which are used in modules. For now it's only the case for __sprintf_chk(). Tested-by: Florian Fainelli <florian@openwrt.org> Reported-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: Richard Weinberger <richard@...
```diff diff --git a/arch/um/os-Linux/user_syms.c b/arch/um/os-Linux/user_syms.c index 05f5ea8e83d2..45ffe46871e0 100644 --- a/arch/um/os-Linux/user_syms.c +++ b/arch/um/os-Linux/user_syms.c @@ -113,3 +113,8 @@ EXPORT_SYMBOL(__stack_smash_handler); extern long __guard __attribute__((weak)); EXPORT_SYMBOL(__guard); ...