id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
4bc091d85f979a1a18ef2d710b819b3c5b397707
Analyze and fix the following issue in the Linux kernel code: ixgbe: fix build error with FCOE_CONFIG without DCB_CONFIG
Problem Details: Building ixgbe without DCB_CONFIG and FCOE_CONFIG will cause a build error. This resolves the build error by wrapping the fcoe.up in CONFIG_IXGBE_DCB ifdefs. Also frames were being priority VLAN tagged even without DCB enabled. This fixes this so that 8021Q priority tags are only added with DCB actu...
```diff diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index 7d6a415bcf88..55394a2d3a8f 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c @@ -6155,9 +6155,11 @@ static u16 ixgbe_select_queue(struct net_device *dev, struct sk_buff *skb) txq &= (adapter->ri...
560afa7d85bdfb294506afd3032c315e6827824f
Analyze and fix the following issue in the Linux kernel code: V4L/DVB: tvp7002: fix write to H-PLL Feedback Divider LSB register
Problem Details: H-PLL Feedback Divider LSB register is an 8 bit register out of which the first 4 bits are reserved. Current code is writing to these reserved location. This patch corrects this issue by left shifting the values being written to the register by 4. This patch has been tested on DM6467 EVM with 720P-60 ...
```diff diff --git a/drivers/media/video/tvp7002.c b/drivers/media/video/tvp7002.c index 8085ac392446..48f5c76ab521 100644 --- a/drivers/media/video/tvp7002.c +++ b/drivers/media/video/tvp7002.c @@ -179,7 +179,7 @@ static const struct i2c_reg_value tvp7002_init_default[] = { /* Register parameters for 480P */ static ...
d0a38ce27e1b11116f02835b076fcb79db987e2c
Analyze and fix the following issue in the Linux kernel code: V4L/DVB: dvb: siano: free spinlock before schedule()
Problem Details: Calling schedule() holding spinlock with disables irqs is improper. As spinlock protects list coredev->buffers, it can be unlocked untill wakeup. This bug was introduced in a9349315f65cd6a16e8fab1f6cf0fd40f379c4db. Signed-off-by: Kulikov Vasiliy <segooon@gmail.com> Signed-off-by: Mauro Carvalho Chehab...
```diff diff --git a/drivers/media/dvb/siano/smscoreapi.c b/drivers/media/dvb/siano/smscoreapi.c index 7f2c94a15ab1..d93468cd3a85 100644 --- a/drivers/media/dvb/siano/smscoreapi.c +++ b/drivers/media/dvb/siano/smscoreapi.c @@ -1113,9 +1113,11 @@ struct smscore_buffer_t *smscore_getbuffer(struct smscore_device_t *corede...
ede67a30f549e1872be57e7d6f5f9dd97bb372ae
Analyze and fix the following issue in the Linux kernel code: V4L/DVB: media: ir-keytable: null dereference in debug code
Problem Details: "ir_dev->props" can be NULL. We only use raw mode if "ir_dev->props" is non-NULL and "ir_dev->props->driver_type == RC_DRIVER_IR_RAW". Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/IR/ir-keytable.c b/drivers/media/IR/ir-keytable.c index 7032ea047f8a..7e82a9df726b 100644 --- a/drivers/media/IR/ir-keytable.c +++ b/drivers/media/IR/ir-keytable.c @@ -507,7 +507,8 @@ int __ir_input_register(struct input_dev *input_dev, IR_dprintk(1, "Registered input device on %s...
6dd5aff3cab284556952d96f1112b17299e126d8
Analyze and fix the following issue in the Linux kernel code: V4L/DVB: v4l2-ctrls: Whitespace cleanups
Problem Details: Fixes 37 checkpatch.pl warnings like: WARNING: please, no space before tabs +^Icase V4L2_CID_MPEG_VIDEO_PULLDOWN: ^Ireturn "Video Pulldown";$ Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/video/v4l2-ctrls.c b/drivers/media/video/v4l2-ctrls.c index 939243a47f78..84c1a53a727a 100644 --- a/drivers/media/video/v4l2-ctrls.c +++ b/drivers/media/video/v4l2-ctrls.c @@ -267,17 +267,17 @@ const char *v4l2_ctrl_get_name(u32 id) switch (id) { /* USER controls */ /* Keep the ...
03e30ca5f08e0f9c629204e537ff96b789e6e703
Analyze and fix the following issue in the Linux kernel code: V4L/DVB: v4l: s5p-fimc: Fix coding style issues
Problem Details: Signed-off-by: Pawel Osciak <p.osciak@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/video/s5p-fimc/fimc-core.c b/drivers/media/video/s5p-fimc/fimc-core.c index 6558a2ea9ffd..b151c7be8a50 100644 --- a/drivers/media/video/s5p-fimc/fimc-core.c +++ b/drivers/media/video/s5p-fimc/fimc-core.c @@ -303,7 +303,9 @@ static int fimc_prepare_addr(struct fimc_ctx *ctx, u32 pix_...
cd9ebdbc0541b4e8ee145c81642d68332f79b932
Analyze and fix the following issue in the Linux kernel code: V4L/DVB: mx2_camera: fix for list bufnum in frame_done_emma
Problem Details: The emma uses bufnum 1 and 0. This patch tells the bufqueue to change the next buffer to the next one and not the current one. Otherwise the BUG_ON above will trigger everytime. Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> S...
```diff diff --git a/drivers/media/video/mx2_camera.c b/drivers/media/video/mx2_camera.c index 026bef0ba403..8441ecac6b18 100644 --- a/drivers/media/video/mx2_camera.c +++ b/drivers/media/video/mx2_camera.c @@ -1201,7 +1201,7 @@ static void mx27_camera_frame_done_emma(struct mx2_camera_dev *pcdev, buf = list_entry(pc...
fe988f56c7c1bff52a4c26164ceb3dbd582de433
Analyze and fix the following issue in the Linux kernel code: V4L/DVB: gspca - main: Fix a crash in gspca_frame_add()
Problem Details: Some webcams as ov511 may find many times an end of image. In this case, with the last patch in image concatenation (commit 799b1bd41f398054d46fd35f73abd01c4009f6ca), the image pointer was NULL and the system crashed in memcpy(). Signed-off-by: Jean-François Moine <moinejf@free.fr> Signed-off-by: Maur...
```diff diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c index 0004469691cc..b9846106913e 100644 --- a/drivers/media/video/gspca/gspca.c +++ b/drivers/media/video/gspca/gspca.c @@ -440,10 +440,15 @@ void gspca_frame_add(struct gspca_dev *gspca_dev, frame->v4l2_buf.sequence = ++gspca...
b378f43fe9466e7712a8b16be64795ffca3a937e
Analyze and fix the following issue in the Linux kernel code: V4L/DVB: IR: Allow not to compile keymaps in
Problem Details: Currently, ir device registration fails if keymap requested by driver is not found. Fix that by always compiling in the empty keymap, and using it as a failback. Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com> Acked-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mche...
```diff diff --git a/drivers/media/IR/ir-core-priv.h b/drivers/media/IR/ir-core-priv.h index 502d477b391c..be6817261c8f 100644 --- a/drivers/media/IR/ir-core-priv.h +++ b/drivers/media/IR/ir-core-priv.h @@ -126,7 +126,8 @@ int ir_raw_handler_register(struct ir_raw_handler *ir_raw_handler); void ir_raw_handler_unregist...
e31f41278f0bed38ee16b55d09b49bed2f1b2085
Analyze and fix the following issue in the Linux kernel code: V4L/DVB: IR: nec decoder: fix repeat
Problem Details: Repeat space is 4 units, not 8. Current code would never trigger a repeat. However that isn't true for NECX, so repeat there must be handled differently. Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com> Reviewed-by: Andy Walls <awalls@md.metrocast.net> Signed-off-by: Mauro Carvalho Chehab <mch...
```diff diff --git a/drivers/media/IR/ir-nec-decoder.c b/drivers/media/IR/ir-nec-decoder.c index 52e0f378ae3d..1c0cf0300d2d 100644 --- a/drivers/media/IR/ir-nec-decoder.c +++ b/drivers/media/IR/ir-nec-decoder.c @@ -20,7 +20,7 @@ #define NEC_HEADER_PULSE (16 * NEC_UNIT) #define NECX_HEADER_PULSE (8 * NEC_UNIT) /* Les...
45a568fa6f6bf8e5b9c32e52292f297e8473a985
Analyze and fix the following issue in the Linux kernel code: V4L/DVB: IR: replace spinlock with mutex
Problem Details: Some handlers (lirc for example) allocates memory on initialization, doing so in atomic context is cumbersome. Fixes warning about sleeping function in atomic context. Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/IR/ir-raw-event.c b/drivers/media/IR/ir-raw-event.c index 51f65daa086b..9d5c029cfc0c 100644 --- a/drivers/media/IR/ir-raw-event.c +++ b/drivers/media/IR/ir-raw-event.c @@ -13,7 +13,7 @@ */ #include <linux/workqueue.h> -#include <linux/spinlock.h> +#include <linux/mutex.h> #inclu...
510fcb70ff375b0cec6638fcfafdf36233690bfc
Analyze and fix the following issue in the Linux kernel code: V4L/DVB: IR: minor fixes
Problem Details: * lirc: Don't propagate reset event to userspace * lirc: Remove strange logic from lirc that would make first sample always be pulse * Make TO_US macro actualy print what it should. Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/IR/ir-core-priv.h b/drivers/media/IR/ir-core-priv.h index babd52061bc3..dc26e2beeefb 100644 --- a/drivers/media/IR/ir-core-priv.h +++ b/drivers/media/IR/ir-core-priv.h @@ -76,7 +76,6 @@ struct ir_raw_event_ctrl { struct lirc_codec { struct ir_input_dev *ir_dev; struct lirc_dri...
ade321c5b8a0e4d40c0f3b73bf0d2579850028d0
Analyze and fix the following issue in the Linux kernel code: V4L/DVB: IR: Kconfig fixes
Problem Details: Move IR drives below separate menu. This allows to disable them. Also correct a typo. Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/IR/Kconfig b/drivers/media/IR/Kconfig index 4094490106a6..9e8f82d85cb3 100644 --- a/drivers/media/IR/Kconfig +++ b/drivers/media/IR/Kconfig @@ -1,8 +1,10 @@ -config IR_CORE - tristate +menuconfig IR_CORE + tristate "Infrared remote controller adapters" depends on INPUT default INP...
82ce67bf262b3f47ecb5a0ca31cace8ac72b7c98
Analyze and fix the following issue in the Linux kernel code: V4L/DVB: staging/lirc: fix non-CONFIG_MODULES build horkage
Problem Details: Fix when CONFIG_MODULES is not enabled: drivers/staging/lirc/lirc_parallel.c:243: error: implicit declaration of function 'module_refcount' drivers/staging/lirc/lirc_it87.c:150: error: implicit declaration of function 'module_refcount' drivers/built-in.o: In function `it87_probe': lirc_it87.c:(.text+0...
```diff diff --git a/drivers/staging/lirc/lirc_it87.c b/drivers/staging/lirc/lirc_it87.c index 09f36961c6d2..ec11c0e949a0 100644 --- a/drivers/staging/lirc/lirc_it87.c +++ b/drivers/staging/lirc/lirc_it87.c @@ -109,6 +109,7 @@ static DECLARE_WAIT_QUEUE_HEAD(lirc_read_queue); static DEFINE_SPINLOCK(hardware_lock); s...
efce8ca3c5d8a35018f801d687396e1911cfc868
Analyze and fix the following issue in the Linux kernel code: V4L/DVB: staging/lirc: fix Kconfig dependencies
Problem Details: Signed-off-by: Janne Grunau <j@jannau.net> Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/staging/lirc/Kconfig b/drivers/staging/lirc/Kconfig index 968c2adee06b..ab30a098efcc 100644 --- a/drivers/staging/lirc/Kconfig +++ b/drivers/staging/lirc/Kconfig @@ -3,6 +3,7 @@ # menuconfig LIRC_STAGING bool "Linux Infrared Remote Control IR receiver/transmitter drivers" + depends on L...
7a9fcb41b9370a32bb65bece9afc83701ab2d2b6
Analyze and fix the following issue in the Linux kernel code: V4L/DVB: IR/mceusb: remove bad ir_input_dev use
Problem Details: The ir_input_dev gets filled in by __ir_input_register, the one allocated in mceusb_init_input_dev was being overwritten by the correct one shortly after it was initialized (ultimately resulting in a memory leak). This bug was inherited from imon.c, and was pointed out to me by Maxim Levitsky. v2: fix...
```diff diff --git a/drivers/media/IR/mceusb.c b/drivers/media/IR/mceusb.c index 78bf7f77a1a0..65b073878169 100644 --- a/drivers/media/IR/mceusb.c +++ b/drivers/media/IR/mceusb.c @@ -228,7 +228,6 @@ static struct usb_device_id std_tx_mask_list[] = { /* data structure for each usb transceiver */ struct mceusb_dev { ...
2560d94e330f35776e944b54256a526a19259429
Analyze and fix the following issue in the Linux kernel code: V4L/DVB: cx23885, cx25840: Report the actual length of an IR Rx timeout event
Problem Details: Instead of reporting an IR Rx timeout event as a ridiculously long space, report it as a space of the lenght of the timeout. This partially fixes operation with LIRC without breaking interoperation with the in kernel decoders. The gaps lengths reported to LIRC are still not real however. Signed-off-...
```diff diff --git a/drivers/media/video/cx23885/cx23885-input.c b/drivers/media/video/cx23885/cx23885-input.c index 3f924e21b957..252817acc35b 100644 --- a/drivers/media/video/cx23885/cx23885-input.c +++ b/drivers/media/video/cx23885/cx23885-input.c @@ -46,12 +46,6 @@ static void convert_measurement(u32 x, struct i...
a4cc14ec9f0ef579262a81170a2eaf760844c471
Analyze and fix the following issue in the Linux kernel code: xen-blkfront: fix missing out label
Problem Details: Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
```diff diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index ae5f92b5752e..67d9bfab59fa 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c @@ -1232,6 +1232,7 @@ static int blkif_release(struct gendisk *disk, fmode_t mode) kfree(info); } +out: unlock_kernel();...
2ed9aae0facd603f9f9b8347d1d7e9de23bde286
Analyze and fix the following issue in the Linux kernel code: memblock: Fix memblock_is_region_reserved() to return a boolean
Problem Details: All callers expect a boolean result which is true if the region overlaps a reserved region. However, the implementation actually returns -1 if there is no overlap, and a region index (0 based) if there is. Make it behave as callers (and common sense) expect. Signed-off-by: Benjamin Herrenschmidt <ben...
```diff diff --git a/mm/memblock.c b/mm/memblock.c index 3024eb30fc27..43840b305ecb 100644 --- a/mm/memblock.c +++ b/mm/memblock.c @@ -504,7 +504,7 @@ int __init memblock_is_reserved(u64 addr) int memblock_is_region_reserved(u64 base, u64 size) { - return memblock_overlaps_region(&memblock.reserved, base, size); + ...
66048c381bb1e3a7c6fc69c28721843d6ec11c8c
Analyze and fix the following issue in the Linux kernel code: Squashfs: fix checkpatch.pl warnings
Problem Details: Checkpatch.pl in 2.6.34 added a check for spaces between tabs. Signed-off-by: Phillip Lougher <phillip@lougher.demon.co.uk>
```diff diff --git a/fs/squashfs/squashfs_fs.h b/fs/squashfs/squashfs_fs.h index 8eabb808b78d..c5137fc9ab11 100644 --- a/fs/squashfs/squashfs_fs.h +++ b/fs/squashfs/squashfs_fs.h @@ -274,7 +274,7 @@ struct squashfs_base_inode { __le16 uid; __le16 guid; __le32 mtime; - __le32 inode_number; + __le32 inod...
145b64b9588c123d2bd00981c5ce8e03215ed2ee
Analyze and fix the following issue in the Linux kernel code: kmemleak: Fix typo in the comment
Problem Details: Fix typo in comment. Signed-off-by: Holger Hans Peter Freyther <zecke@selfish.org> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
```diff diff --git a/mm/kmemleak.c b/mm/kmemleak.c index 5f2eb5b23658..bd9bc214091b 100644 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c @@ -700,7 +700,7 @@ static void paint_ptr(unsigned long ptr, int color) } /* - * Make a object permanently as gray-colored so that it can no longer be + * Mark an object permanently as ...
1c250d709fdc8aa5bf42d90be99428a01a256a55
Analyze and fix the following issue in the Linux kernel code: perf, x86: P4 PMU -- update nmi irq statistics and unmask lvt entry properly
Problem Details: In case if last active performance counter is not overflowed at moment of NMI being triggered by another counter, the irq statistics may miss an update stage. As a more serious consequence -- apic quirk may not be triggered so apic lvt entry stay masked. Tested-by: Lin Ming <ming.m.lin@intel.com> Sign...
```diff diff --git a/arch/x86/kernel/cpu/perf_event_p4.c b/arch/x86/kernel/cpu/perf_event_p4.c index 107711bf0ee8..febb12cea795 100644 --- a/arch/x86/kernel/cpu/perf_event_p4.c +++ b/arch/x86/kernel/cpu/perf_event_p4.c @@ -656,6 +656,7 @@ static int p4_pmu_handle_irq(struct pt_regs *regs) cpuc = &__get_cpu_var(cpu_hw...
2663b3f23537618c0c286551b138353fe26b3df8
Analyze and fix the following issue in the Linux kernel code: ACPI, APEI, Fix a typo of error path of apei_resources_request
Problem Details: Fix a typo of error path of apei_resources_request. release_mem_region and release_region should be interchange. Signed-off-by: Huang Ying <ying.huang@intel.com> Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
```diff diff --git a/drivers/acpi/apei/apei-base.c b/drivers/acpi/apei/apei-base.c index 216e1e948ff6..73fd0c7487c1 100644 --- a/drivers/acpi/apei/apei-base.c +++ b/drivers/acpi/apei/apei-base.c @@ -482,14 +482,14 @@ err_unmap_ioport: list_for_each_entry(res, &resources->ioport, list) { if (res == res_bak) bre...
9a3725631331f279fa44b6522874ce8818bcc455
Analyze and fix the following issue in the Linux kernel code: watchdog: s3c2410_wdt - Fix removing of platform device
Problem Details: When removing the watchdog platform device, we need to disable the access to userspace first. It makes no sense to remove the drivers clock, irq's, ... and then disable userspace access. the order of removal has also been changed so that it is the reverse of probing (this way the clock is also disabled...
```diff diff --git a/drivers/watchdog/s3c2410_wdt.c b/drivers/watchdog/s3c2410_wdt.c index 300932580ded..ae53662c29bc 100644 --- a/drivers/watchdog/s3c2410_wdt.c +++ b/drivers/watchdog/s3c2410_wdt.c @@ -532,21 +532,22 @@ static int __devinit s3c2410wdt_probe(struct platform_device *pdev) static int __devexit s3c2410...
18edc8eaa68070771bdb2098260e44efe74de722
Analyze and fix the following issue in the Linux kernel code: blkdev: fix blkdev_issue_zeroout return value
Problem Details: - If function called without barrier option retvalue is incorrect Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
```diff diff --git a/block/blk-lib.c b/block/blk-lib.c index 5d793e143f3c..c1fc55a83ba1 100644 --- a/block/blk-lib.c +++ b/block/blk-lib.c @@ -145,7 +145,7 @@ static void bio_batch_end_io(struct bio *bio, int err) int blkdev_issue_zeroout(struct block_device *bdev, sector_t sector, sector_t nr_sects, gfp_t gfp_mas...
ffc18879903e55487bc5ac3c774b99a07de06029
Analyze and fix the following issue in the Linux kernel code: omfs: fix uninitialized variable warning
Problem Details: quiet the warning: fs/omfs/file.c: In function 'omfs_get_block': fs/omfs/file.c:225: warning: 'new_block' may be used uninitialized in this function new_block is used properly by the call to omfs_grow_extent() Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Bob Copeland <me@bobcopel...
```diff diff --git a/fs/omfs/file.c b/fs/omfs/file.c index 76bc21b91a8a..d821d468e5a2 100644 --- a/fs/omfs/file.c +++ b/fs/omfs/file.c @@ -222,7 +222,7 @@ static int omfs_get_block(struct inode *inode, sector_t block, struct buffer_head *bh; sector_t next, offset; int ret; - u64 new_block; + u64 uninitialized_var...
fbe0f8348fd6c3d016a3f48756eb729b41a67c22
Analyze and fix the following issue in the Linux kernel code: mmc_spi: Fix unterminated of_match_table
Problem Details: commit 2ffe8c5f323c3b9749bf7bc2375d909d20bdbb15 ("of: refactor of_modalias_node() and remove explicit match table"), introduced an unterminated of_match_table, which may cause kernel to oops. This patch fixes the issue by adding an empty device ID. Signed-off-by: Anton Vorontsov <avorontsov@mvista.co...
```diff diff --git a/drivers/mmc/host/mmc_spi.c b/drivers/mmc/host/mmc_spi.c index 7b0f3ef50f96..1145ea0792e6 100644 --- a/drivers/mmc/host/mmc_spi.c +++ b/drivers/mmc/host/mmc_spi.c @@ -1536,6 +1536,7 @@ static int __devexit mmc_spi_remove(struct spi_device *spi) #if defined(CONFIG_OF) static struct of_device_id mmc...
bb4f1e9d0e2ef93de8e36ca0f5f26625fcd70b7d
Analyze and fix the following issue in the Linux kernel code: md: fix another deadlock with removing sysfs attributes.
Problem Details: Move the deletion of sysfs attributes from reconfig_mutex to open_mutex didn't really help as a process can try to take open_mutex while holding reconfig_mutex, so the same deadlock can happen, just requiring one more process to be involved in the chain. I looks like I cannot easily use locking to wai...
```diff diff --git a/drivers/md/md.c b/drivers/md/md.c index 00c3fde39a12..03dcbfbe250f 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -580,13 +580,17 @@ static void mddev_unlock(mddev_t * mddev) * an access to the files will try to take reconfig_mutex * while holding the file unremovable, which leads to...
19e4875fb21a69fbf620e84769a74d189c69c58d
Analyze and fix the following issue in the Linux kernel code: of/sparc: fix build regression from of_device changes
Problem Details: Commit id 1636f8ac2b08410df4766449f7c86b912443cd99 (sparc/of: Move of_device fields into struct pdev_archdata) missed fixing up the n2_core.c and greth.c drivers. This patch makes the required changes. Reported-by: David S. Miller <davem@davemloft.net> Signed-off-by: Grant Likely <grant.likely@secret...
```diff diff --git a/drivers/crypto/n2_core.c b/drivers/crypto/n2_core.c index 931fdd471d6d..88ee01510ec0 100644 --- a/drivers/crypto/n2_core.c +++ b/drivers/crypto/n2_core.c @@ -1580,7 +1580,7 @@ static int find_devino_index(struct platform_device *dev, struct spu_mdesc_info if (!dev_intrs) return -ENODEV; - fo...
1f6ea6e511e5ec730d8e88651da1b7b6e8fd1333
Analyze and fix the following issue in the Linux kernel code: solos-pci: Fix race condition in tasklet RX handling
Problem Details: We were seeing faults in the solos-pci receive tasklet when packets arrived for a VCC which was currently being closed: [18842.727906] EIP: [<e082f490>] br2684_push+0x19/0x234 [br2684] SS:ESP 0068:dfb89d14 [18845.090712] [<c13ecff3>] ? do_page_fault+0x0/0x2e1 [18845.120042] [<e082f490>] ? br2684_pu...
```diff diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c index 6174965d9a4d..f916ddf63938 100644 --- a/drivers/atm/solos-pci.c +++ b/drivers/atm/solos-pci.c @@ -781,7 +781,8 @@ static struct atm_vcc *find_vcc(struct atm_dev *dev, short vpi, int vci) sk_for_each(s, node, head) { vcc = atm_sk(s); if...
eb4a5527b1f0d581ac217c80ef3278ed5e38693c
Analyze and fix the following issue in the Linux kernel code: pkt_sched: Fix sch_sfq vs tcf_bind_filter oops
Problem Details: Since there was added ->tcf_chain() method without ->bind_tcf() to sch_sfq class options, there is oops when a filter is added with the classid parameter. Fixes commit 7d2681a6ff4f9ab5e48d02550b4c6338f1638998 netdev thread: null pointer at cls_api.c Signed-off-by: Jarek Poplawski <jarkao2@gmail.com> ...
```diff diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c index e85352b5c88d..534f33231c17 100644 --- a/net/sched/sch_sfq.c +++ b/net/sched/sch_sfq.c @@ -513,6 +513,12 @@ static unsigned long sfq_get(struct Qdisc *sch, u32 classid) return 0; } +static unsigned long sfq_bind(struct Qdisc *sch, unsigned long pa...
ba78e2ddca844598c0efcbf2c76d73519a61b902
Analyze and fix the following issue in the Linux kernel code: tcp: no md5sig option size check bug
Problem Details: tcp_parse_md5sig_option doesn't check md5sig option (TCPOPT_MD5SIG) length, but tcp_v[46]_inbound_md5_hash assume that it's at least 16 bytes long. Signed-off-by: Dmitry Popov <dp@highloadlab.com> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 3c426cb318e7..e663b78a2ef6 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -3930,7 +3930,7 @@ u8 *tcp_parse_md5sig_option(struct tcphdr *th) if (opsize < 2 || opsize > length) return NULL; if (opcode == TCPOPT_MD5SIG) - ...
df44f9f4f9b5d362b5a2d1c8444fe7e6d4c42653
Analyze and fix the following issue in the Linux kernel code: AFS: Fix the module init error handling
Problem Details: Fix the module init error handling. There are a bunch of goto labels for aborting the init procedure at different points and just undoing what needs undoing - they aren't all in the right places, however. This can lead to an oops like the following: BUG: unable to handle kernel NULL pointer derefer...
```diff diff --git a/fs/afs/main.c b/fs/afs/main.c index 66d54d348c55..cfd1cbe25b22 100644 --- a/fs/afs/main.c +++ b/fs/afs/main.c @@ -111,6 +111,8 @@ static int __init afs_init(void) /* initialise the callback update process */ ret = afs_callback_update_init(); + if (ret < 0) + goto error_callback_update_init; ...
415cf32c9cdfcc60f34d0ac17f29634e941ba7d2
Analyze and fix the following issue in the Linux kernel code: O2net: Disallow o2net accept connection request from itself.
Problem Details: Currently, o2net_accept_one() is allowed to accept a connection from listening node itself, such a fake connection will not be successfully established due to no handshake detected afterwards, and later end up with triggering connecting worker in a loop. We're going to fix this by treating such connec...
```diff diff --git a/fs/ocfs2/cluster/tcp.c b/fs/ocfs2/cluster/tcp.c index aa75ca3f78da..1361997cf205 100644 --- a/fs/ocfs2/cluster/tcp.c +++ b/fs/ocfs2/cluster/tcp.c @@ -1759,6 +1759,7 @@ static int o2net_accept_one(struct socket *sock) struct sockaddr_in sin; struct socket *new_sock = NULL; struct o2nm_node *no...
b11f1f1ab73fd358b1b734a9427744802202ba68
Analyze and fix the following issue in the Linux kernel code: ocfs2/dlm: remove potential deadlock -V3
Problem Details: When we need to take both dlm_domain_lock and dlm->spinlock, we should take them in order of: dlm_domain_lock then dlm->spinlock. There is pathes disobey this order. That is calling dlm_lockres_put() with dlm->spinlock held in dlm_run_purge_list. dlm_lockres_put() calls dlm_put() at the ref and dlm_pu...
```diff diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c index 6d098b89d46e..ffb4c68dafa4 100644 --- a/fs/ocfs2/dlm/dlmmaster.c +++ b/fs/ocfs2/dlm/dlmmaster.c @@ -511,8 +511,6 @@ static void dlm_lockres_release(struct kref *kref) atomic_dec(&dlm->res_cur_count); - dlm_put(dlm); - if (!hlist_unha...
a524812b7eaa7783d7811198921100f079034e61
Analyze and fix the following issue in the Linux kernel code: ocfs2/dlm: avoid incorrect bit set in refmap on recovery master
Problem Details: In the following situation, there remains an incorrect bit in refmap on the recovery master. Finally the recovery master will fail at purging the lockres due to the incorrect bit in refmap. 1) node A has no interest on lockres A any longer, so it is purging it. 2) the owner of lockres A is node B, so ...
```diff diff --git a/fs/ocfs2/dlm/dlmrecovery.c b/fs/ocfs2/dlm/dlmrecovery.c index 9dfaac73b36d..aaaffbcbe916 100644 --- a/fs/ocfs2/dlm/dlmrecovery.c +++ b/fs/ocfs2/dlm/dlmrecovery.c @@ -1997,6 +1997,8 @@ void dlm_move_lockres_to_recovery_list(struct dlm_ctxt *dlm, struct list_head *queue; struct dlm_lock *lock, *n...
845b6cf34150100deb5f58c8a37a372b111f2918
Analyze and fix the following issue in the Linux kernel code: Fix the nested PR lock calling issue in ACL
Problem Details: Hi, Thanks a lot for all the review and comments so far;) I'd like to send the improved (V4) version of this patch. This patch fixes a deadlock in OCFS2 ACL. We found this bug in OCFS2 and Samba integration using scenario, the symptom is several smbd processes will be hung under heavy workload. Final...
```diff diff --git a/fs/ocfs2/acl.c b/fs/ocfs2/acl.c index 5a2177833210..a76e0aa5cd3f 100644 --- a/fs/ocfs2/acl.c +++ b/fs/ocfs2/acl.c @@ -290,12 +290,30 @@ static int ocfs2_set_acl(handle_t *handle, int ocfs2_check_acl(struct inode *inode, int mask) { - struct posix_acl *acl = ocfs2_get_acl(inode, ACL_TYPE_ACCESS)...
7beaf243787f85a2ef9213ccf13ab4a243283fde
Analyze and fix the following issue in the Linux kernel code: ocfs2 fix o2dlm dlm run purgelist (rev 3)
Problem Details: This patch fixes two problems in dlm_run_purgelist 1. If a lockres is found to be in use, dlm_run_purgelist keeps trying to purge the same lockres instead of trying the next lockres. 2. When a lockres is found unused, dlm_run_purgelist releases lockres spinlock before setting DLM_LOCK_RES_DROPPING_RE...
```diff diff --git a/fs/ocfs2/dlm/dlmthread.c b/fs/ocfs2/dlm/dlmthread.c index d4f73ca68fe5..dd78ca3f360f 100644 --- a/fs/ocfs2/dlm/dlmthread.c +++ b/fs/ocfs2/dlm/dlmthread.c @@ -152,45 +152,25 @@ void dlm_lockres_calc_usage(struct dlm_ctxt *dlm, spin_unlock(&dlm->spinlock); } -static int dlm_purge_lockres(struct ...
6d98c3ccb52f692f1a60339dde7c700686a5568b
Analyze and fix the following issue in the Linux kernel code: ocfs2/dlm: fix a dead lock
Problem Details: When we have to take both dlm->master_lock and lockres->spinlock, take them in order lockres->spinlock and then dlm->master_lock. The patch fixes a violation of the rule. We can simply move taking dlm->master_lock to where we have dropped res->spinlock since when we access res->state and free mle mem...
```diff diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c index 94b97fc6a88e..6d098b89d46e 100644 --- a/fs/ocfs2/dlm/dlmmaster.c +++ b/fs/ocfs2/dlm/dlmmaster.c @@ -3050,8 +3050,6 @@ int dlm_migrate_request_handler(struct o2net_msg *msg, u32 len, void *data, /* check for pre-existing lock */ spin_lock...
6eda3dd33f8a0ce58ee56a11351758643a698db4
Analyze and fix the following issue in the Linux kernel code: ocfs2: do not overwrite error codes in ocfs2_init_acl
Problem Details: Setting the acl while creating a new inode depends on the error codes of posix_acl_create_masq. This patch fix a issue of overwriting the error codes of it. Reported-by: Pawel Zawora <pzawora@gmail.com> Cc: <stable@kernel.org> [ .33, .34 ] Signed-off-by: Tiger Yang <tiger.yang@oracle.com> Signed-off-b...
```diff diff --git a/fs/ocfs2/acl.c b/fs/ocfs2/acl.c index da702294d7e7..5a2177833210 100644 --- a/fs/ocfs2/acl.c +++ b/fs/ocfs2/acl.c @@ -344,7 +344,7 @@ int ocfs2_init_acl(handle_t *handle, { struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); struct posix_acl *acl = NULL; - int ret = 0; + int ret = 0, ret2; mode...
387ac089361fbe5ef287e6950c5c40f6b18e5c55
Analyze and fix the following issue in the Linux kernel code: block: fix missing export of blk_types.h
Problem Details: Stephen reports: After merging the block tree, today's linux-next build (x86_64 allmodconfig) failed like this: usr/include/linux/fs.h:11: included file 'linux/blk_types.h' is not exported Caused by commit 9d3dbbcd9a84518ff5e32ffe671d06a48cf84fd9 ("bio, fs: separate out bio_types.h and def...
```diff diff --git a/include/linux/Kbuild b/include/linux/Kbuild index 2fc8e14cc24a..671715b869fc 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild @@ -39,6 +39,7 @@ header-y += ax25.h header-y += b1lli.h header-y += baycom.h header-y += bfs_fs.h +header-y += blk_types.h header-y += blkpg.h header-y += ...
6bf05d03ea8d00bb53e0642f94a5a6815be2edb6
Analyze and fix the following issue in the Linux kernel code: writeback: fix bad _bh spinlock nesting
Problem Details: Fix a bug where a lock is _bh nested within another _bh lock, but forgets to use the _bh variant for unlock. Further more, it's not necessary to test _bh locks, the inner lock can just use spin_lock(). So fix up the bug by making that change. Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
```diff diff --git a/mm/backing-dev.c b/mm/backing-dev.c index 0b8ee66993dd..08d357522e78 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c @@ -415,7 +415,8 @@ static int bdi_forker_thread(void *ptr) break; } - spin_lock_bh(&bdi->wb_lock); + spin_lock(&bdi->wb_lock); + /* * If there is no wor...
297252c81de8043ca6c36e5984c24fdb5aab9013
Analyze and fix the following issue in the Linux kernel code: writeback: do not lose wake-ups in bdi threads
Problem Details: Currently, bdi threads ('bdi_writeback_thread()') can lose wake-ups. For example, if 'bdi_queue_work()' is executed after the bdi thread have had finished 'wb_do_writeback()' but before it called 'schedule_timeout_interruptible()'. To fix this issue, we have to check whether we have works to process a...
```diff diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index 002be0ff2ab3..05444eaa3f36 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c @@ -848,17 +848,18 @@ int bdi_writeback_thread(void *data) break; } - if (dirty_writeback_interval) { - wait_jiffies = msecs_to_jiffies(dirty_writeback_interval...
c4ec7908c2c5125f75fabd100e7a95626a6883ee
Analyze and fix the following issue in the Linux kernel code: writeback: do not lose wake-ups in the forker thread - 2
Problem Details: Currently, if someone submits jobs for the default bdi, we can lose wake-up events. E.g., this can happen if 'bdi_queue_work()' is called when 'bdi_forker_thread()' is executing code after 'wb_do_writeback(me, 0)', but before 'set_current_state(TASK_INTERRUPTIBLE)'. This situation is unlikely, and the...
```diff diff --git a/mm/backing-dev.c b/mm/backing-dev.c index b1dc2d4b9cdd..72e6eb96efe2 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c @@ -358,6 +358,10 @@ static int bdi_forker_thread(void *ptr) bdi_add_default_flusher_thread(bdi); } + /* Keep working if default bdi still has things to do */ + if (!...
c5f7ad233b8805dae06e694538d8095b19f3c560
Analyze and fix the following issue in the Linux kernel code: writeback: do not lose wake-ups in the forker thread - 1
Problem Details: Currently the forker thread can lose wake-ups which may lead to unnecessary delays in processing bdi works. E.g., consider the following scenario. 1. 'bdi_forker_thread()' walks the 'bdi_list', finds out there is nothing to do, and is about to finish the loop. 2. A bdi thread decides to exit becaus...
```diff diff --git a/mm/backing-dev.c b/mm/backing-dev.c index 327e36d1d623..b1dc2d4b9cdd 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c @@ -342,6 +342,7 @@ static int bdi_forker_thread(void *ptr) wb_do_writeback(me, 0); spin_lock_bh(&bdi_lock); + set_current_state(TASK_INTERRUPTIBLE); /* * Che...
94eac5e62364df4e605e451218ee6024a7ba664f
Analyze and fix the following issue in the Linux kernel code: writeback: fix possible race when creating bdi threads
Problem Details: This patch fixes a very unlikely race condition on the bdi forker thread error path: when bdi thread creation fails, 'bdi->wb.task' may contain the error code for a short period of time. If at the same time someone submits a work to this bdi, we can end up with an oops 'bdi_queue_work()' while executin...
```diff diff --git a/mm/backing-dev.c b/mm/backing-dev.c index 4e9ed2a8521f..327e36d1d623 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c @@ -331,8 +331,8 @@ static int bdi_forker_thread(void *ptr) set_user_nice(current, 0); for (;;) { + struct task_struct *task; struct backing_dev_info *bdi, *tmp; - st...
4aeefdc69f7b6f3f287e6fd8d4b213953b9e92d8
Analyze and fix the following issue in the Linux kernel code: coda: fixup clash with block layer REQ_* defines
Problem Details: CODA should not be using defines in the global name space of that nature, prefix them with CODA_. Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
```diff diff --git a/fs/coda/psdev.c b/fs/coda/psdev.c index 66b9cf79c5ba..de89645777c7 100644 --- a/fs/coda/psdev.c +++ b/fs/coda/psdev.c @@ -177,7 +177,7 @@ static ssize_t coda_psdev_write(struct file *file, const char __user *buf, nbytes = req->uc_outSize; /* don't have more space! */ } if (copy_from_u...
6965031d331a642e31278fa1b5bd47f372ffdd5d
Analyze and fix the following issue in the Linux kernel code: splice: fix misuse of SPLICE_F_NONBLOCK
Problem Details: SPLICE_F_NONBLOCK is clearly documented to only affect blocking on the pipe. In __generic_file_splice_read(), however, it causes an EAGAIN if the page is currently being read. This makes it impossible to write an application that only wants failure if the pipe is full. For example if the same proces...
```diff diff --git a/fs/splice.c b/fs/splice.c index ec11c52d646d..8f1dfaecc8f0 100644 --- a/fs/splice.c +++ b/fs/splice.c @@ -399,17 +399,7 @@ __generic_file_splice_read(struct file *in, loff_t *ppos, * If the page isn't uptodate, we may need to start io on it */ if (!PageUptodate(page)) { - /* - * If ...
6a32a8aed509e71137043d464db4a7fcd88c903e
Analyze and fix the following issue in the Linux kernel code: scsi: convert discard to REQ_TYPE_FS from REQ_TYPE_BLOCK_PC
Problem Details: Jens, any reason why this isn't included in your for-2.6.36 yet? = From: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Subject: [PATCH resend] scsi: convert discard to REQ_TYPE_FS from REQ_TYPE_BLOCK_PC The block layer (file systems) sends discard requests as REQ_TYPE_FS (the role of REQ_TYPE_FS is...
```diff diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index fc5d69a84af5..e63b85ac8cd1 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -434,7 +434,6 @@ static int scsi_setup_discard_cmnd(struct scsi_device *sdp, struct request *rq) nr_sectors >>= 3; } - rq->cmd_type = REQ_TYPE_BLOCK_PC; rq->time...
a6528d017234b483283274fbdd360f3541befe19
Analyze and fix the following issue in the Linux kernel code: cciss: fix hard reset code.
Problem Details: cciss: Fix hard reset code. Smart Array controllers newer than the P600 do not honor the PCI power state method of resetting the controllers. Instead, in these cases we can get them to reset via the "doorbell" register. This escaped notice until we began using "performant" mode because the fact that ...
```diff diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index f49dcd734d1b..b3060eced553 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c @@ -216,6 +216,12 @@ static void cciss_device_release(struct device *dev); static void cciss_free_gendisk(ctlr_info_t *h, int drv_index); static void cciss...
ff5f58f06deb3f7b9a865093d7f580bbc2b9b498
Analyze and fix the following issue in the Linux kernel code: cciss: cleanup some debug ifdefs
Problem Details: cciss: cleanup some debug ifdefs Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
```diff diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index e1c2bf1c6d64..10502a200226 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c @@ -3711,9 +3711,9 @@ static int check_for_unit_attention(ctlr_info_t *h, CommandList_struct *c) * the io functions. * This is for debug only. */ -...
da5503217d7421dbf04a0557d16cae6d5fc0960e
Analyze and fix the following issue in the Linux kernel code: cciss: fix leak of ioremapped memory
Problem Details: cciss: fix leak of ioremapped memory in cciss_pci_init error path. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
```diff diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index c297d31d0c97..b70247110608 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c @@ -4114,6 +4114,10 @@ static int __devinit cciss_pci_init(ctlr_info_t *c) if (err) goto err_out_free_res; c->vaddr = remap_pci_mem(c->paddr, 0x250); ...
373b45f7b691bf7faafeed46b0b3dcd5b281cd5f
Analyze and fix the following issue in the Linux kernel code: cciss: Set the performant mode bit in the scsi half of the driver
Problem Details: cciss: Set the performant mode bit in the scsi half of the driver In a couple of places, the performant mode bit wasn't being set in the scsi half of the driver, causing commands to seem to hang. Use enqueue_cmd_and_start_io() where appropriate. This fixes a bug that echo engage scsi > /proc/driver...
```diff diff --git a/drivers/block/cciss_scsi.c b/drivers/block/cciss_scsi.c index 8e0a709286df..3604b72f2af9 100644 --- a/drivers/block/cciss_scsi.c +++ b/drivers/block/cciss_scsi.c @@ -921,7 +921,6 @@ cciss_scsi_do_simple_cmd(ctlr_info_t *c, unsigned char *buf, int bufsize, int direction) { - unsigned long f...
7fd152f4b6ae4f3cf89e4b7a0383cc3c470772fc
Analyze and fix the following issue in the Linux kernel code: blkfront: Fix blkfront backend switch race (bdev release)
Problem Details: We cannot read backend state within bdev operations, because it risks grabbing the state change before xenbus gets to do it. Fixed by tracking deferral with a frontend switch to Closing. State exposure isn't strictly necessary, but the backends won't mind. For a 'clean' deferral this seems actually a...
```diff diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index 763a315712cc..49862993f31e 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c @@ -1142,31 +1142,48 @@ static int blkif_open(struct block_device *bdev, fmode_t mode) if (!err) ++info->users; - unlock_k...
139617437aff1f0d3b57c2d7cc60e60efc8fe6c3
Analyze and fix the following issue in the Linux kernel code: blkfront: Fix blkfront backend switch race (bdev open)
Problem Details: We need not mind if users grab a late handle on a closing disk. We probably even should not. But we have to make sure it's not a dead one already Let the bdev deal with a gendisk deleted under its feet. Takes the info mutex to decide a race against backend closing. Signed-off-by: Daniel Stodden <dani...
```diff diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index 1e406f0331e7..763a315712cc 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c @@ -1118,16 +1118,33 @@ static int blkfront_is_ready(struct xenbus_device *dev) static int blkif_open(struct block_device *bde...
9897cb532382f075b337f7933b5a50f0ffc32d35
Analyze and fix the following issue in the Linux kernel code: blkfront: Fix gendisk leak
Problem Details: Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com> Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
```diff diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index 3258ae67ac7a..62d32959095d 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c @@ -1029,6 +1029,9 @@ static void blkfront_closing(struct blkfront_info *info) blk_cleanup_queue(info->rq); info->rq = NULL; ...
89de1669ace055b56f1de1c9f5aca26dd7f17f25
Analyze and fix the following issue in the Linux kernel code: blkfront: Fix backtrace in del_gendisk
Problem Details: The call to del_gendisk follows an non-refcounted gd->queue pointer. We release the last ref in blk_cleanup_queue. Fixed by reordering releases accordingly. Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com> Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
```diff diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index 7fa2a1db51e6..3258ae67ac7a 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c @@ -1021,14 +1021,14 @@ static void blkfront_closing(struct blkfront_info *info) /* Flush gnttab callback work. Must be done wi...
5b61cb90c2ad8c853b4dd53eec200bacd2f02172
Analyze and fix the following issue in the Linux kernel code: xenbus: Make xenbus_switch_state transactional
Problem Details: According to the comments, this was how it's been done years ago, but apparently took an xbt pointer from elsewhere back then. The code was removed because of consistency issues: cancellation wont't roll back the saved xbdev->state. Still, unsolicited writes to the state field remain an issue, especia...
```diff diff --git a/drivers/xen/xenbus/xenbus_client.c b/drivers/xen/xenbus/xenbus_client.c index 7b3e973a1aee..7e49527189b6 100644 --- a/drivers/xen/xenbus/xenbus_client.c +++ b/drivers/xen/xenbus/xenbus_client.c @@ -133,17 +133,12 @@ int xenbus_watch_pathfmt(struct xenbus_device *dev, } EXPORT_SYMBOL_GPL(xenbus_wa...
b4dddb498c0feaff413b2a79c64e910021983775
Analyze and fix the following issue in the Linux kernel code: xen/blkfront: avoid compiler warning from missing cases
Problem Details: Fix: drivers/block/xen-blkfront.c: In function ‘blkfront_connect’: drivers/block/xen-blkfront.c:933: warning: enumeration value ‘BLKIF_STATE_DISCONNECTED’ not handled in switch Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
```diff diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index f47b0961fab1..9b440221755d 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c @@ -947,6 +947,9 @@ static void blkfront_connect(struct blkfront_info *info) /* fall through */ case BLKIF_STATE_SUSPENDED: ...
5d7ed20e822ef82117a4d9928b030fa0247b789d
Analyze and fix the following issue in the Linux kernel code: blkfront: don't access freed struct xenbus_device
Problem Details: Unfortunately commit "blkfront: fixes for 'xm block-detach ... --force'" still wasn't quite right - there was a reference to freed memory left from blkfront_closing(). Signed-off-by: Jan Beulich <jbeulich@novell.com> Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> Signed-off-by: Je...
```diff diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index 22091e4e401f..60006b730872 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c @@ -981,13 +981,11 @@ static void blkfront_connect(struct blkfront_info *info) * the backend. Once is this done, we can switch...
0e34582699392d67910bd3919bc8fd9bedce115e
Analyze and fix the following issue in the Linux kernel code: blkfront: fixes for 'xm block-detach ... --force'
Problem Details: Prevent prematurely freeing 'struct blkfront_info' instances (when the xenbus data structures are gone, but the Linux ones are still needed). Prevent adding a disk with the same (major, minor) [and hence the same name and sysfs entries, which leads to oopses] when the previous instance wasn't fully de...
```diff diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index 304009e77c73..22091e4e401f 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c @@ -105,6 +105,10 @@ struct blkfront_info static DEFINE_SPINLOCK(blkif_io_lock); +static unsigned int nr_minors; +static uns...
10d1f9e2ccfff40665a00ea0e0a0d11e54c9cbb1
Analyze and fix the following issue in the Linux kernel code: block: fix problem with sending down discard that isn't of correct granularity
Problem Details: If the queue doesn't have a limit set, or it just set UINT_MAX like we default to, we coud be sending down a discard request that isn't of the correct granularity if the block size is > 512b. Fix this by adjusting max_discard_sectors down to the proper alignment. Signed-off-by: Jens Axboe <jaxboe@fus...
```diff diff --git a/block/blk-lib.c b/block/blk-lib.c index e16185b0d8e1..5d793e143f3c 100644 --- a/block/blk-lib.c +++ b/block/blk-lib.c @@ -41,6 +41,7 @@ int blkdev_issue_discard(struct block_device *bdev, sector_t sector, struct request_queue *q = bdev_get_queue(bdev); int type = flags & BLKDEV_IFL_BARRIER ? ...
2669b19fa4debcdd6a660ace1a124c0900f113e6
Analyze and fix the following issue in the Linux kernel code: block: fix for block tracing build error
Problem Details: block/compat_ioctl.c: In function 'compat_blkdev_ioctl': block/compat_ioctl.c:754: error: 'BLKTRACESETUP32' undeclared (first use in this function) Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
```diff diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h index 07c698621ad0..3395cf7130f5 100644 --- a/include/linux/blktrace_api.h +++ b/include/linux/blktrace_api.h @@ -204,17 +204,6 @@ extern int blk_trace_init_sysfs(struct device *dev); extern struct attribute_group blk_trace_attr_group; ...
2daa672b1a736d41b3e7a2e3a05f1909a1f96530
Analyze and fix the following issue in the Linux kernel code: scsi/i2o: restore ioctl changes
Problem Details: This restores the changes from "scsi/i2o_block: cleanup ioctl handling", which accidentally got reverted. Origignal changelog: This fixes the ioctl function of the i2o_block driver, which has multiple problems: * The BLKI2OSRSTRAT and BLKI2OSWSTRAT commands always return -EN...
```diff diff --git a/drivers/message/i2o/i2o_block.c b/drivers/message/i2o/i2o_block.c index a5bc3ee0d93e..e6733bc99724 100644 --- a/drivers/message/i2o/i2o_block.c +++ b/drivers/message/i2o/i2o_block.c @@ -657,30 +657,40 @@ static int i2o_block_ioctl(struct block_device *bdev, fmode_t mode, { struct gendisk *disk =...
34484062445fe905bf02c72f87ddda21881acda3
Analyze and fix the following issue in the Linux kernel code: scsi/i2o_block: cleanup ioctl handling
Problem Details: This fixes the ioctl function of the i2o_block driver, which has multiple problems: * The BLKI2OSRSTRAT and BLKI2OSWSTRAT commands always return -ENOTTY on success, where they should return 0. * Support for 32 bit compat is missing * The driver should use the .ioctl function and because .locked_io...
```diff diff --git a/drivers/message/i2o/i2o_block.c b/drivers/message/i2o/i2o_block.c index 108f0c2b2bfd..b8233ff863e3 100644 --- a/drivers/message/i2o/i2o_block.c +++ b/drivers/message/i2o/i2o_block.c @@ -53,6 +53,7 @@ #include <linux/module.h> #include <linux/slab.h> #include <linux/i2o.h> +#include <linux/smp_lo...
610a63498f7f366031a6327eaaa9963ffa110b2b
Analyze and fix the following issue in the Linux kernel code: scsi: fix discard page leak
Problem Details: We leak a page allocated for discard on some error conditions (e.g. scsi_prep_state_check returns BLKPREP_DEFER in scsi_setup_blk_pc_cmnd). We unprep on requests that weren't prepped in the error path of scsi_init_io. It makes the error path to clean up scsi commands messy. Let's strictly apply the r...
```diff diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index ee836193f531..b8de389636f8 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -1011,11 +1011,8 @@ int scsi_init_io(struct scsi_cmnd *cmd, gfp_t gfp_mask) err_exit: scsi_release_buffers(cmd); - if (error == BLKPREP_KILL)...
f1126e950d28ff875d96ed6a04a9ff96c7bfc357
Analyze and fix the following issue in the Linux kernel code: scsi: add sd_unprep_fn to free discard page
Problem Details: This fixes discard page leak by using q->unprep_rq_fn facility. q->unprep_rq_fn is called when all the data buffer (req->bio and scsi_data_buffer) in the request is freed. sd_unprep() uses rq->buffer to free discard page allocated in sd_prepare_discard(). Signed-off-by: FUJITA Tomonori <fujita.tomon...
```diff diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 86da819c70eb..2d4e3a865f39 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -425,6 +425,7 @@ static int scsi_setup_discard_cmnd(struct scsi_device *sdp, struct request *rq) sector_t sector = bio->bi_sector; unsigned int nr_sectors = bio_secto...
e597cd09f711b28b8466ebdc2f12e55b44fa81e4
Analyze and fix the following issue in the Linux kernel code: drivers/cdrom: use pr_<level>
Problem Details: - add pr_fmt. - convert printks to pr_<level> - add if (0) and printf argument checking to cdinfo - coalesce consecutive printks to single pr_ - fix a typo "back ground" to "background" - convert printks without level to pr_info - remove VIOCD_ prefixes and use pr_fmt/pr_<level> - add a missing ...
```diff diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c index e3749d0ba68b..af13c62dc473 100644 --- a/drivers/cdrom/cdrom.c +++ b/drivers/cdrom/cdrom.c @@ -242,6 +242,8 @@ -------------------------------------------------------------------------*/ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + #define ...
511d37af66246c67f65e7896c230bdb81d853b6c
Analyze and fix the following issue in the Linux kernel code: block/xd.c: fix brace typo
Problem Details: Fix extra brace typo that is causing build errors. Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
```diff diff --git a/drivers/block/xd.c b/drivers/block/xd.c index 4dc298376098..b16a3a926cf2 100644 --- a/drivers/block/xd.c +++ b/drivers/block/xd.c @@ -322,7 +322,7 @@ static void do_xd_request (struct request_queue * q) int res = -EIO; int retry; - if (req->cmd_type != REQ_TYPE_FS) { + if (req->cmd_type !...
1676effca4cd2a6b32e6e8e0ecaa91522dfda6fa
Analyze and fix the following issue in the Linux kernel code: gcc-4.6: fs: fix unused but set warnings
Problem Details: No real bugs I believe, just some dead code, and some shut up code. Signed-off-by: Andi Kleen <ak@linux.intel.com> Cc: Eric Paris <eparis@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
```diff diff --git a/fs/splice.c b/fs/splice.c index efdbfece9932..ec11c52d646d 100644 --- a/fs/splice.c +++ b/fs/splice.c @@ -597,7 +597,6 @@ ssize_t default_file_splice_read(struct file *in, loff_t *ppos, struct page *pages[PIPE_DEF_BUFFERS]; struct partial_page partial[PIPE_DEF_BUFFERS]; struct iovec *vec, __v...
2c8919dee659928d66cc13333d4e7a5bdd2206d5
Analyze and fix the following issue in the Linux kernel code: gcc-4.6: block: fix unused but set variables in blk-merge
Problem Details: Just some dead code. Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
```diff diff --git a/block/blk-merge.c b/block/blk-merge.c index 4852475521ea..3b0cd4249671 100644 --- a/block/blk-merge.c +++ b/block/blk-merge.c @@ -12,7 +12,6 @@ static unsigned int __blk_recalc_rq_segments(struct request_queue *q, struct bio *bio) { - unsigned int phys_size; struct bio_vec *bv, *bvpr...
4c4762d10faf93167b84ee03e4b58dd62012b06f
Analyze and fix the following issue in the Linux kernel code: block: fix some more cmd_type cleanup fallout
Problem Details: Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
```diff diff --git a/drivers/block/ub.c b/drivers/block/ub.c index 034b34440ffa..aaf27fb4efd6 100644 --- a/drivers/block/ub.c +++ b/drivers/block/ub.c @@ -648,7 +648,7 @@ static int ub_request_fn_1(struct ub_lun *lun, struct request *rq) return 0; } - if (lun->changed && rq->cmd_type != REQ_TYPE_BLOCK_PC) + if (...
21af5448042a0962fb1df13a310bb363a8f6a8dc
Analyze and fix the following issue in the Linux kernel code: floppy: fix signed/unsigned warnings
Problem Details: Ioctl cmd value is unsigned, so change normalize_ioctl Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
```diff diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index 975fac3669c5..fd7085aa999f 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c @@ -3337,7 +3337,7 @@ static int set_geometry(unsigned int cmd, struct floppy_struct *g, } /* handle obsolete ioctl's */ -static int ioctl_table[] = ...
285203c8ff541a775f27148c06c58b96822d8b68
Analyze and fix the following issue in the Linux kernel code: floppy: initialize debug jiffies offset
Problem Details: Set debug jiffies offset at initialization. Avoids wierd values showing up if debugging enabled. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
```diff diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index 90c4038702da..0cb24f00c920 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c @@ -4175,6 +4175,9 @@ static int __init floppy_init(void) int i, unit, drive; int err, dr; + set_debugt(); + interruptjiffies = resultjiffies = jif...
b0dd5cad3a3297415f8205135d37f22da12b9083
Analyze and fix the following issue in the Linux kernel code: cciss: remove errant debug code
Problem Details: Remove a debug statement left behind by accident Ths debug statement got left behind. It was commented out after use but not deleted. Signed-off-by: Mike Miller <mike.miller@hp.com> Cc: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-of...
```diff diff --git a/drivers/block/cciss_scsi.c b/drivers/block/cciss_scsi.c index 48be47853737..8e0a709286df 100644 --- a/drivers/block/cciss_scsi.c +++ b/drivers/block/cciss_scsi.c @@ -213,8 +213,6 @@ scsi_cmd_stack_setup(int ctlr, struct cciss_scsi_adapter_data_t *sa) /* Check alignment, see cciss_cmd.h near Com...
b14aa6dcd083ad00fb416a93f76131734e6c3c17
Analyze and fix the following issue in the Linux kernel code: cciss: fix call to put_controller_in_performant_mode
Problem Details: call to put_controller_in_performant_mode was in the wrong place The call inadvertently ended up in an error path. Signed-off-by: Mike Miller <mike.miller@hp.com> Cc: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jens Axboe <ja...
```diff diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index 4f59f03f91ff..156ea365c14d 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c @@ -4150,6 +4150,7 @@ static int __devinit cciss_pci_init(ctlr_info_t *c, struct pci_dev *pdev) #ifdef CCISS_DEBUG printk(KERN_WARNING "Trying to put boar...
5e216153c34ac21781110795284a784037f808e3
Analyze and fix the following issue in the Linux kernel code: cciss: add performant mode support for Stars/Sirius
Problem Details: Add a mode of controller operation called Performant Mode. Even though cciss has been deprecated in favor of hpsa there are new controllers due out next year that HP must support in older vendor distros. Vendors require all fixes/features be upstream. These new controllers support only 16 commands i...
```diff diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index cd830cb64a5d..08a2e619dc36 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c @@ -206,6 +206,11 @@ static void cciss_device_release(struct device *dev); static void cciss_free_gendisk(ctlr_info_t *h, int drv_index); static void cciss...
28f4f8a9def2b1f3a6066bae791c77043ec49524
Analyze and fix the following issue in the Linux kernel code: ACPI / ACPICA: Fix reference counting problems with GPE handlers
Problem Details: If a handler is installed for a GPE associated with an AML method and such that it cannot wake up the system from sleep states, the GPE remains enabled after the handler has been installed, although it should be disabled in that case to avoid spurious execution of the handler. Fix this issue by making...
```diff diff --git a/drivers/acpi/acpica/acevents.h b/drivers/acpi/acpica/acevents.h index e0e6affb0d80..36867cd70eac 100644 --- a/drivers/acpi/acpica/acevents.h +++ b/drivers/acpi/acpica/acevents.h @@ -82,6 +82,10 @@ acpi_ev_update_gpe_enable_mask(struct acpi_gpe_event_info *gpe_event_info); acpi_status acpi_ev_ena...
998db52c03cd293d16a457f1b396cea932244147
Analyze and fix the following issue in the Linux kernel code: nfsd4: fix file open accounting for RDWR opens
Problem Details: Commit f9d7562fdb9dc0ada3a7aba5dbbe9d965e2a105d "nfsd4: share file descriptors between stateid's" didn't correctly account for O_RDWR opens. Symptoms include leaked files, resulting in failures to unmount and/or warnings about orphaned inodes on reboot. Signed-off-by: J. Bruce Fields <bfields@redhat.c...
```diff diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 0b4351f8238a..0a024917f052 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -162,13 +162,22 @@ static struct list_head ownerstr_hashtbl[OWNER_HASH_SIZE]; static struct list_head file_hashtbl[FILE_HASH_SIZE]; static struct list_head stat...
18cb2aef91b37dbce2bec2f39bb1dddd0e9dd838
Analyze and fix the following issue in the Linux kernel code: percpu: handle __percpu notations in UP accessors
Problem Details: UP accessors didn't take care of __percpu notations leading to a lot of spurious sparse warnings on UP configurations. Fix it. Signed-off-by: Namhyung Kim <namhyung@gmail.com> Signed-off-by: Tejun Heo <tj@kernel.org>
```diff diff --git a/include/asm-generic/percpu.h b/include/asm-generic/percpu.h index b5043a9890d8..08923b684768 100644 --- a/include/asm-generic/percpu.h +++ b/include/asm-generic/percpu.h @@ -70,11 +70,16 @@ extern void setup_per_cpu_areas(void); #else /* ! SMP */ -#define per_cpu(var, cpu) (*((void)(cpu), &(...
51e9ac77035a3dfcb6fc0a88a0d80b6f99b5edb1
Analyze and fix the following issue in the Linux kernel code: md/raid10: fix deadlock with unaligned read during resync
Problem Details: If the 'bio_split' path in raid10-read is used while resync/recovery is happening it is possible to deadlock. Fix this be elevating ->nr_waiting for the duration of both parts of the split request. This fixes a bug that has been present since 2.6.22 but has only started manifesting recently for unknow...
```diff diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index 42e64e4e5e25..d1d689126346 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -825,11 +825,29 @@ static int make_request(mddev_t *mddev, struct bio * bio) */ bp = bio_split(bio, chunk_sects - (bio->bi_sector & (chunk_sects...
ee110066130b79b7abf63bbd836d382699252b81
Analyze and fix the following issue in the Linux kernel code: powerpc: fix i8042 module build error
Problem Details: of_i8042_{kbd,aux}_irq needs to be exported Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
```diff diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index 15ade0d7bbb2..9d4882a46647 100644 --- a/arch/powerpc/kernel/setup-common.c +++ b/arch/powerpc/kernel/setup-common.c @@ -96,7 +96,9 @@ struct screen_info screen_info = { /* Variables required to store legacy IO irq rout...
cfa6a88c83f639f17b96a34dc0bf93faf432e73a
Analyze and fix the following issue in the Linux kernel code: powerpc/5200: add mpc5200_psc_ac97_gpio_reset
Problem Details: Work around a silicon bug in the ac97 reset functionality of the mpc5200(b). The implementation of the ac97 "cold" reset is flawed. If the sync and output lines are high when reset is asserted the attached ac97 device may go into test mode. Avoid this by reconfiguring the psc to gpio mode and generat...
```diff diff --git a/arch/powerpc/include/asm/mpc52xx.h b/arch/powerpc/include/asm/mpc52xx.h index b664ce79a172..1f41382eda38 100644 --- a/arch/powerpc/include/asm/mpc52xx.h +++ b/arch/powerpc/include/asm/mpc52xx.h @@ -271,6 +271,7 @@ struct mpc52xx_intr { /* mpc52xx_common.c */ extern void mpc5200_setup_xlb_arbiter(...
a7a387cc596278af1516c534b50cc0bee171129d
Analyze and fix the following issue in the Linux kernel code: SELINUX: Fix build error.
Problem Details: Fix build error caused by a stale security/selinux/av_permissions.h in the $(src) directory which will override a more recent version in $(obj) that is it appears to strike only when building with a separate object directory. Signed-off-by: Ralf Baechle <ralf@linux-mips.org> Acked-by: Eric Paris <epar...
```diff diff --git a/security/selinux/Makefile b/security/selinux/Makefile index f013982df417..58d80f3bd6f6 100644 --- a/security/selinux/Makefile +++ b/security/selinux/Makefile @@ -25,6 +25,6 @@ $(obj)/avc.o: $(obj)/flask.h quiet_cmd_flask = GEN $(obj)/flask.h $(obj)/av_permissions.h cmd_flask = scripts/s...
c18c821fd40ad0ffc199a55be874e556bf999416
Analyze and fix the following issue in the Linux kernel code: nfsd41: Fix a crash when a callback is retried
Problem Details: If a callback is retried at nfsd4_cb_recall_done() due to some error, the returned rpc reply crashes here: @@ -514,6 +514,7 @@ decode_cb_sequence(struct xdr_stream *xdr, struct nfsd4_cb_sequence *res, u32 dummy; __be32 *p; + BUG_ON(!res); if (res->cbs_minorversion == 0) return 0; [BUG_ON a...
```diff diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c index 1e6497ed3e12..988cbb3a19b6 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c @@ -697,7 +697,7 @@ static void nfsd4_cb_recall_done(struct rpc_task *task, void *calldata) if (dp->dl_retries--) { rpc_delay(task, 2*HZ); task->...
774f8bbd9ef2e71d4ef4b89933d292091d31ca98
Analyze and fix the following issue in the Linux kernel code: nfsd: fix startup/shutdown order bug
Problem Details: We must create the server before we can call init_socks or check the number of threads. Symptoms were a NULL pointer dereference in nfsd_svc(). Problem identified by Jeff Layton. Also fix a minor cleanup-on-error case in nfsd_startup(). Reported-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>...
```diff diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c index 92173bde32d2..39ced4a52c5f 100644 --- a/fs/nfsd/nfssvc.c +++ b/fs/nfsd/nfssvc.c @@ -204,6 +204,9 @@ static bool nfsd_up = false; static int nfsd_startup(unsigned short port, int nrservs) { int ret; + + if (nfsd_up) + return 0; /* * Readahead param...
9261ec1a8d7b17e2540bef7cad3470870d13b61e
Analyze and fix the following issue in the Linux kernel code: console: Fix compilation regression
Problem Details: A regression of building without CONFIG_HW_CONSOLE was introduced with commit b45cfba4e9005d64d419718e7ff7f7cab44c1994 (vt,console,kdb: implement atomic console enter/leave functions). ERROR: "con_debug_enter" [drivers/serial/kgdboc.ko] undefined! ERROR: "vc_cons" [drivers/serial/kgdboc.ko] undefined!...
```diff diff --git a/include/linux/console.h b/include/linux/console.h index f76fc297322d..95cf6f08a59d 100644 --- a/include/linux/console.h +++ b/include/linux/console.h @@ -79,8 +79,13 @@ int register_con_driver(const struct consw *csw, int first, int last); int unregister_con_driver(const struct consw *csw); int t...
449e5b247ca7c9dc9fc3391b7eebfefdeb2ce1fc
Analyze and fix the following issue in the Linux kernel code: perf probe: Fix memory leaks in add_perf_probe_events
Problem Details: Fix several memory leaks of pkgs and tevs in add_perf_probe_events(). Reported-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> Cc: Ingo Molnar <mingo@elte.hu> Cc: linux-kernel@vger.kernel.org LKML-Reference: <4C577ADC.100...
```diff diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c index 2e665cb84055..e72f05c3bef0 100644 --- a/tools/perf/util/probe-event.c +++ b/tools/perf/util/probe-event.c @@ -1606,8 +1606,10 @@ int add_perf_probe_events(struct perf_probe_event *pevs, int npevs, /* Init vmlinux path */ ret ...
58432e1f3625ef22b347ec8f9487e1852aa9ad67
Analyze and fix the following issue in the Linux kernel code: perf probe: Fix to copy the type for raw parameters
Problem Details: Copy type field if it is for raw parameters. Without this fix, perf probe drops the type if user passes it for raw parameters (e.g. %ax:u32 will be converted to %ax). Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> Cc: Ingo Molnar <mingo@elte.hu> Cc: Frederic Weisbeck...
```diff diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c index 6c7750da43d7..525136684d4e 100644 --- a/tools/perf/util/probe-finder.c +++ b/tools/perf/util/probe-finder.c @@ -705,8 +705,12 @@ static int find_variable(Dwarf_Die *sp_die, struct probe_finder *pf) pf->tvar->value = strdup(pf-...
18fab912d4fa70133df164d2dcf3310be0c38c34
Analyze and fix the following issue in the Linux kernel code: tracing: Fix ring_buffer_read_page reading out of page boundary
Problem Details: With the configuration: CONFIG_DEBUG_PAGEALLOC=y and Shaohua's patch: [PATCH]x86: make spurious_fault check correct pte bit Function call graph trace with the following will trigger a page fault. # cd /sys/kernel/debug/tracing/ # echo function_graph > current_tracer # cat per_cpu/cpu1/trace_pipe_raw...
```diff diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c index 1da7b6ea8b85..5ec8f1d1480e 100644 --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c @@ -3868,6 +3868,9 @@ int ring_buffer_read_page(struct ring_buffer *buffer, rpos = reader->read; pos += size; + if (rpos >= c...
c513b67e68787eceafeede32bcd0edbee45c0006
Analyze and fix the following issue in the Linux kernel code: pci: fix type warnings in intr_remapping.c
Problem Details: Commit 69309a059075 ("x86, asm: Clean up and simplify set_64bit()") sanitized the x86-64 types to set_64bit(), and incidentally resulted in warnings like drivers/pci/intr_remapping.c: In function 'modify_irte': drivers/pci/intr_remapping.c:314: warning: passing argument 1 of 'set_64bit' from incompa...
```diff diff --git a/drivers/pci/intr_remapping.c b/drivers/pci/intr_remapping.c index 1315ac688aa2..1694a0e2845b 100644 --- a/drivers/pci/intr_remapping.c +++ b/drivers/pci/intr_remapping.c @@ -311,8 +311,8 @@ int modify_irte(int irq, struct irte *irte_modified) index = irq_iommu->irte_index + irq_iommu->sub_handle;...
a24d52f390a77ce90dc8cf0cd75d27ec0a6ea3f8
Analyze and fix the following issue in the Linux kernel code: iwlwifi: fix locking assertions
Problem Details: spin_is_locked() can return zero on some (UP?) configurations because locks don't exist, and that causes an endless amount of warnings. Use lockdep_assert_held() instead, which has two advantages: 1) it verifies the current task is holding the lock or mutex 2) it compiles away completely when loc...
```diff diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c index a1b6d202d57c..9dd9e64c2b0b 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c @@ -1429,7 +1429,7 @@ int iwlagn_manage_ibss_station(struct iwl_priv *pri...
e95b743536937a72e1560c85696b425c5d1a1c18
Analyze and fix the following issue in the Linux kernel code: iwlwifi: fix TX tracer
Problem Details: The TX tracing code copies with the wrong length, which will typically copy too little data. Fix this by using the correct length variable. Cc: stable@kernel.org [2.6.32+] Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
```diff diff --git a/drivers/net/wireless/iwlwifi/iwl-devtrace.h b/drivers/net/wireless/iwlwifi/iwl-devtrace.h index ae7319bb3a99..4cf864c664ee 100644 --- a/drivers/net/wireless/iwlwifi/iwl-devtrace.h +++ b/drivers/net/wireless/iwlwifi/iwl-devtrace.h @@ -193,7 +193,7 @@ TRACE_EVENT(iwlwifi_dev_tx, __entry->framelen ...
d5eff1a3412f6d75bf28f423c5015ece8055407a
Analyze and fix the following issue in the Linux kernel code: NFS: Fix /proc/mount for legacy binary interface
Problem Details: Add a flag so we know if we mounted the NFS server using the legacy binary interface. If we used the legacy interface, then we should not show the mountd options. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
```diff diff --git a/fs/nfs/super.c b/fs/nfs/super.c index f9df16de4a56..f1ae39f6cb02 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c @@ -546,6 +546,9 @@ static void nfs_show_mountd_options(struct seq_file *m, struct nfs_server *nfss, { struct sockaddr *sap = (struct sockaddr *)&nfss->mountd_address; + if (nfss->...
761fe93cdfa29071879d882c92e966ae692c0048
Analyze and fix the following issue in the Linux kernel code: NFS: Fix the locking in nfs4_callback_getattr
Problem Details: The delegation is protected by RCU now, so we need to replace the nfsi->rwsem protection with an rcu protected section. Reported-by: Fred Isaman <iisaman@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
```diff diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c index 7445dd0ae3f3..930d10fecdaf 100644 --- a/fs/nfs/callback_proc.c +++ b/fs/nfs/callback_proc.c @@ -37,8 +37,8 @@ __be32 nfs4_callback_getattr(struct cb_getattrargs *args, struct cb_getattrres * if (inode == NULL) goto out_putclient; nfsi = N...
d2fab5cf3979c55f802c96616daf96e9e8de1c80
Analyze and fix the following issue in the Linux kernel code: [SCSI] ibmvfc: Fix terminate_rport_io
Problem Details: The ibmvfc driver was incorrectly obtaining a scsi_target pointer from an fc_rport. The way it is coded ensures that ibmvfc's terminate_rport_io handler does absolutely nothing. Fix this up to iterate through affected devices differently, sending cancel and abort task set as appropriate. Without this p...
```diff diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c index a13db5908426..9f75a6d519a2 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc.c +++ b/drivers/scsi/ibmvscsi/ibmvfc.c @@ -2039,95 +2039,108 @@ static int ibmvfc_reset_device(struct scsi_device *sdev, int type, char *desc) } /** - * ibm...
d5da3040d798df4bbb62579b97f8b6b83749da22
Analyze and fix the following issue in the Linux kernel code: [SCSI] ibmvfc: Fix rport add/delete race resulting in oops
Problem Details: Commit 43c8da907ccc656935d1085701f4db83385d8a59 introduced a race condition which can occur when adding/deleting rports. There are two possible threads now that can be deleting rports in the ibmvfc driver, which can result in list_del being called twice, resulting in an oops. This patch adds a new stat...
```diff diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c index bd96cecaa619..a13db5908426 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc.c +++ b/drivers/scsi/ibmvscsi/ibmvfc.c @@ -433,6 +433,9 @@ static void ibmvfc_set_tgt_action(struct ibmvfc_target *tgt, { switch (tgt->action) { case IBMVF...
38b92ef89b0d5a255f2f812c623fcdec4e63a21c
Analyze and fix the following issue in the Linux kernel code: [SCSI] lpfc 8.3.16: FCoE Discovery and Failover Fixes
Problem Details: - Add support for re-reg'ing changed VPI w/o unregister VPI - Copy WWN and state from old nodelist when target DID change. - Clean up old nodelist rport and put the nodelist when target DID change. - Clear the VFI_REGISTERED flag when UNREG_VFI completes. - Made both checks of port_state against LPFC_F...
```diff diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index afbed6bc31f0..8d09191c327e 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -600,6 +600,14 @@ lpfc_cmpl_els_flogi_fabric(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, vport->fc_flag |= FC_VP...
382dbe5b39a4efa6fdb3e5093e5d0bdbb5c5301f
Analyze and fix the following issue in the Linux kernel code: Blackfin: portmux: fix peripheral map overflow when requesting pins
Problem Details: Some processors have groups of pins that aren't an even number of 16. This causes the array size calculation to under count the number of needed entries due to integer truncation. So on the BF51x, while we should have 3 bitmaps (41 / 16), we end up with 2 and pin requests for the 3rd bank end up scrib...
```diff diff --git a/arch/blackfin/kernel/bfin_gpio.c b/arch/blackfin/kernel/bfin_gpio.c index c5650559a4e1..dc07ed08b37f 100644 --- a/arch/blackfin/kernel/bfin_gpio.c +++ b/arch/blackfin/kernel/bfin_gpio.c @@ -157,7 +157,7 @@ static int cmp_label(unsigned short ident, const char *label) #define DECLARE_RESERVED_MAP(m...
d1401e1dc22606a91f577ad3dfd68ae7e60e0357
Analyze and fix the following issue in the Linux kernel code: Blackfin: fix DMA/cache bug when resuming from suspend to RAM
Problem Details: The dma_memcpy() function takes care of flushing different caches for us. Normally this is what we want, but when resuming from mem, we don't yet have caches enabled. If these functions happen to be placed into L1 mem (which is what we're trying to relocate), then things aren't going to work. So defi...
```diff diff --git a/arch/blackfin/include/asm/dma.h b/arch/blackfin/include/asm/dma.h index 2c09b1d50ec9..eedf3ca65ba2 100644 --- a/arch/blackfin/include/asm/dma.h +++ b/arch/blackfin/include/asm/dma.h @@ -276,6 +276,7 @@ static inline void clear_dma_irqstat(unsigned int channel) } void *dma_memcpy(void *dest, con...