id stringlengths 40 40 | instruction stringlengths 68 308 | input stringlengths 17 33.4k | output stringlengths 100 30k |
|---|---|---|---|
4210df283cc703bc494f450c91b8311bdf7fe5ee | Analyze and fix the following issue in the Linux kernel code: bd_claim_by_disk: fix warning | Problem Details:
Fix this:
fs/block_dev.c: In function 'bd_claim_by_disk':
fs/block_dev.c:970: warning: 'found' may be used uninitialized in this function
and given that free_bd_holder() now needs free(NULL)-is-legal behaviour, we
can simplify bd_release_from_kobject().
Cc: Bjorn Steinbrink <B.Steinbrink@gmx.de>
Cc:... | ```diff
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 75c47a21b2f0..3635315e3b99 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -963,20 +963,20 @@ static int bd_claim_by_kobject(struct block_device *bdev, void *holder,
err = bd_claim(bdev, holder);
if (err)
- goto out;
+ goto fail;
found = find_bd... |
4e91672c76319aaed24ea3e784e238cf445c57cb | Analyze and fix the following issue in the Linux kernel code: Replace obscure constructs in fs/block_dev.c | Problem Details:
Replace some funky codepaths in fs/block_dev.c with cleaner versions of the
affected places.
[akpm@linux-foundation.org: fix return value]
Signed-off-by: Johannes Weiner <hannes-kernel@saeurebad.de>
Cc: Bjorn Steinbrink <B.Steinbrink@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Sig... | ```diff
diff --git a/fs/block_dev.c b/fs/block_dev.c
index da5f0515e8eb..75c47a21b2f0 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -872,7 +872,7 @@ static struct bd_holder *find_bd_holder(struct block_device *bdev,
*/
static int add_bd_holder(struct block_device *bdev, struct bd_holder *bo)
{
- int ret;
+ in... |
4e44f3497d41db4c3b9051c61410dee8ae4fb49c | Analyze and fix the following issue in the Linux kernel code: sys_time() speedup | Problem Details:
Improve performance of sys_time(). sys_time() returns time in seconds, but
it does so by calling do_gettimeofday() and then returning the tv_sec
portion of the GTOD time. But the data structure "xtime", which is updated
by every timer/scheduler tick, already offers HZ granularity time.
The patch imp... | ```diff
diff --git a/kernel/time.c b/kernel/time.c
index f04791f69408..ffe19149d770 100644
--- a/kernel/time.c
+++ b/kernel/time.c
@@ -57,14 +57,17 @@ EXPORT_SYMBOL(sys_tz);
*/
asmlinkage long sys_time(time_t __user * tloc)
{
- time_t i;
- struct timeval tv;
+ /*
+ * We read xtime.tv_sec atomically - it's updated
... |
b716395e2b8e450e294537de0c91476ded2f0395 | Analyze and fix the following issue in the Linux kernel code: diskquota: 32bit quota tools on 64bit architectures | Problem Details:
OpenVZ Linux kernel team has discovered the problem with 32bit quota tools
working on 64bit architectures. In 2.6.10 kernel sys32_quotactl() function
was replaced by sys_quotactl() with the comment "sys_quotactl seems to be
32/64bit clean, enable it for 32bit" However this isn't right. Look at
if_dqb... | ```diff
diff --git a/arch/ia64/ia32/ia32_entry.S b/arch/ia64/ia32/ia32_entry.S
index 99b665e2b1d5..06efd1f9b800 100644
--- a/arch/ia64/ia32/ia32_entry.S
+++ b/arch/ia64/ia32/ia32_entry.S
@@ -304,7 +304,7 @@ ia32_syscall_table:
data8 sys_ni_syscall /* init_module */
data8 sys_ni_syscall /* delete_module */
data8 s... |
6d9525b52aecd11b14c4ec982add01c11157172f | Analyze and fix the following issue in the Linux kernel code: kerneldoc fix in audit_core_dumps | Problem Details:
Fix parameter name in audit_core_dumps for kerneldoc.
Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ```diff
diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index 7ccc3da30a91..b7640a5f382a 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -2037,7 +2037,7 @@ int __audit_signal_info(int sig, struct task_struct *t)
/**
* audit_core_dumps - record information about processes that end abnormally
- * @sig: sign... |
32c3773011a9b3522bd4abadc7fad8c27417119f | Analyze and fix the following issue in the Linux kernel code: ext4: fix deadlock in ext4_remount() and orphan list handling | Problem Details:
ext4_orphan_add() and ext4_orphan_del() functions lock sb->s_lock with a
transaction started with ext4_mark_recovery_complete() waits for a transaction
holding sb->s_lock, thus leading to a possible deadlock. At the moment we
call ext4_mark_recovery_complete() from ext4_remount() we have done all the
... | ```diff
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 6768c5aa3fee..bd9aff9701c0 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -2222,12 +2222,14 @@ static void ext4_mark_recovery_complete(struct super_block * sb,
jbd2_journal_lock_updates(journal);
jbd2_journal_flush(journal);
+ lock_super(sb);
i... |
030703e49d4966bd348660e0fdc2699507efb82b | Analyze and fix the following issue in the Linux kernel code: ext3: fix deadlock in ext3_remount() and orphan list handling | Problem Details:
ext3_orphan_add() and ext3_orphan_del() functions lock sb->s_lock with a
transaction started with ext3_mark_recovery_complete() waits for a transaction
holding sb->s_lock, thus leading to a possible deadlock. At the moment we
call ext3_mark_recovery_complete() from ext3_remount() we have done all the
... | ```diff
diff --git a/fs/ext3/super.c b/fs/ext3/super.c
index 6ee4a95f4934..69a59d4580e9 100644
--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -2147,12 +2147,14 @@ static void ext3_mark_recovery_complete(struct super_block * sb,
journal_lock_updates(journal);
journal_flush(journal);
+ lock_super(sb);
if (EXT3_HA... |
467e9f4b5086a60a5cb2e032ccaf4a31abadc4c2 | Analyze and fix the following issue in the Linux kernel code: fix create_new_namespaces() return value | Problem Details:
dup_mnt_ns() and clone_uts_ns() return NULL on failure. This is wrong,
create_new_namespaces() uses ERR_PTR() to catch an error. This means that the
subsequent create_new_namespaces() will hit BUG_ON() in copy_mnt_ns() or
copy_utsname().
Modify create_new_namespaces() to also use the errors returned... | ```diff
diff --git a/fs/namespace.c b/fs/namespace.c
index c811a94e4c88..5585623f6252 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -1451,7 +1451,7 @@ static struct mnt_namespace *dup_mnt_ns(struct mnt_namespace *mnt_ns,
new_ns = kmalloc(sizeof(struct mnt_namespace), GFP_KERNEL);
if (!new_ns)
- return NULL... |
4d3b573ad9af85b6df104044f6fff05f04349db2 | Analyze and fix the following issue in the Linux kernel code: binfmt_elf warning fix | Problem Details:
fs/binfmt_elf.c: In function 'load_elf_binary':
fs/binfmt_elf.c:1002: warning: 'interp_map_addr' may be used uninitialized in this function
The compiler (gcc-4.1.0) is correct, but it failed to notice that we didn't
use the resulting value.
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Sig... | ```diff
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index 5cfa735639ae..a27e42bf3400 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -999,7 +999,7 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)
elf_entry = load_aout_interp(&loc->interp_ex,
interpreter);
} else... |
64d67d21773f1946ddc04aedc201f6c2f3ee1bfb | Analyze and fix the following issue in the Linux kernel code: revert "vanishing ioctl handler debugging" | Problem Details:
Revert my do_ioctl() debugging patch: Paul fixed the bug.
Cc: Paul Fulghum <paulkf@microgate.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ```diff
diff --git a/fs/ioctl.c b/fs/ioctl.c
index 8c90cbc903fa..479c1038ed4a 100644
--- a/fs/ioctl.c
+++ b/fs/ioctl.c
@@ -12,7 +12,6 @@
#include <linux/fs.h>
#include <linux/security.h>
#include <linux/module.h>
-#include <linux/kallsyms.h>
#include <asm/uaccess.h>
#include <asm/ioctls.h>
@@ -21,7 +20,6 @@ stat... |
522ed7767e800cff6c650ec64b0ee0677303119c | Analyze and fix the following issue in the Linux kernel code: Audit: add TTY input auditing | Problem Details:
Add TTY input auditing, used to audit system administrator's actions. This is
required by various security standards such as DCID 6/3 and PCI to provide
non-repudiation of administrator's actions and to allow a review of past
actions if the administrator seems to overstep their duties or if the system... | ```diff
diff --git a/drivers/char/Makefile b/drivers/char/Makefile
index 2f56ecc035aa..f2996a95eb07 100644
--- a/drivers/char/Makefile
+++ b/drivers/char/Makefile
@@ -15,6 +15,7 @@ obj-y += misc.o
obj-$(CONFIG_VT) += vt_ioctl.o vc_screen.o consolemap.o \
consolemap_deftbl.o selection.o keyboard.o
obj-$(CO... |
b4c07bce796833401317519e44075889c5fd4d5f | Analyze and fix the following issue in the Linux kernel code: hugetlbfs: handle empty options string | Problem Details:
I was seeing a null pointer deref in fs/super.c:vfs_kern_mount().
Some file system get_sb() handler was returning NULL mnt_sb with
a non-negative return value. I also noticed a "hugetlbfs: Bad
mount option:" message in the log.
Turns out that hugetlbfs_parse_options() was not checking for an
empty op... | ```diff
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index 711b801fbcdf..d145cb79c30a 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -621,6 +621,8 @@ hugetlbfs_parse_options(char *options, struct hugetlbfs_config *pconfig)
while ((p = strsep(&options, ",")) != NULL) {
int token;
+ i... |
e73a75fa7f062b52d015f1c961685dcaac57f710 | Analyze and fix the following issue in the Linux kernel code: hugetlbfs: use lib/parser, fix docs | Problem Details:
Use lib/parser.c to parse hugetlbfs mount options. Correct docs in
hugetlbpage.txt.
old size of hugetlbfs_fill_super: 675 bytes
new size of hugetlbfs_fill_super: 686 bytes
(hugetlbfs_parse_options() is inlined)
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Hugh Dickins <hugh@veritas.co... | ```diff
diff --git a/Documentation/vm/hugetlbpage.txt b/Documentation/vm/hugetlbpage.txt
index 687104bfd09a..51ccc48aa763 100644
--- a/Documentation/vm/hugetlbpage.txt
+++ b/Documentation/vm/hugetlbpage.txt
@@ -77,8 +77,9 @@ If the user applications are going to request hugepages using mmap system
call, then it is req... |
5216184571946b8bbf06f0cd630c7754190fdd1a | Analyze and fix the following issue in the Linux kernel code: fix typo in prefetch.h | Problem Details:
Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ```diff
diff --git a/include/linux/prefetch.h b/include/linux/prefetch.h
index fc86f274147f..1adfe668d031 100644
--- a/include/linux/prefetch.h
+++ b/include/linux/prefetch.h
@@ -27,7 +27,7 @@
prefetch(x) - prefetches the cacheline at "x" for read
prefetchw(x) - prefetches the cacheline at "x" for write
- spin... |
8b7ecb113eb884bed126c44513aeecdbbfa6fee3 | Analyze and fix the following issue in the Linux kernel code: SubmitChecklist update, fix spelling error | Problem Details:
Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ```diff
diff --git a/Documentation/SubmitChecklist b/Documentation/SubmitChecklist
index 6ebffb57e3db..19e7f65c269f 100644
--- a/Documentation/SubmitChecklist
+++ b/Documentation/SubmitChecklist
@@ -1,4 +1,4 @@
-Linux Kernel patch sumbittal checklist
+Linux Kernel patch submission checklist
~~~~~~~~~~~~~~~~~~~~~~~~~~~... |
f3a740c5fb792098d7e7a24cd194a6d8c710ea94 | Analyze and fix the following issue in the Linux kernel code: sony-laptop: use NULL for pointer | Problem Details:
Use NULL instead of 0 for pointer:
drivers/misc/sony-laptop.c:1920:6: warning: Using plain integer as NULL pointer
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Acked-by: Mattia Dongili <malattia@linux.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <... | ```diff
diff --git a/drivers/misc/sony-laptop.c b/drivers/misc/sony-laptop.c
index 8ee0321ef1c8..9623eaf4f89f 100644
--- a/drivers/misc/sony-laptop.c
+++ b/drivers/misc/sony-laptop.c
@@ -1917,7 +1917,8 @@ end:
*/
static int sony_pic_disable(struct acpi_device *device)
{
- if (ACPI_FAILURE(acpi_evaluate_object(devic... |
a6c15c2b0fbfd5c0a84f5f0e1e3f20f85d2b8692 | Analyze and fix the following issue in the Linux kernel code: ext3/ext4: orphan list corruption due bad inode | Problem Details:
After ext3 orphan list check has been added into ext3_destroy_inode()
(please see my previous patch) the following situation has been detected:
EXT3-fs warning (device sda6): ext3_unlink: Deleting nonexistent file (37901290), 0
Inode 00000101a15b7840: orphan list check failed!
00000773 6f665f00 746... | ```diff
diff --git a/fs/ext3/namei.c b/fs/ext3/namei.c
index 9bb046df827a..1586807b8177 100644
--- a/fs/ext3/namei.c
+++ b/fs/ext3/namei.c
@@ -1019,6 +1019,11 @@ static struct dentry *ext3_lookup(struct inode * dir, struct dentry *dentry, str
if (!inode)
return ERR_PTR(-EACCES);
+
+ if (is_bad_inode(inode)) {... |
9f7dd93de07420b423336d5d0028959e94778ddb | Analyze and fix the following issue in the Linux kernel code: ext3/ext4: orphan list check on destroy_inode | Problem Details:
Customers claims to ext3-related errors, investigation showed that ext3
orphan list has been corrupted and have the reference to non-ext3 inode.
The following debug helps to understand the reasons of this issue.
[akpm@linux-foundation.org: update for print_hex_dump() changes]
Signed-off-by: Vasily Ave... | ```diff
diff --git a/fs/ext3/super.c b/fs/ext3/super.c
index 6e3062913a92..6ee4a95f4934 100644
--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -459,6 +459,14 @@ static struct inode *ext3_alloc_inode(struct super_block *sb)
static void ext3_destroy_inode(struct inode *inode)
{
+ if (!list_empty(&(EXT3_I(inode)->i_orp... |
759448f459234bfcf34b82471f0dba77a9aca498 | Analyze and fix the following issue in the Linux kernel code: Kernel utf-8 handling | Problem Details:
This patch fixes dead keys and copy/paste of non-ASCII characters in UTF-8
mode on Linux console. See more details about the original patch at:
http://chris.heathens.co.nz/linux/utf8.html
Already posted on
(Oldest) http://lkml.org/lkml/2003/5/31/148
http://lkml.org/lkml/2005/12/24/69
(Rec... | ```diff
diff --git a/drivers/char/consolemap.c b/drivers/char/consolemap.c
index fd40b959afdd..4b3916f54909 100644
--- a/drivers/char/consolemap.c
+++ b/drivers/char/consolemap.c
@@ -177,6 +177,7 @@ struct uni_pagedir {
unsigned long refcount;
unsigned long sum;
unsigned char *inverse_translations[4];
+ u16 *inv... |
cb510b8172602a66467f3551b4be1911f5a7c8c2 | Analyze and fix the following issue in the Linux kernel code: seq_file: more atomicity in traverse() | Problem Details:
Original problem: in some circumstances seq_file interface can present
infinite proc file to the following script when normally said proc file is
finite:
while read line; do
[do something with $line]
done </proc/$FILE
bash, to implement such loop does essentially
read(0, buf, 128);
[find \n]
... | ```diff
diff --git a/fs/seq_file.c b/fs/seq_file.c
index e8e51db4989d..bbb19be260ce 100644
--- a/fs/seq_file.c
+++ b/fs/seq_file.c
@@ -177,21 +177,23 @@ EXPORT_SYMBOL(seq_read);
static int traverse(struct seq_file *m, loff_t offset)
{
- loff_t pos = 0;
+ loff_t pos = 0, index;
int error = 0;
void *p;
m->ver... |
9e6077bd84a7bffa73b59d9704682aeab5781fa0 | Analyze and fix the following issue in the Linux kernel code: atmel_serial: fix break handling | Problem Details:
The RXBRK field in the AT91/AT32 USART status register has the
following definition according to e.g. the AT32AP7000 data sheet:
RXBRK: Break Received/End of Break
0: No Break received or End of Break detected since the last RSTSTA.
1: Break Received or End of Break detected since the last... | ```diff
diff --git a/drivers/serial/atmel_serial.c b/drivers/serial/atmel_serial.c
index 3320bcd92c0a..4d6b3c56d20e 100644
--- a/drivers/serial/atmel_serial.c
+++ b/drivers/serial/atmel_serial.c
@@ -114,6 +114,7 @@ struct atmel_uart_port {
struct uart_port uart; /* uart */
struct clk *clk; /* uart clock */
uns... |
4a19542e5f694cd408a32c3d9dc593ba9366e2d7 | Analyze and fix the following issue in the Linux kernel code: O_CLOEXEC for SCM_RIGHTS | Problem Details:
Part two in the O_CLOEXEC saga: adding support for file descriptors received
through Unix domain sockets.
The patch is once again pretty minimal, it introduces a new flag for recvmsg
and passes it just like the existing MSG_CMSG_COMPAT flag. I think this bit
is not used otherwise but the networking p... | ```diff
diff --git a/fs/open.c b/fs/open.c
index e6991c1b5874..be6a457f4226 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -855,7 +855,7 @@ EXPORT_SYMBOL(dentry_open);
/*
* Find an empty file descriptor entry, and mark it busy.
*/
-static int get_unused_fd_flags(int flags)
+int get_unused_fd_flags(int flags)
{
struc... |
f23513e8d96cf5e6cf8d2ff0cb5dd6bbc33995e4 | Analyze and fix the following issue in the Linux kernel code: Introduce O_CLOEXEC | Problem Details:
The problem is as follows: in multi-threaded code (or more correctly: all
code using clone() with CLONE_FILES) we have a race when exec'ing.
thread #1 thread #2
fd=open()
fork + exec
fcntl(fd,F_SETFD,FD_CLOEXEC)
In some applications ... | ```diff
diff --git a/fs/open.c b/fs/open.c
index 0d515d161974..e6991c1b5874 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -855,7 +855,7 @@ EXPORT_SYMBOL(dentry_open);
/*
* Find an empty file descriptor entry, and mark it busy.
*/
-int get_unused_fd(void)
+static int get_unused_fd_flags(int flags)
{
struct files_str... |
1b0fac45878bb88759eec347c273285195649ff7 | Analyze and fix the following issue in the Linux kernel code: dma-mapping: prevent dma dependent code from linking on !HAS_DMA archs | Problem Details:
Continuing the work started in 411f0f3edc141a582190d3605cadd1d993abb6df ...
This enables code with a dma path, that compiles away, to build without
requiring additional code factoring. It also prevents code that calls
dma_alloc_coherent and dma_free_coherent from linking whereas previously
the code w... | ```diff
diff --git a/arch/arm26/Kconfig b/arch/arm26/Kconfig
index 20688bc13e9b..9044f33299f7 100644
--- a/arch/arm26/Kconfig
+++ b/arch/arm26/Kconfig
@@ -17,6 +17,9 @@ config MMU
bool
default y
+config NO_DMA
+ def_bool y
+
config ARCH_ACORN
bool
default y
diff --git a/arch/h8300/Kconfig b/arc... |
185848707e73382ba930857502a0b80ff6039967 | Analyze and fix the following issue in the Linux kernel code: fault-injection: fix example scripts in documentation | Problem Details:
Fix and cleanup example scripts in fault injection documentation.
1. Eliminate broken oops() shell function.
2. Fold failcmd.sh and failmodule.sh into example scripts. It makes
the example scripts work independent of current working directory.
3. Set "space" parameter to 0 to start injecting erro... | ```diff
diff --git a/Documentation/fault-injection/failcmd.sh b/Documentation/fault-injection/failcmd.sh
deleted file mode 100644
index 63177aba8106..000000000000
--- a/Documentation/fault-injection/failcmd.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-
-echo 1 > /proc/self/make-it-fail
-exec $*
diff --git a/Documenta... |
a6739af8b9e8bf0fd1fb3f4f8406a9f650cb733a | Analyze and fix the following issue in the Linux kernel code: ext2: fix a comment when ext2_release_file() is called | Problem Details:
Signed-off-by: Jan Kara <jack@suse.cz>
Acked-by: "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/fs/ext2/file.c b/fs/ext2/file.c
index 04afeecaaef3..ab7961260c49 100644
--- a/fs/ext2/file.c
+++ b/fs/ext2/file.c
@@ -24,9 +24,9 @@
#include "acl.h"
/*
- * Called when an inode is released. Note that this is different
- * from ext2_open_file: open gets called at every open, but release
- * gets... |
2b770b4b29c741bbcbb77d2618955897765a81bf | Analyze and fix the following issue in the Linux kernel code: Char: mxser_new, fix sparse warning | Problem Details:
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.org> | ```diff
diff --git a/drivers/char/mxser_new.c b/drivers/char/mxser_new.c
index 6cde448cd5b2..71b965705177 100644
--- a/drivers/char/mxser_new.c
+++ b/drivers/char/mxser_new.c
@@ -1560,7 +1560,7 @@ static int mxser_ioctl_special(unsigned int cmd, void __user *argp)
return -EFAULT;
return 0;
case MOXA_ASPP_MON_E... |
1e3e8d91fee56e1ab598b265466dc38033f1b915 | Analyze and fix the following issue in the Linux kernel code: rocket.c: fix unchecked mutex_lock_interruptible() | Problem Details:
Check the return of mutex_lock_interruptible() in drivers/char/rocket.c and
return ERESTARTSYS if we were interrupted.
Signed-off-by: Satyam Sharma <satyam.sharma@gmail.com>
Cc: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <tor... | ```diff
diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c
index a3fd7e7ba5a9..0270080ff0c0 100644
--- a/drivers/char/rocket.c
+++ b/drivers/char/rocket.c
@@ -1702,7 +1702,8 @@ static int rp_write(struct tty_struct *tty,
if (count <= 0 || rocket_paranoia_check(info, "rp_write"))
return 0;
- mutex_lock_in... |
60bfba7e85f88fe834e623ead799cf580de20971 | Analyze and fix the following issue in the Linux kernel code: PIE randomization | Problem Details:
This patch is using mmap()'s randomization functionality in such a way that
it maps the main executable of (specially compiled/linked -pie/-fpie)
ET_DYN binaries onto a random address (in cases in which mmap() is allowed
to perform a randomization).
Origin of this patch is in exec-shield
(http://peopl... | ```diff
diff --git a/arch/ia64/ia32/binfmt_elf32.c b/arch/ia64/ia32/binfmt_elf32.c
index c05bda662364..6f4d3d06f0ed 100644
--- a/arch/ia64/ia32/binfmt_elf32.c
+++ b/arch/ia64/ia32/binfmt_elf32.c
@@ -261,7 +261,7 @@ elf32_set_personality (void)
}
static unsigned long
-elf32_map (struct file *filep, unsigned long add... |
693783817a79d8619335e2bf1a33de73cf189864 | Analyze and fix the following issue in the Linux kernel code: mpu401 warning fixes | Problem Details:
Fix these:
sound/oss/mpu401.c: In function 'attach_mpu401':
sound/oss/mpu401.c:1006: warning: cast to pointer from integer of different size
sound/oss/mpu401.c:1115: warning: cast to pointer from integer of different size
sound/oss/mpu401.c: In function 'unload_mpu401':
sound/oss/mpu401.c:1230: warnin... | ```diff
diff --git a/sound/oss/mpu401.c b/sound/oss/mpu401.c
index 2796c0ef985f..a690ca57adb5 100644
--- a/sound/oss/mpu401.c
+++ b/sound/oss/mpu401.c
@@ -1003,7 +1003,8 @@ int attach_mpu401(struct address_info *hw_config, struct module *owner)
}
if (!devc->shared_irq)
{
- if (request_irq(devc->irq, mpuintr,... |
d05e96fe4664c0398f1d060c0f6a8ff8fc74a449 | Analyze and fix the following issue in the Linux kernel code: fix compiler warnings in acorn.c | Problem Details:
warning: 'adfs_partition' defined but not used
warning: 'riscix_partition' defined but not used
warning: 'linux_partition' defined but not used
Signed-off-by: Denver Gingerich <denver@ossguy.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-fou... | ```diff
diff --git a/fs/partitions/acorn.c b/fs/partitions/acorn.c
index e3491328596b..3d3e16631472 100644
--- a/fs/partitions/acorn.c
+++ b/fs/partitions/acorn.c
@@ -25,6 +25,8 @@
#define PARTITION_RISCIX_SCSI 2
#define PARTITION_LINUX 9
+#if defined(CONFIG_ACORN_PARTITION_CUMANA) || \
+ defined(CONFIG_ACORN_PART... |
0a3021f4e249fbdb5f30d614707b5e02022e4c9b | Analyze and fix the following issue in the Linux kernel code: Remove unnecessary includes of spinlock.h under include/linux | Problem Details:
Remove the obviously unnecessary includes of <linux/spinlock.h> under the
include/linux/ directory, and fix the couple errors that are introduced as
a result of that.
Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus T... | ```diff
diff --git a/include/linux/attribute_container.h b/include/linux/attribute_container.h
index 93bfb0beb62a..8ff274933948 100644
--- a/include/linux/attribute_container.h
+++ b/include/linux/attribute_container.h
@@ -12,7 +12,6 @@
#include <linux/device.h>
#include <linux/list.h>
#include <linux/klist.h>
-#inc... |
9aacd599342fdfc1fb9422f37e900609b7a46249 | Analyze and fix the following issue in the Linux kernel code: fat: gcc 4.3 warning fix | Problem Details:
This patch fixes the following warnings.
fs/fat/dir.c: In function 'fat_parse_long':
include/linux/msdos_fs.h:294: warning: array subscript is above array bounds
include/linux/msdos_fs.h:295: warning: array subscript is above array bounds
include/linux/msdos_fs.h:295: warning: array subscript is above... | ```diff
diff --git a/fs/fat/dir.c b/fs/fat/dir.c
index ccf161dffb63..72cbcd61bd95 100644
--- a/fs/fat/dir.c
+++ b/fs/fat/dir.c
@@ -313,7 +313,7 @@ int fat_search_long(struct inode *inode, const unsigned char *name,
wchar_t bufuname[14];
unsigned char xlate_len, nr_slots;
wchar_t *unicode = NULL;
- unsigned char w... |
85420ccad1610f123365eec89848ef25641bc6b7 | Analyze and fix the following issue in the Linux kernel code: vxfs warning fixes | Problem Details:
gcc-4.3:
fs/freevxfs/vxfs_lookup.c: In function 'vxfs_find_entry':
fs/freevxfs/vxfs_lookup.c:139: warning: cast from pointer to integer of different size
fs/freevxfs/vxfs_lookup.c: In function 'vxfs_readdir':
fs/freevxfs/vxfs_lookup.c:294: warning: cast from pointer to integer of different size
Cc: C... | ```diff
diff --git a/fs/freevxfs/vxfs_dir.h b/fs/freevxfs/vxfs_dir.h
index 8a4dfef1ddad..3c96d6e63978 100644
--- a/fs/freevxfs/vxfs_dir.h
+++ b/fs/freevxfs/vxfs_dir.h
@@ -80,7 +80,7 @@ struct vxfs_direct {
* a d_name with size len.
*/
#define VXFS_DIRPAD 4
-#define VXFS_NAMEMIN ((int)((struct vxfs_direct *)0)->d... |
21f3da95daed2d0f0c28cc4ef8b1103fbfb7bded | Analyze and fix the following issue in the Linux kernel code: fuse warning fix | Problem Details:
gcc-4.3:
fs/fuse/dir.c: In function 'parse_dirfile':
fs/fuse/dir.c:833: warning: cast from pointer to integer of different size
fs/fuse/dir.c:835: warning: cast from pointer to integer of different size
[miklos@szeredi.hu: use offsetof]
Acked-by: Miklos Szeredi <miklos@szeredi.hu>
Signed-off-by: Andr... | ```diff
diff --git a/include/linux/fuse.h b/include/linux/fuse.h
index 534744efe30d..9fbe9d258e22 100644
--- a/include/linux/fuse.h
+++ b/include/linux/fuse.h
@@ -339,7 +339,7 @@ struct fuse_dirent {
char name[0];
};
-#define FUSE_NAME_OFFSET ((unsigned) ((struct fuse_dirent *) 0)->name)
+#define FUSE_NAME_OFFSET ... |
1c6b4aa94576eee6dec3b8011f60d7f666db90b0 | Analyze and fix the following issue in the Linux kernel code: cpu hotplug: fix ksoftirqd termination on cpu hotplug with naughty realtime process | Problem Details:
Fix ksoftirqd termination on cpu hotplug with naughty real time process.
Assuming the following case:
- Try to hot remove CPU2 from CPU1.
- There is a real time process on CPU2, and that process doesn't sleep at all.
- That rt process and ksoftirqd/2 is migrated to the CPU0
Then ksoftirqd/2 can't... | ```diff
diff --git a/kernel/softirq.c b/kernel/softirq.c
index 73217a9e2875..8de267790166 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -614,12 +614,16 @@ static int __cpuinit cpu_callback(struct notifier_block *nfb,
kthread_bind(per_cpu(ksoftirqd, hotcpu),
any_online_cpu(cpu_online_map));
case ... |
85653af7d488702165eba72c6c1dd0250fae4e70 | Analyze and fix the following issue in the Linux kernel code: Fix stop_machine_run problem with naughty real time process | Problem Details:
stop_machine_run() does its work on "kstopmachine" thread having max
priority. However that thread get such priority after woken up.
Therefore, in the following case ...
- "kstopmachine" try to run on CPU1
- There is a real time process which doesn't relinquish CPU time
voluntary on CPU1
..... | ```diff
diff --git a/kernel/stop_machine.c b/kernel/stop_machine.c
index fcee2a8e6da3..319821ef78af 100644
--- a/kernel/stop_machine.c
+++ b/kernel/stop_machine.c
@@ -93,10 +93,6 @@ static void stopmachine_set_state(enum stopmachine_state state)
static int stop_machine(void)
{
int i, ret = 0;
- struct sched_param p... |
647bd61a5f3a51a38c670f91af9d861ad66149a3 | Analyze and fix the following issue in the Linux kernel code: UDF: check for allocated memory for inode data | Problem Details:
This patch adds checking for granted memory while filling up inode data to
prevent possible NULL pointer usage. If there is not enough memory to fill
inode data we just mark it as "bad". Also some whitespace cleanup.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: Jan Kara <jack@ucw.cz>
Cc: ... | ```diff
diff --git a/fs/udf/inode.c b/fs/udf/inode.c
index bf7de0bdbab3..5b82e489af78 100644
--- a/fs/udf/inode.c
+++ b/fs/udf/inode.c
@@ -49,6 +49,7 @@ MODULE_LICENSE("GPL");
static mode_t udf_convert_permissions(struct fileEntry *);
static int udf_update_inode(struct inode *, int);
static void udf_fill_inode(struc... |
924b42d5a2dbe508407a0a6290d3751f826bccdd | Analyze and fix the following issue in the Linux kernel code: Use boot based time for process start time and boot time in /proc | Problem Details:
Commit 411187fb05cd11676b0979d9fbf3291db69dbce2 caused boot time to move and
process start times to become invalid after suspend. Using boot based time
for those restores the old behaviour and fixes the issue.
[akpm@linux-foundation.org: little cleanup]
Signed-off-by: Tomas Janousek <tjanouse@redhat.... | ```diff
diff --git a/fs/proc/array.c b/fs/proc/array.c
index 98e78e2f18d6..680c913575f0 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -440,8 +440,9 @@ static int do_task_stat(struct task_struct *task, char * buffer, int whole)
/* Temporary variable needed for gcc-2.96 */
/* convert timespec -> nsec*/
- st... |
ed4aaadb1a7913f509f05d3e67840541a180713f | Analyze and fix the following issue in the Linux kernel code: fix jvc cdrom drive lockup | Problem Details:
Before calling init_hwif_default, ide_unregister gets lock ide_lock and
disables irq. init_hwif_default calls ide_default_io_base which calls
pci_get_device and later pci_get_subsys tries to apply for semaphore
pci_bus_sem and goes to sleep.
Mostly, pci_get_device should be called when irq is turned ... | ```diff
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index a7bce75c6732..34b8dae0d90f 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -22,6 +22,18 @@ EXPORT_SYMBOL(pci_root_buses);
LIST_HEAD(pci_devices);
+/*
+ * Some device drivers need know if pci is initiated.
+ * Basically, we think pci... |
786d7e1612f0b0adb6046f19b906609e4fe8b1ba | Analyze and fix the following issue in the Linux kernel code: Fix rmmod/read/write races in /proc entries | Problem Details:
Fix following races:
===========================================
1. Write via ->write_proc sleeps in copy_from_user(). Module disappears
meanwhile. Or, more generically, system call done on /proc file, method
supplied by module is called, module dissapeares meanwhile.
pde = create_proc_entry(... | ```diff
diff --git a/fs/proc/generic.c b/fs/proc/generic.c
index 8a40e15f5ecb..4f8e53568b22 100644
--- a/fs/proc/generic.c
+++ b/fs/proc/generic.c
@@ -20,6 +20,7 @@
#include <linux/namei.h>
#include <linux/bitops.h>
#include <linux/spinlock.h>
+#include <linux/completion.h>
#include <asm/uaccess.h>
#include "int... |
e8234483e7545b3cd298b0265fcee2e4a14c9f51 | Analyze and fix the following issue in the Linux kernel code: uml: export hostfs symbols | Problem Details:
Add some exports for hostfs that are required after Alberto Bertogli's fixes
for accessing unlinked host files.
Also did some style cleanups while I was here.
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm... | ```diff
diff --git a/arch/um/os-Linux/user_syms.c b/arch/um/os-Linux/user_syms.c
index 3f33165ada68..419b2d5ff6de 100644
--- a/arch/um/os-Linux/user_syms.c
+++ b/arch/um/os-Linux/user_syms.c
@@ -5,7 +5,8 @@
* so I *must* declare good prototypes for them and then EXPORT them.
* The kernel code uses the macro defined... |
89df6bfc04059716de2eb2fe529f05b3e124fafd | Analyze and fix the following issue in the Linux kernel code: uml: DEBUG_SHIRQ fixes | Problem Details:
DEBUG_SHIRQ generates spurious interrupts, triggering handlers such as
mconsole_interrupt() or line_interrupt(). They expect data to be available to
be read from their sockets/pipes, but in the case of spurious interrupts, the
host didn't actually send anything, so UML hangs in read() and friends.
Set... | ```diff
diff --git a/arch/um/drivers/chan_user.c b/arch/um/drivers/chan_user.c
index 13f0bf852b2a..5d1289d33410 100644
--- a/arch/um/drivers/chan_user.c
+++ b/arch/um/drivers/chan_user.c
@@ -170,7 +170,13 @@ static int winch_tramp(int fd, struct tty_struct *tty, int *fd_out)
err = -EINVAL;
goto out_... |
0a6d3a2a3813e7b25267366cfbf9a4a4698dd1c2 | Analyze and fix the following issue in the Linux kernel code: uml: fix request->sector update | Problem Details:
It is theoretically possible for a request to finish and be freed between
writing it to the I/O thread and updating the sector count. In this case, the
update will dereference a freed pointer.
To avoid this, I delay the update until processing the next sg segment, when
the request pointer is known to... | ```diff
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c
index 2e09f162c42f..0947f2e20045 100644
--- a/arch/um/drivers/ubd_kern.c
+++ b/arch/um/drivers/ubd_kern.c
@@ -1083,7 +1083,7 @@ static void do_ubd_request(request_queue_t *q)
{
struct io_thread_req *io_req;
struct request *req;
- int n;
+... |
5c6af69abe9436c33b82a13623b38a4cc51e6464 | Analyze and fix the following issue in the Linux kernel code: fix alpha ISA support | Problem Details:
isa_bus_to_virt() is still needed in a few places (lance.c, at least). When
we switch the kernel to using -Werror-implicit-function-declaration, the lack
of isa_bus_to_virt() breaks alpha allmodconfig builds.
Add isa_bus_to_virt() and deprecate the ezisting ISA APIs, though it might be
better to defi... | ```diff
diff --git a/include/asm-alpha/io.h b/include/asm-alpha/io.h
index 21a86f1a05b3..ab5b60dcef19 100644
--- a/include/asm-alpha/io.h
+++ b/include/asm-alpha/io.h
@@ -4,6 +4,7 @@
#ifdef __KERNEL__
#include <linux/kernel.h>
+#include <linux/mm.h>
#include <asm/compiler.h>
#include <asm/system.h>
#include <asm... |
ebaf4fc13e293dcafbb13c91aae2a45722652740 | Analyze and fix the following issue in the Linux kernel code: alpha: fix trivial section mismatch warnings | Problem Details:
Fix the following section mismatch warnings:
WARNING: arch/alpha/kernel/built-in.o(.text+0x7c78): Section mismatch: reference to .init.text:init_rtc_irq (between 'common_init_rtc' and 'timer_interrupt')
WARNING: arch/alpha/kernel/built-in.o(.text+0x7c7c): Section mismatch: reference to .init.text:init_... | ```diff
diff --git a/arch/alpha/kernel/srmcons.c b/arch/alpha/kernel/srmcons.c
index 930cedc8be24..783f4e50c111 100644
--- a/arch/alpha/kernel/srmcons.c
+++ b/arch/alpha/kernel/srmcons.c
@@ -289,7 +289,7 @@ srm_console_device(struct console *co, int *index)
return srmcons_driver;
}
-static int __init
+static int
... |
86277d594926f3ae4f50ac0fcd9e2fa3cc28a774 | Analyze and fix the following issue in the Linux kernel code: h8300 zImage support update | Problem Details:
- Add missing files
- Add Makefile target
- Change image base
- Style fix
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ```diff
diff --git a/arch/h8300/Makefile b/arch/h8300/Makefile
index b2d896a7e598..53b5c1edf596 100644
--- a/arch/h8300/Makefile
+++ b/arch/h8300/Makefile
@@ -61,10 +61,11 @@ archmrproper:
archclean:
$(Q)$(MAKE) $(clean)=$(boot)
-vmlinux.srec vmlinux.bin: vmlinux
+vmlinux.srec vmlinux.bin zImage: vmlinux
$(Q)$(M... |
2f75d1098c51734ce47d0afd44ecdc2ae9713031 | Analyze and fix the following issue in the Linux kernel code: m68knommu: remove cruft from setup code | Problem Details:
Clean out cruft.
. remove include files not needed
. remove not used CAT_ROMARRAY code
. remove generic machine pointers not used
. remove unused functions
. fix email address in copyrights
Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-... | ```diff
diff --git a/arch/m68knommu/kernel/setup.c b/arch/m68knommu/kernel/setup.c
index 8133b1047353..80f4e9d74ac1 100644
--- a/arch/m68knommu/kernel/setup.c
+++ b/arch/m68knommu/kernel/setup.c
@@ -1,8 +1,8 @@
/*
* linux/arch/m68knommu/kernel/setup.c
*
- * Copyright (C) 1999-2004 Greg Ungerer (gerg@snapgear.co... |
5ed44a401ddfc60e11c3484e86f0c8285051139a | Analyze and fix the following issue in the Linux kernel code: do not limit locked memory when RLIMIT_MEMLOCK is RLIM_INFINITY | Problem Details:
Fix a bug in mm/mlock.c on 32-bit architectures that prevents a user from
locking more than 4GB of shared memory, or allocating more than 4GB of
shared memory in hugepages, when rlim[RLIMIT_MEMLOCK] is set to
RLIM_INFINITY.
Signed-off-by: Herbert van den Bergh <herbert.van.den.bergh@oracle.com>
Acked-... | ```diff
diff --git a/mm/mlock.c b/mm/mlock.c
index 4d3fea267e0d..7b2656055d6a 100644
--- a/mm/mlock.c
+++ b/mm/mlock.c
@@ -244,9 +244,12 @@ int user_shm_lock(size_t size, struct user_struct *user)
locked = (size + PAGE_SIZE - 1) >> PAGE_SHIFT;
lock_limit = current->signal->rlim[RLIMIT_MEMLOCK].rlim_cur;
+ if (loc... |
98011f569e2ae1e4ae394f6e23faa16676d50de4 | Analyze and fix the following issue in the Linux kernel code: mm: fix improper .init-type section references | Problem Details:
.. which modpost started warning about.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ```diff
diff --git a/kernel/kthread.c b/kernel/kthread.c
index bbd51b81a3e8..a404f7ee7395 100644
--- a/kernel/kthread.c
+++ b/kernel/kthread.c
@@ -215,7 +215,7 @@ int kthread_stop(struct task_struct *k)
EXPORT_SYMBOL(kthread_stop);
-static __init void kthreadd_setup(void)
+static noinline __init_refok void kthread... |
140d5a49046b6d73dce4a4229e88c000a99ee126 | Analyze and fix the following issue in the Linux kernel code: numa: mempolicy: trivial debug fixes. | Problem Details:
Enabling debugging fails to build due to the nodemask variable in
do_mbind() having changed names, and then oopses on boot due to the
assumption that the nodemask can be dereferenced -- which doesn't work out
so well when the policy is changed to MPOL_DEFAULT with a NULL nodemask by
numa_default_policy... | ```diff
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index a67c8f1828ac..188f8d9c4aed 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -101,8 +101,6 @@
static struct kmem_cache *policy_cache;
static struct kmem_cache *sn_cache;
-#define PDprintk(fmt...)
-
/* Highest zone. An specific allocation for a zone below... |
f0630fff54a239efbbd89faf6a62da071ef1ff78 | Analyze and fix the following issue in the Linux kernel code: SLUB: support slub_debug on by default | Problem Details:
Add a new configuration variable
CONFIG_SLUB_DEBUG_ON
If set then the kernel will be booted by default with slab debugging
switched on. Similar to CONFIG_SLAB_DEBUG. By default slab debugging
is available but must be enabled by specifying "slub_debug" as a
kernel parameter.
Also add support to switc... | ```diff
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 4344f69ae24a..8916410307f1 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1580,35 +1580,39 @@ and is between 256 and 4096 characters. It is defined in the file
slram= ... |
45426812d6b601430d560cb6049757b5b0bc71c4 | Analyze and fix the following issue in the Linux kernel code: mm: debug check for the fault vs invalidate race | Problem Details:
Add a bugcheck for Andrea's pagefault vs invalidate race. This is triggerable
for both linear and nonlinear pages with a userspace test harness (using
direct IO and truncate, respectively).
Signed-off-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-of... | ```diff
diff --git a/mm/filemap.c b/mm/filemap.c
index c6ebd9f912ab..e006c57bda54 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -120,6 +120,7 @@ void __remove_from_page_cache(struct page *page)
page->mapping = NULL;
mapping->nrpages--;
__dec_zone_page_state(page, NR_FILE_PAGES);
+ BUG_ON(page_mapped(page));
}
... |
f96efd585b8d847181f81bf16721f96ded18d9fe | Analyze and fix the following issue in the Linux kernel code: hugetlb: fix race in alloc_fresh_huge_page() | Problem Details:
That static `nid' index needs locking. Without it we can end up calling
alloc_pages_node() with an illegal node ID and the kernel crashes.
Acked-by: gurudas pai <gurudas.pai@oracle.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <tor... | ```diff
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index eaba7d6b25a0..acc0fb3cf067 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -101,13 +101,20 @@ static void free_huge_page(struct page *page)
static int alloc_fresh_huge_page(void)
{
- static int nid = 0;
+ static int prev_nid;
struct page *page;
- page = alloc... |
2706a1b89b1a3e7434a668d4a9d15f616da96685 | Analyze and fix the following issue in the Linux kernel code: vmscan: fix comments related to shrink_list() | Problem Details:
Fix the shrink_list name on some files under mm/ directory.
Signed-off-by: Anderson Briglia <anderson.briglia@indt.org.br>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ```diff
diff --git a/mm/swap_state.c b/mm/swap_state.c
index 5f7cf2a4cb55..925d5c50f18d 100644
--- a/mm/swap_state.c
+++ b/mm/swap_state.c
@@ -21,7 +21,7 @@
/*
* swapper_space is a fiction, retained to simplify the path through
- * vmscan's shrink_list, to make sync_page look nicer, and to allow
+ * vmscan's shrin... |
f0c0b2b808f232741eadac272bd4bc51f18df0f4 | Analyze and fix the following issue in the Linux kernel code: change zonelist order: zonelist order selection logic | Problem Details:
Make zonelist creation policy selectable from sysctl/boot option v6.
This patch makes NUMA's zonelist (of pgdat) order selectable.
Available order are Default(automatic)/ Node-based / Zone-based.
[Default Order]
The kernel selects Node-based or Zone-based order automatically.
[Node-based Order]
This... | ```diff
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 62aab585d9d7..4344f69ae24a 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1196,6 +1196,11 @@ and is between 256 and 4096 characters. It is defined in the file
nowb [A... |
b1c931e39327ef121797927d4b3198d370e75b9b | Analyze and fix the following issue in the Linux kernel code: x86: initial fixmap support | Problem Details:
Needed to get fixed virtual address for USB debug and earlycon with mmio.
Signed-off-by: Eric W. Biderman <ebiderman@xmisson.com>
Signed-off-by: Yinghai Lu <yinghai.lu@sun.com>
Cc: Andi Kleen <ak@suse.de>
Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Gerd Hoffman... | ```diff
diff --git a/arch/i386/kernel/head.S b/arch/i386/kernel/head.S
index f74dfc419b56..82714668d43b 100644
--- a/arch/i386/kernel/head.S
+++ b/arch/i386/kernel/head.S
@@ -168,6 +168,12 @@ page_pde_offset = (__PAGE_OFFSET >> 20);
.section .init.text,"ax",@progbits
#endif
+ /* Do an early initialization of the fi... |
96d7fa421e6424ad9ef6d1d039375dc2edb63fe8 | Analyze and fix the following issue in the Linux kernel code: lib: add idr_for_each() | Problem Details:
This patch adds an iterator function for the idr data structure. Compared
to just iterating through the idr with an integer and idr_find, this
iterator is (almost, but not quite) linear in the number of elements, as
opposed to the number of integers in the range covered by the idr. This
makes a diffe... | ```diff
diff --git a/include/linux/idr.h b/include/linux/idr.h
index 915572fa030b..8442c0bffc06 100644
--- a/include/linux/idr.h
+++ b/include/linux/idr.h
@@ -78,6 +78,8 @@ void *idr_find(struct idr *idp, int id);
int idr_pre_get(struct idr *idp, gfp_t gfp_mask);
int idr_get_new(struct idr *idp, void *ptr, int *id);
... |
de7d4f0e1172a72277d660fa0be59654ea02bed0 | Analyze and fix the following issue in the Linux kernel code: update checkpatch.pl to version 0.07 | Problem Details:
This version brings a number of new checks, fixes for flase
positives, plus a clarification of the output to better guide use. Of
note:
- checks for documentation for new __setup calls
- clearer reporting where braces and parenthesis are involved
- reports for closing brace and semi-colon spaci... | ```diff
diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches
index 0958e97d4bf4..3f9a7912e69b 100644
--- a/Documentation/SubmittingPatches
+++ b/Documentation/SubmittingPatches
@@ -464,9 +464,25 @@ section Linus Computer Science 101.
Nuff said. If your code deviates too much from this, it is... |
f2a11b158a24301e9158e9c873fa88e5eb775486 | Analyze and fix the following issue in the Linux kernel code: LZO1X: fix lzo1x_worst_compress | Problem Details:
This is a correction for a macro which gives worst case compressed data
size by LZO1X.
This patch was provided by the LZO author (Markus Oberhumer).
Signed-off-by: Nitin Gupta <nitingupta910@gmail.com>
Cc: "Markus F.X.J. Oberhumer" <markus@oberhumer.com>
Cc: "Richard Purdie" <rpurdie@openedhand.com>
... | ```diff
diff --git a/include/linux/lzo.h b/include/linux/lzo.h
index 582d8b711a13..d793497ec1ca 100644
--- a/include/linux/lzo.h
+++ b/include/linux/lzo.h
@@ -17,7 +17,7 @@
#define LZO1X_MEM_COMPRESS (16384 * sizeof(unsigned char *))
#define LZO1X_1_MEM_COMPRESS LZO1X_MEM_COMPRESS
-#define lzo1x_worst_compress(x) (... |
f89b779508f457b2af05dd5ac82a425db4a56ee3 | Analyze and fix the following issue in the Linux kernel code: jbd2 commit: fix transaction dropping | Problem Details:
We have to check that also the second checkpoint list is non-empty before
dropping the transaction.
Signed-off-by: Jan Kara <jack@suse.cz>
Cc: Chuck Ebbert <cebbert@redhat.com>
Cc: Kirill Korotaev <dev@openvz.org>
Cc: <linux-ext4@vger.kernel.org>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <a... | ```diff
diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c
index 2856e1100a5f..c0f59d1b13dc 100644
--- a/fs/jbd2/commit.c
+++ b/fs/jbd2/commit.c
@@ -896,7 +896,8 @@ restart_loop:
journal->j_committing_transaction = NULL;
spin_unlock(&journal->j_state_lock);
- if (commit_transaction->t_checkpoint_list == NULL) {
+ i... |
fe28e42b99173ba088b1d8448e53029e100bff27 | Analyze and fix the following issue in the Linux kernel code: jbd commit: fix transaction dropping | Problem Details:
We have to check that also the second checkpoint list is non-empty before
dropping the transaction.
Signed-off-by: Jan Kara <jack@suse.cz>
Cc: Chuck Ebbert <cebbert@redhat.com>
Cc: Kirill Korotaev <dev@openvz.org>
Cc: <linux-ext4@vger.kernel.org>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <a... | ```diff
diff --git a/fs/jbd/commit.c b/fs/jbd/commit.c
index 1facfaff97cb..a003d50edcdb 100644
--- a/fs/jbd/commit.c
+++ b/fs/jbd/commit.c
@@ -887,7 +887,8 @@ restart_loop:
journal->j_committing_transaction = NULL;
spin_unlock(&journal->j_state_lock);
- if (commit_transaction->t_checkpoint_list == NULL) {
+ if (c... |
09561f44c75bc462ae86590b9c089d01c4e94a74 | Analyze and fix the following issue in the Linux kernel code: authgss build fix | Problem Details:
Recent breakage..
net/sunrpc/auth_gss/auth_gss.c:1002: warning: implicit declaration of function 'lock_kernel'
net/sunrpc/auth_gss/auth_gss.c:1004: warning: implicit declaration of function 'unlock_kernel'
Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: "J. Bruce Fields" <bfields@fieldses.org>
S... | ```diff
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
index baf4096d52d4..abfda33bac64 100644
--- a/net/sunrpc/auth_gss/auth_gss.c
+++ b/net/sunrpc/auth_gss/auth_gss.c
@@ -43,6 +43,7 @@
#include <linux/types.h>
#include <linux/slab.h>
#include <linux/sched.h>
+#include <linux/smp_lock.... |
5874c18b105cc7a24972191b7f08a93b1205a425 | Analyze and fix the following issue in the Linux kernel code: umem: Fix match of pci_ids in umem driver | Problem Details:
the pci device list for umem was not using PCI_DEVICE, so the
subvendor/subdevice fields were not set to ANY, so matching
didn't work properly.
Change to use PCI_DEVICE.
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com> | ```diff
diff --git a/drivers/block/umem.c b/drivers/block/umem.c
index 62c9d08f53ce..dec74bd23496 100644
--- a/drivers/block/umem.c
+++ b/drivers/block/umem.c
@@ -1092,23 +1092,18 @@ static void mm_pci_remove(struct pci_dev *dev)
blk_cleanup_queue(card->queue);
}
-static const struct pci_device_id mm_pci_ids[] = {... |
d54bc2793ec3405c6b8f217568a82b87bd8a591b | Analyze and fix the following issue in the Linux kernel code: [SPARC64]: Fix UP build. | Problem Details:
Signed-off-by: David S. Miller <davem@davemloft.net> | ```diff
diff --git a/arch/sparc64/kernel/setup.c b/arch/sparc64/kernel/setup.c
index 55db632999fc..dc928e49e341 100644
--- a/arch/sparc64/kernel/setup.c
+++ b/arch/sparc64/kernel/setup.c
@@ -454,7 +454,7 @@ static int show_cpuinfo(struct seq_file *m, void *__unused)
ncpus_probed,
num_online_cpus(),
dc... |
f3c681c028846bd5d39f563909409832a295ca69 | Analyze and fix the following issue in the Linux kernel code: [SERIAL]: Fix console write locking in sparc drivers. | Problem Details:
Mirror the logic in 8250 for proper console write locking
when SYSRQ is triggered or an OOPS is in progress.
Signed-off-by: David S. Miller <davem@davemloft.net> | ```diff
diff --git a/drivers/serial/sunhv.c b/drivers/serial/sunhv.c
index 96557e6dba60..17bcca53d6a1 100644
--- a/drivers/serial/sunhv.c
+++ b/drivers/serial/sunhv.c
@@ -440,8 +440,16 @@ static void sunhv_console_write_paged(struct console *con, const char *s, unsign
{
struct uart_port *port = sunhv_port;
unsigne... |
b37d40d1759a383208ef47be8af94ebe59031691 | Analyze and fix the following issue in the Linux kernel code: [SPARC64]: Fix leak when DR added cpu does not bootup. | Problem Details:
Signed-off-by: David S. Miller <davem@davemloft.net> | ```diff
diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c
index 69a1183c622d..6956845b03fa 100644
--- a/arch/sparc64/kernel/smp.c
+++ b/arch/sparc64/kernel/smp.c
@@ -90,7 +90,6 @@ static volatile unsigned long callin_flag = 0;
void __devinit smp_callin(void)
{
int cpuid = hard_smp_processor_id();
-... |
27a2ef382c7935a4dd02bff9fd361ce118df98c6 | Analyze and fix the following issue in the Linux kernel code: [SPARC64]: SMP build fixes. | Problem Details:
With the move of ldom_startcpu_cpuid() into smp.c some other
things need to follow along:
1) smp.c is not a driver so we can't use "PFX" macro in the
printk calls.
2) smp.c now needs asm/io.h and asm/hvtramp.h, ds.c no longer
does
3) kimage_addr_to_ra() also needs to move into smp.c
While we'... | ```diff
diff --git a/arch/sparc64/kernel/ds.c b/arch/sparc64/kernel/ds.c
index 2e4114fba142..0cb96dc399b7 100644
--- a/arch/sparc64/kernel/ds.c
+++ b/arch/sparc64/kernel/ds.c
@@ -20,8 +20,6 @@
#include <asm/power.h>
#include <asm/mdesc.h>
#include <asm/head.h>
-#include <asm/io.h>
-#include <asm/hvtramp.h>
#defin... |
b14f5c100ce4c63e4c5a71ab47e71cf4a1caa9e3 | Analyze and fix the following issue in the Linux kernel code: [SPARC64]: Fix build regressions added by dr-cpu changes. | Problem Details:
Do not select HOTPLUG_CPU from SUN_LDOMS, that causes
HOTPLUG_CPU to be selected even on non-SMP which is
illegal.
Only build hvtramp.o when SMP, just like trampoline.o
Protect dr-cpu code in ds.c with HOTPLUG_CPU.
Likewise move ldom_startcpu_cpuid() to smp.c and protect
it and the call site with SU... | ```diff
diff --git a/arch/sparc64/Kconfig b/arch/sparc64/Kconfig
index 3c2e3397caf8..b84b6af1241e 100644
--- a/arch/sparc64/Kconfig
+++ b/arch/sparc64/Kconfig
@@ -316,7 +316,6 @@ config SUN_IO
config SUN_LDOMS
bool "Sun Logical Domains support"
- select HOTPLUG_CPU
help
Say Y here is you want to support virt... |
b3e13fbeb9ac1eb8e7b0791bf56e1775c692972b | Analyze and fix the following issue in the Linux kernel code: [SPARC64]: Fix setting of variables in LDOM guest. | Problem Details:
There is a special domain services capability for setting
variables in the OBP options node. Guests don't have permanent
store for the OBP variables like a normal system, so they are
instead maintained in the LDOM control node or in the SC.
Signed-off-by: David S. Miller <davem@davemloft.net> | ```diff
diff --git a/arch/sparc64/kernel/ds.c b/arch/sparc64/kernel/ds.c
index 9c8839d1cffd..4e20ef232c51 100644
--- a/arch/sparc64/kernel/ds.c
+++ b/arch/sparc64/kernel/ds.c
@@ -11,6 +11,7 @@
#include <linux/slab.h>
#include <linux/sched.h>
#include <linux/delay.h>
+#include <linux/mutex.h>
#include <asm/ldc.h>
... |
83292e0a9c3f1c326b28fbf8cb70a8ce81a98163 | Analyze and fix the following issue in the Linux kernel code: [SPARC64]: Fix MD property lifetime bugs. | Problem Details:
Property values cannot be referenced outside of
mdesc_grab()/mdesc_release() pairs. The only major
offender was the VIO bus layer, easily fixed.
Add some commentary to mdesc.h describing these rules.
Signed-off-by: David S. Miller <davem@davemloft.net> | ```diff
diff --git a/arch/sparc64/kernel/vio.c b/arch/sparc64/kernel/vio.c
index 64f082555bcd..8b269aabff07 100644
--- a/arch/sparc64/kernel/vio.c
+++ b/arch/sparc64/kernel/vio.c
@@ -44,12 +44,11 @@ static const struct vio_device_id *vio_match_device(
while (matches->type[0] || matches->compat[0]) {
int match = ... |
133f09a169f3022be3de671b29658b7ecb375022 | Analyze and fix the following issue in the Linux kernel code: [SPARC64]: Use more mearningful names for IRQ registry. | Problem Details:
All of the interrupts say "LDX RX" and "LDX TX" currently
which is next to useless. Put a device specific prefix
before "RX" and "TX" instead which makes it much more
useful.
Signed-off-by: David S. Miller <davem@davemloft.net> | ```diff
diff --git a/arch/sparc64/kernel/ds.c b/arch/sparc64/kernel/ds.c
index 22517dfd021d..c7ece8c52039 100644
--- a/arch/sparc64/kernel/ds.c
+++ b/arch/sparc64/kernel/ds.c
@@ -598,7 +598,7 @@ static int __devinit ds_probe(struct vio_dev *vdev,
}
dp->lp = lp;
- err = ldc_bind(lp);
+ err = ldc_bind(lp, "DS");
... |
cb4812358423e7ea47d2b6471918d65238452cc5 | Analyze and fix the following issue in the Linux kernel code: [SPARC64]: Assorted LDC bug cures. | Problem Details:
1) LDC_MODE_RELIABLE is deprecated an unused by anything, plus
it and LDC_MODE_STREAM were mis-numbered.
2) read_stream() should try to read as much as possible into
the per-LDC stream buffer area, so do not trim the read_nonraw()
length by the caller's size parameter.
3) Send data ACKs when... | ```diff
diff --git a/arch/sparc64/kernel/ldc.c b/arch/sparc64/kernel/ldc.c
index 0fa04d6f978d..4cba28685967 100644
--- a/arch/sparc64/kernel/ldc.c
+++ b/arch/sparc64/kernel/ldc.c
@@ -239,8 +239,7 @@ static struct ldc_packet *handshake_get_tx_packet(struct ldc_channel *lp,
*/
static unsigned long head_for_data(struct... |
5a606b72a4309a656cd1a19ad137dc5557c4b8ea | Analyze and fix the following issue in the Linux kernel code: [SPARC64]: Do not ACK an INO if it is disabled or inprogress. | Problem Details:
This is also a partial workaround for a bug in the LDOM firmware which
double-transmits RX inos during high load. Without this, such an
event causes the kernel to loop forever in the interrupt call chain
ACK'ing but never actually running the IRQ handler (and thus clearing
the interrupt condition in t... | ```diff
diff --git a/arch/sparc64/kernel/irq.c b/arch/sparc64/kernel/irq.c
index 6b6165d36fd8..634194e7d2d6 100644
--- a/arch/sparc64/kernel/irq.c
+++ b/arch/sparc64/kernel/irq.c
@@ -309,6 +309,10 @@ static void sun4u_irq_disable(unsigned int virt_irq)
static void sun4u_irq_end(unsigned int virt_irq)
{
struct irq_h... |
6031a61c2ef4cf22b69ef5494aefa54b84a27d2f | Analyze and fix the following issue in the Linux kernel code: KVM: SVM: Reliably detect if SVM was disabled by BIOS | Problem Details:
This patch adds an implementation to the svm is_disabled function to
detect reliably if the BIOS disabled the SVM feature in the CPU. This
fixes the issues with kernel panics when loading the kvm-amd module on
machines where SVM is available but disabled.
Signed-off-by: Joerg Roedel <joerg.roedel@amd.... | ```diff
diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c
index 62ec38c7027b..a0d442883e17 100644
--- a/drivers/kvm/svm.c
+++ b/drivers/kvm/svm.c
@@ -1735,6 +1735,12 @@ static void svm_inject_page_fault(struct kvm_vcpu *vcpu,
static int is_disabled(void)
{
+ u64 vm_cr;
+
+ rdmsrl(MSR_VM_CR, vm_cr);
+ if (vm_cr & (... |
88a97f0b2fe1cd08d06390dc2669b709ea96e11a | Analyze and fix the following issue in the Linux kernel code: KVM: MMU: Fix Wrong tlb flush order | Problem Details:
Need to flush the tlb after updating a pte, not before.
Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com> | ```diff
diff --git a/drivers/kvm/mmu.c b/drivers/kvm/mmu.c
index ad50cfda5ac1..49ffbd3da749 100644
--- a/drivers/kvm/mmu.c
+++ b/drivers/kvm/mmu.c
@@ -441,8 +441,8 @@ static void rmap_write_protect(struct kvm_vcpu *vcpu, u64 gfn)
BUG_ON(!(*spte & PT_WRITABLE_MASK));
rmap_printk("rmap_write_protect: spte %p %llx\n... |
02c03a326a5df825cc01de426f72e160db2b9538 | Analyze and fix the following issue in the Linux kernel code: KVM: Fix x86 emulator writeback | Problem Details:
When the old value and new one are the same the emulator skips the
write; this is undesirable when the destination is a MMIO area and the
write shall be performed regardless of the previous value. This
optimization breaks e.g. a Linux guest APIC compiled without
X86_GOOD_APIC.
Remove the check and per... | ```diff
diff --git a/drivers/kvm/x86_emulate.c b/drivers/kvm/x86_emulate.c
index 92620e48f06d..f60012d62610 100644
--- a/drivers/kvm/x86_emulate.c
+++ b/drivers/kvm/x86_emulate.c
@@ -485,6 +485,7 @@ x86_emulate_memop(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops)
int mode = ctxt->mode;
unsigned long mo... |
ff1dc7942ba8fa4a86619bcb37ed68afae1f69ca | Analyze and fix the following issue in the Linux kernel code: KVM: VMX: Fix interrupt checking on lightweight exit | Problem Details:
With kernel-injected interrupts, we need to check for interrupts on
lightweight exits too.
Signed-off-by: Gregory Haskins <ghaskins@novell.com>
Signed-off-by: Avi Kivity <avi@qumranet.com> | ```diff
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c
index d06c3627f640..b47ddccc7d7a 100644
--- a/drivers/kvm/vmx.c
+++ b/drivers/kvm/vmx.c
@@ -1992,13 +1992,13 @@ static int vmx_vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
int r;
preempted:
- if (!vcpu->mmio_read_completed)
- do_interrupt_requ... |
120e9a453b5e7d9a708caff7d97b71fc4ccd59e8 | Analyze and fix the following issue in the Linux kernel code: KVM: Fix adding an smp virtual machine to the vm list | Problem Details:
If we add the vm once per vcpu, we corrupt the list if the guest has
multiple vcpus.
Signed-off-by: Avi Kivity <avi@qumranet.com> | ```diff
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
index 3ff8ee56279c..230b25aa469c 100644
--- a/drivers/kvm/kvm_main.c
+++ b/drivers/kvm/kvm_main.c
@@ -319,6 +319,9 @@ static struct kvm *kvm_create_vm(void)
spin_lock_init(&kvm->lock);
INIT_LIST_HEAD(&kvm->active_mmu_pages);
+ spin_lock(&kvm_loc... |
7b53aa56508479507c6e5667bb252ca7c2cd19cf | Analyze and fix the following issue in the Linux kernel code: KVM: Fix vcpu freeing for guest smp | Problem Details:
A vcpu can pin up to four mmu shadow pages, which means the freeing
loop will never terminate. Fix by first unpinning shadow pages on
all vcpus, then freeing shadow pages.
Signed-off-by: Avi Kivity <avi@qumranet.com> | ```diff
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
index 3c3231d8dabf..3ff8ee56279c 100644
--- a/drivers/kvm/kvm_main.c
+++ b/drivers/kvm/kvm_main.c
@@ -381,6 +381,16 @@ static void free_pio_guest_pages(struct kvm_vcpu *vcpu)
}
}
+static void kvm_unload_vcpu_mmu(struct kvm_vcpu *vcpu)
+{
+ if (!... |
06ff0d37285094cf9cc25370e6a78ce9bc70ddb0 | Analyze and fix the following issue in the Linux kernel code: KVM: Fix includes | Problem Details:
KVM compilation fails for some .configs. This fixes it.
Signed-off-by: Markus Rechberger <markus.rechberger@amd.com>
Signed-off-by: Avi Kivity <avi@qumranet.com> | ```diff
diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h
index db2bc6f168cd..90001b5a0253 100644
--- a/drivers/kvm/kvm.h
+++ b/drivers/kvm/kvm.h
@@ -10,6 +10,8 @@
#include <linux/list.h>
#include <linux/mutex.h>
#include <linux/spinlock.h>
+#include <linux/signal.h>
+#include <linux/sched.h>
#include <linux/mm.h>... |
2cc51560aed0edb291341089d3475e1fbe8bfd04 | Analyze and fix the following issue in the Linux kernel code: KVM: VMX: Avoid saving and restoring msr_efer on lightweight vmexit | Problem Details:
MSR_EFER.LME/LMA bits are automatically save/restored by VMX
hardware, KVM only needs to save NX/SCE bits at time of heavy
weight VM Exit. But clearing NX bits in host envirnment may
cause system hang if the host page table is using EXB bits,
thus we leave NX bits as it is. If Host NX=1 and guest NX=0,... | ```diff
diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h
index c252efed49d9..db2bc6f168cd 100644
--- a/drivers/kvm/kvm.h
+++ b/drivers/kvm/kvm.h
@@ -255,6 +255,7 @@ struct kvm_stat {
u32 request_irq_exits;
u32 irq_exits;
u32 light_exits;
+ u32 efer_reload;
};
struct kvm_vcpu {
@@ -289,6 +290,7 @@ struct kvm... |
a75beee6e4f5d2f0ae6e28cd626b2f157e93afd2 | Analyze and fix the following issue in the Linux kernel code: KVM: VMX: Avoid saving and restoring msrs on lightweight vmexit | Problem Details:
In a lightweight exit (where we exit and reenter the guest without
scheduling or exiting to userspace in between), we don't need various
msrs on the host, and avoiding shuffling them around reduces raw exit
time by 8%.
i386 compile fix by Daniel Hecken <dh@bahntechnik.de>.
Signed-off-by: Yaozu (Eddie... | ```diff
diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h
index fc4a6c1235f0..c252efed49d9 100644
--- a/drivers/kvm/kvm.h
+++ b/drivers/kvm/kvm.h
@@ -288,6 +288,10 @@ struct kvm_vcpu {
u64 apic_base;
u64 ia32_misc_enable_msr;
int nmsrs;
+ int save_nmsrs;
+#ifdef CONFIG_X86_64
+ int msr_offset_kernel_gs_base;
+#e... |
b3f37707b05e9ce82d5bec660e9d0b15452ee9a0 | Analyze and fix the following issue in the Linux kernel code: KVM: VMX: Handle #SS faults from real mode | Problem Details:
Instructions with address size override prefix opcode 0x67
Cause the #SS fault with 0 error code in VM86 mode. Forward
them to the emulator.
Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com> | ```diff
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c
index c4c553588a20..a05bfa085877 100644
--- a/drivers/kvm/vmx.c
+++ b/drivers/kvm/vmx.c
@@ -1488,7 +1488,11 @@ static int handle_rmode_exception(struct kvm_vcpu *vcpu,
if (!vcpu->rmode.active)
return 0;
- if (vec == GP_VECTOR && err_code == 0)
+ /*
+ * ... |
cd0536d7cb4d5d5c5aa37ccd3edd71c4b0524add | Analyze and fix the following issue in the Linux kernel code: KVM: Fix vmx I/O bitmap initialization on highmem systems | Problem Details:
kunmap() expects a struct page, not a virtual address. Fixes an oops loading
kvm-intel.ko on i386 with CONFIG_HIGHMEM.
Thanks to Michael Ivanov <deruhu@peterstar.ru> for reporting.
Signed-off-by: Avi Kivity <avi@qumranet.com> | ```diff
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c
index e39ebe0b6958..34171d9008ff 100644
--- a/drivers/kvm/vmx.c
+++ b/drivers/kvm/vmx.c
@@ -2274,11 +2274,11 @@ static int __init vmx_init(void)
iova = kmap(vmx_io_bitmap_a);
memset(iova, 0xff, PAGE_SIZE);
clear_bit(0x80, iova);
- kunmap(iova);
+ kunmap(v... |
653e3108b7d6097d25089d25ab4e99bc58b28962 | Analyze and fix the following issue in the Linux kernel code: KVM: Avoid corrupting tr in real mode | Problem Details:
The real mode tr needs to be set to a specific tss so that I/O
instructions can function. Divert the new tr values to the real
mode save area from where they will be restored on transition to
protected mode.
This fixes some crashes on reboot when the bios accesses an I/O
instruction.
Signed-off-by: ... | ```diff
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c
index b353eaa0a441..e39ebe0b6958 100644
--- a/drivers/kvm/vmx.c
+++ b/drivers/kvm/vmx.c
@@ -1042,23 +1042,11 @@ static void vmx_get_segment(struct kvm_vcpu *vcpu,
var->unusable = (ar >> 16) & 1;
}
-static void vmx_set_segment(struct kvm_vcpu *vcpu,
- ... |
eff708bc2bacd4f22cf844871341bef341bd096a | Analyze and fix the following issue in the Linux kernel code: KVM: VMX: Only reload guest msrs if they are already loaded | Problem Details:
If we set an msr via an ioctl() instead of by handling a guest exit, we
have the host state loaded, so reloading the msrs would clobber host
state instead of guest state.
This fixes a host oops (and loss of a cpu) on a guest reboot.
Signed-off-by: Avi Kivity <avi@qumranet.com> | ```diff
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c
index 096cb6a1e899..b353eaa0a441 100644
--- a/drivers/kvm/vmx.c
+++ b/drivers/kvm/vmx.c
@@ -600,7 +600,8 @@ static int vmx_set_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 data)
msr = find_msr_entry(vcpu, msr_index);
if (msr)
msr->data = data;
- loa... |
33ed6329210f3ad0638306bfa46cd3aaf5a5f929 | Analyze and fix the following issue in the Linux kernel code: KVM: Fix potential guest state leak into host | Problem Details:
The lightweight vmexit path avoids saving and reloading certain host
state. However in certain cases lightweight vmexit handling can schedule()
which requires reloading the host state.
So we store the host state in the vcpu structure, and reloaded it if we
relinquish the vcpu.
Signed-off-by: Avi Kiv... | ```diff
diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h
index f6ee18928722..bb32383ddfff 100644
--- a/drivers/kvm/kvm.h
+++ b/drivers/kvm/kvm.h
@@ -306,6 +306,11 @@ struct kvm_vcpu {
char *guest_fx_image;
int fpu_active;
int guest_fpu_loaded;
+ struct vmx_host_state {
+ int loaded;
+ u16 fs_sel, gs_sel, ldt_... |
621358455ae043ab39bc3481f13b101bd6016c8d | Analyze and fix the following issue in the Linux kernel code: KVM: Be more careful restoring fs on lightweight vmexit | Problem Details:
i386 wants fs for accessing the pda even on a lightweight exit, so ensure
we can always restore it. This fixes a regression on i386 introduced by
the lightweight vmexit patch.
Signed-off-by: Avi Kivity <avi@qumranet.com> | ```diff
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c
index 9ebb18d07bde..49cadd31120b 100644
--- a/drivers/kvm/vmx.c
+++ b/drivers/kvm/vmx.c
@@ -1832,16 +1832,21 @@ preempted:
* Set host fs and gs selectors. Unfortunately, 22.2.3 does not
* allow segment selectors with cpl > 0 or ti == 1.
*/
- fs_sel = ... |
a25f7e1f8c1ff68213a63dada9d5e32dc1a0f587 | Analyze and fix the following issue in the Linux kernel code: KVM: Reduce misfirings of the fork detector | Problem Details:
The kvm mmu tries to detects forks by looking for repeated writes to a
page table. If it sees a fork, it unshadows the page table so the page
table copying can proceed at native speed instead of being emulated.
However, the detector also triggered on simple demand paging access patterns:
a linear wal... | ```diff
diff --git a/drivers/kvm/paging_tmpl.h b/drivers/kvm/paging_tmpl.h
index 73ffbffb1097..bc64cceec039 100644
--- a/drivers/kvm/paging_tmpl.h
+++ b/drivers/kvm/paging_tmpl.h
@@ -421,6 +421,7 @@ static int FNAME(page_fault)(struct kvm_vcpu *vcpu, gva_t addr,
pgprintk("%s: guest page fault\n", __FUNCTION__);
i... |
e6adf28365b2fca0b5235cabff00c9f3d1e7bdf4 | Analyze and fix the following issue in the Linux kernel code: KVM: Avoid saving and restoring some host CPU state on lightweight vmexit | Problem Details:
Many msrs and the like will only be used by the host if we schedule() or
return to userspace. Therefore, we avoid saving them if we handle the
exit within the kernel, and if a reschedule is not requested.
Based on a patch from Eddie Dong <eddie.dong@intel.com> with a couple of
fixes by me.
Signed-of... | ```diff
diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h
index 152312c1fafa..7facebd1911d 100644
--- a/drivers/kvm/kvm.h
+++ b/drivers/kvm/kvm.h
@@ -252,6 +252,7 @@ struct kvm_stat {
u32 halt_exits;
u32 request_irq_exits;
u32 irq_exits;
+ u32 light_exits;
};
struct kvm_vcpu {
diff --git a/drivers/kvm/kvm_ma... |
c86813393f8b8f9f738ab57d9837858ed850df4b | Analyze and fix the following issue in the Linux kernel code: KVM: SVM: Allow direct guest access to PC debug port | Problem Details:
The PC debug port is used for IO delay and does not require emulation.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Avi Kivity <avi@qumranet.com> | ```diff
diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c
index fa17d6d4f0cb..6cd6a50a0340 100644
--- a/drivers/kvm/svm.c
+++ b/drivers/kvm/svm.c
@@ -378,7 +378,7 @@ static __init int svm_hardware_setup(void)
int cpu;
struct page *iopm_pages;
struct page *msrpm_pages;
- void *msrpm_va;
+ void *iopm_va, *msrpm_va... |
8ea02606681beb41568c62ba060bdf51fc9ba14e | Analyze and fix the following issue in the Linux kernel code: [PATCH] sched: fix up fs/proc/array.c whitespace problems | Problem Details:
while changing task_stime() i noticed a whitespace style problem in
array.c - fix it. While at it, fix all the other style problems too,
most of them in the scheduler-stats related portions of array.c.
There is no change in functionality:
text data bss dec hex filename
4356 ... | ```diff
diff --git a/fs/proc/array.c b/fs/proc/array.c
index c6977796fafd..4cb81776a7ff 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -62,6 +62,8 @@
#include <linux/mman.h>
#include <linux/proc_fs.h>
#include <linux/ioport.h>
+#include <linux/uaccess.h>
+#include <linux/io.h>
#include <linux/mm.h>
#include... |
efba1a31f3f8fe9672eb96cd26e97fb96891f1c0 | Analyze and fix the following issue in the Linux kernel code: bsg: fix the deadlock on discarding done commands | Problem Details:
The previous commit introduced a deadlock in discarding commands,
because we forget to unlock the bd spinlock.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com> | ```diff
diff --git a/block/bsg.c b/block/bsg.c
index 2f78d7d34b9d..5f4abc902a00 100644
--- a/block/bsg.c
+++ b/block/bsg.c
@@ -471,6 +471,7 @@ static int bsg_complete_all_commands(struct bsg_device *bd)
spin_unlock_irq(&bd->lock);
break;
}
+ spin_unlock_irq(&bd->lock);
bc = bsg_get_done_cmd(bd);
if ... |
e7d72173248c29c6f9ba14e40374266e1b954964 | Analyze and fix the following issue in the Linux kernel code: bsg: fix a blocking read bug | Problem Details:
This patch fixes a bug that read() returns ENODATA even with a
blocking file descriptor when there are no commands pending.
This also includes some cleanups.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com> | ```diff
diff --git a/block/bsg.c b/block/bsg.c
index a333c9337093..2f78d7d34b9d 100644
--- a/block/bsg.c
+++ b/block/bsg.c
@@ -115,9 +115,9 @@ static void bsg_free_command(struct bsg_command *bc)
wake_up(&bd->wq_free);
}
-static struct bsg_command *__bsg_alloc_command(struct bsg_device *bd)
+static struct bsg_comm... |
4cf0723ac89b5f2189da2ad07ef875de26b83c77 | Analyze and fix the following issue in the Linux kernel code: bsg: minor bug fixes | Problem Details:
This fixes the following minor issues:
- add EXPORT_SYMBOL_GPL for bsg_register_queue and
bsg_unregister_queue.
- shut up gcc warnings
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Jens Axboe <axboe@nelson.home.kernel.dk> | ```diff
diff --git a/block/bsg.c b/block/bsg.c
index 4ef3cc550244..a333c9337093 100644
--- a/block/bsg.c
+++ b/block/bsg.c
@@ -961,8 +961,9 @@ void bsg_unregister_queue(struct request_queue *q)
bsg_device_nr--;
mutex_unlock(&bsg_mutex);
}
+EXPORT_SYMBOL_GPL(bsg_unregister_queue);
-int bsg_register_queue(struct r... |
fa9133c24c4115523c1381b67fdd74fd864ac0ea | Analyze and fix the following issue in the Linux kernel code: backlight: Fix order of Kconfig entries | Problem Details:
Switch the order of LCD_CLASS_DEVICE and BACKLIGHT_CLASS_DEVICE,
so that it's possible to insert LCD devices without borking the
dependency displays of xconfig and other config tools.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Richard Purdie <rpurdie@rpsys.net> | ```diff
diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig
index fbef663fc057..2580f5fa2486 100644
--- a/drivers/video/backlight/Kconfig
+++ b/drivers/video/backlight/Kconfig
@@ -8,26 +8,32 @@ menuconfig BACKLIGHT_LCD_SUPPORT
Enable this to be able to choose the drivers for controlling t... |
3593a6d64d774efb9d7ec80947607401ee6731c0 | Analyze and fix the following issue in the Linux kernel code: leds: Fix trigger unregister_simple if register_simple fails | Problem Details:
Fix led_trigger_unregister_simple to handle the case where
led_trigger_register_simple fails, avoiding a NULL pointer
dereference.
Signed-off-by: Richard Purdie <rpurdie@rpsys.net> | ```diff
diff --git a/drivers/leds/led-triggers.c b/drivers/leds/led-triggers.c
index 454fb0901f82..129733f2379b 100644
--- a/drivers/leds/led-triggers.c
+++ b/drivers/leds/led-triggers.c
@@ -215,7 +215,8 @@ void led_trigger_unregister(struct led_trigger *trigger)
void led_trigger_unregister_simple(struct led_trigger... |
4381ca3c23b07ba5b567f72325003020ddca0341 | Analyze and fix the following issue in the Linux kernel code: fix return type of skb_checksum_complete() | Problem Details:
It returns __sum16, not unsigned int
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ```diff
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 9391e4a4c344..ce256438e619 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -1639,7 +1639,7 @@ static inline int skb_csum_unnecessary(const struct sk_buff *skb)
* if skb->ip_summed is CHECKSUM_UNNECESSARY which indicates tha... |
7c9e3c2e3b0437d10a09b77769baf325b94aa436 | Analyze and fix the following issue in the Linux kernel code: wrong order of arguments of ->readdir() | Problem Details:
Shows how many people are testing coda - the bug had been there for 5 years
and results of stepping on it are not subtle.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ```diff
diff --git a/fs/coda/dir.c b/fs/coda/dir.c
index 9ddf5ed62162..898a86dde8f5 100644
--- a/fs/coda/dir.c
+++ b/fs/coda/dir.c
@@ -470,7 +470,7 @@ int coda_readdir(struct file *coda_file, void *dirent, filldir_t filldir)
ret = -ENOENT;
if (!IS_DEADDIR(host_inode)) {
- ret = host_file->f_op->readdir(host_f... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.