From: Greg Kroah-Hartman Date: Mon, 15 Oct 2012 17:29:52 +0000 (-0700) Subject: 3.4-stable patches X-Git-Tag: v3.0.47~34 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=12fcb0d260edf823ad58cbb4b367412016d9d427;p=thirdparty%2Fkernel%2Fstable-queue.git 3.4-stable patches added patches: autofs4-fix-reset-pending-flag-on-mount-fail.patch block-fix-request_queue-flags-initialization.patch target-fix-return-code-in-target_core_init_configfs-error-path.patch xen-bootup-allow-read_tscp-call-for-xen-pv-guests.patch xen-bootup-allow-read-write-_cr8-pvops-call.patch --- diff --git a/queue-3.4/autofs4-fix-reset-pending-flag-on-mount-fail.patch b/queue-3.4/autofs4-fix-reset-pending-flag-on-mount-fail.patch new file mode 100644 index 00000000000..8110333c01d --- /dev/null +++ b/queue-3.4/autofs4-fix-reset-pending-flag-on-mount-fail.patch @@ -0,0 +1,41 @@ +From 49999ab27eab6289a8e4f450e148bdab521361b2 Mon Sep 17 00:00:00 2001 +From: Ian Kent +Date: Thu, 11 Oct 2012 08:00:33 +0800 +Subject: autofs4 - fix reset pending flag on mount fail + +From: Ian Kent + +commit 49999ab27eab6289a8e4f450e148bdab521361b2 upstream. + +In autofs4_d_automount(), if a mount fail occurs the AUTOFS_INF_PENDING +mount pending flag is not cleared. + +One effect of this is when using the "browse" option, directory entry +attributes show up with all "?"s due to the incorrect callback and +subsequent failure return (when in fact no callback should be made). + +Signed-off-by: Ian Kent +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + fs/autofs4/root.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/fs/autofs4/root.c ++++ b/fs/autofs4/root.c +@@ -392,10 +392,12 @@ static struct vfsmount *autofs4_d_automo + ino->flags |= AUTOFS_INF_PENDING; + spin_unlock(&sbi->fs_lock); + status = autofs4_mount_wait(dentry); +- if (status) +- return ERR_PTR(status); + spin_lock(&sbi->fs_lock); + ino->flags &= ~AUTOFS_INF_PENDING; ++ if (status) { ++ spin_unlock(&sbi->fs_lock); ++ return ERR_PTR(status); ++ } + } + done: + if (!(ino->flags & AUTOFS_INF_EXPIRING)) { diff --git a/queue-3.4/block-fix-request_queue-flags-initialization.patch b/queue-3.4/block-fix-request_queue-flags-initialization.patch new file mode 100644 index 00000000000..7ae7fc8938d --- /dev/null +++ b/queue-3.4/block-fix-request_queue-flags-initialization.patch @@ -0,0 +1,38 @@ +From 60ea8226cbd5c8301f9a39edc574ddabcb8150e0 Mon Sep 17 00:00:00 2001 +From: Tejun Heo +Date: Thu, 20 Sep 2012 14:09:30 -0700 +Subject: block: fix request_queue->flags initialization + +From: Tejun Heo + +commit 60ea8226cbd5c8301f9a39edc574ddabcb8150e0 upstream. + +A queue newly allocated with blk_alloc_queue_node() has only +QUEUE_FLAG_BYPASS set. For request-based drivers, +blk_init_allocated_queue() is called and q->queue_flags is overwritten +with QUEUE_FLAG_DEFAULT which doesn't include BYPASS even though the +initial bypass is still in effect. + +In blk_init_allocated_queue(), or QUEUE_FLAG_DEFAULT to q->queue_flags +instead of overwriting. + +Signed-off-by: Tejun Heo +Acked-by: Vivek Goyal +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman + +--- + block/blk-core.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/block/blk-core.c ++++ b/block/blk-core.c +@@ -601,7 +601,7 @@ blk_init_allocated_queue(struct request_ + q->request_fn = rfn; + q->prep_rq_fn = NULL; + q->unprep_rq_fn = NULL; +- q->queue_flags = QUEUE_FLAG_DEFAULT; ++ q->queue_flags |= QUEUE_FLAG_DEFAULT; + + /* Override internal queue lock with supplied lock pointer */ + if (lock) diff --git a/queue-3.4/series b/queue-3.4/series index 4d7e525b1fe..b634ae5df31 100644 --- a/queue-3.4/series +++ b/queue-3.4/series @@ -18,3 +18,8 @@ scsi-scsi_debug-fix-off-by-one-bug-when-unmapping-region.patch arm-7541-1-add-arm-errata-775420-workaround.patch firewire-cdev-fix-user-memory-corruption-i386-userland-on-amd64-kernel.patch sunrpc-ensure-that-the-tcp-socket-is-closed-when-in-close_wait.patch +target-fix-return-code-in-target_core_init_configfs-error-path.patch +xen-bootup-allow-read-write-_cr8-pvops-call.patch +xen-bootup-allow-read_tscp-call-for-xen-pv-guests.patch +block-fix-request_queue-flags-initialization.patch +autofs4-fix-reset-pending-flag-on-mount-fail.patch diff --git a/queue-3.4/target-fix-return-code-in-target_core_init_configfs-error-path.patch b/queue-3.4/target-fix-return-code-in-target_core_init_configfs-error-path.patch new file mode 100644 index 00000000000..30767b68b6b --- /dev/null +++ b/queue-3.4/target-fix-return-code-in-target_core_init_configfs-error-path.patch @@ -0,0 +1,90 @@ +From 37bb7899ca366dc212b71b150e78566d04808cc0 Mon Sep 17 00:00:00 2001 +From: Peter Senna Tschudin +Date: Mon, 17 Sep 2012 20:05:33 +0200 +Subject: target: fix return code in target_core_init_configfs error path + +From: Peter Senna Tschudin + +commit 37bb7899ca366dc212b71b150e78566d04808cc0 upstream. + +This patch fixes error cases within target_core_init_configfs() to +properly set ret = -ENOMEM before jumping to the out_global exception +path. + +This was originally discovered with the following Coccinelle semantic +match information: + +Convert a nonnegative error return code to a negative one, as returned +elsewhere in the function. A simplified version of the semantic match +that finds this problem is as follows: (http://coccinelle.lip6.fr/) + +// +( +if@p1 (\(ret < 0\|ret != 0\)) + { ... return ret; } +| +ret@p1 = 0 +) +... when != ret = e1 + when != &ret +*if(...) +{ + ... when != ret = e2 + when forall + return ret; +} +// + +Signed-off-by: Peter Senna Tschudin +Signed-off-by: Nicholas Bellinger +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/target/target_core_configfs.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +--- a/drivers/target/target_core_configfs.c ++++ b/drivers/target/target_core_configfs.c +@@ -3115,6 +3115,7 @@ static int __init target_core_init_confi + GFP_KERNEL); + if (!target_cg->default_groups) { + pr_err("Unable to allocate target_cg->default_groups\n"); ++ ret = -ENOMEM; + goto out_global; + } + +@@ -3130,6 +3131,7 @@ static int __init target_core_init_confi + GFP_KERNEL); + if (!hba_cg->default_groups) { + pr_err("Unable to allocate hba_cg->default_groups\n"); ++ ret = -ENOMEM; + goto out_global; + } + config_group_init_type_name(&alua_group, +@@ -3145,6 +3147,7 @@ static int __init target_core_init_confi + GFP_KERNEL); + if (!alua_cg->default_groups) { + pr_err("Unable to allocate alua_cg->default_groups\n"); ++ ret = -ENOMEM; + goto out_global; + } + +@@ -3156,14 +3159,17 @@ static int __init target_core_init_confi + * Add core/alua/lu_gps/default_lu_gp + */ + lu_gp = core_alua_allocate_lu_gp("default_lu_gp", 1); +- if (IS_ERR(lu_gp)) ++ if (IS_ERR(lu_gp)) { ++ ret = -ENOMEM; + goto out_global; ++ } + + lu_gp_cg = &alua_lu_gps_group; + lu_gp_cg->default_groups = kzalloc(sizeof(struct config_group) * 2, + GFP_KERNEL); + if (!lu_gp_cg->default_groups) { + pr_err("Unable to allocate lu_gp_cg->default_groups\n"); ++ ret = -ENOMEM; + goto out_global; + } + diff --git a/queue-3.4/xen-bootup-allow-read-write-_cr8-pvops-call.patch b/queue-3.4/xen-bootup-allow-read-write-_cr8-pvops-call.patch new file mode 100644 index 00000000000..2f313bdc4e6 --- /dev/null +++ b/queue-3.4/xen-bootup-allow-read-write-_cr8-pvops-call.patch @@ -0,0 +1,67 @@ +From 1a7bbda5b1ab0e02622761305a32dc38735b90b2 Mon Sep 17 00:00:00 2001 +From: Konrad Rzeszutek Wilk +Date: Wed, 10 Oct 2012 13:25:48 -0400 +Subject: xen/bootup: allow {read|write}_cr8 pvops call. + +From: Konrad Rzeszutek Wilk + +commit 1a7bbda5b1ab0e02622761305a32dc38735b90b2 upstream. + +We actually do not do anything about it. Just return a default +value of zero and if the kernel tries to write anything but 0 +we BUG_ON. + +This fixes the case when an user tries to suspend the machine +and it blows up in save_processor_state b/c 'read_cr8' is set +to NULL and we get: + +kernel BUG at /home/konrad/ssd/linux/arch/x86/include/asm/paravirt.h:100! +invalid opcode: 0000 [#1] SMP +Pid: 2687, comm: init.late Tainted: G O 3.6.0upstream-00002-gac264ac-dirty #4 Bochs Bochs +RIP: e030:[] [] save_processor_state+0x212/0x270 + +.. snip.. +Call Trace: + [] do_suspend_lowlevel+0xf/0xac + [] ? x86_acpi_suspend_lowlevel+0x10c/0x150 + [] acpi_suspend_enter+0x57/0xd5 + +Signed-off-by: Konrad Rzeszutek Wilk +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/xen/enlighten.c | 16 +++++++++++++++- + 1 file changed, 15 insertions(+), 1 deletion(-) + +--- a/arch/x86/xen/enlighten.c ++++ b/arch/x86/xen/enlighten.c +@@ -942,7 +942,16 @@ static void xen_write_cr4(unsigned long + + native_write_cr4(cr4); + } +- ++#ifdef CONFIG_X86_64 ++static inline unsigned long xen_read_cr8(void) ++{ ++ return 0; ++} ++static inline void xen_write_cr8(unsigned long val) ++{ ++ BUG_ON(val); ++} ++#endif + static int xen_write_msr_safe(unsigned int msr, unsigned low, unsigned high) + { + int ret; +@@ -1111,6 +1120,11 @@ static const struct pv_cpu_ops xen_cpu_o + .read_cr4_safe = native_read_cr4_safe, + .write_cr4 = xen_write_cr4, + ++#ifdef CONFIG_X86_64 ++ .read_cr8 = xen_read_cr8, ++ .write_cr8 = xen_write_cr8, ++#endif ++ + .wbinvd = native_wbinvd, + + .read_msr = native_read_msr_safe, diff --git a/queue-3.4/xen-bootup-allow-read_tscp-call-for-xen-pv-guests.patch b/queue-3.4/xen-bootup-allow-read_tscp-call-for-xen-pv-guests.patch new file mode 100644 index 00000000000..8286cd4cb65 --- /dev/null +++ b/queue-3.4/xen-bootup-allow-read_tscp-call-for-xen-pv-guests.patch @@ -0,0 +1,31 @@ +From cd0608e71e9757f4dae35bcfb4e88f4d1a03a8ab Mon Sep 17 00:00:00 2001 +From: Konrad Rzeszutek Wilk +Date: Wed, 10 Oct 2012 13:30:47 -0400 +Subject: xen/bootup: allow read_tscp call for Xen PV guests. + +From: Konrad Rzeszutek Wilk + +commit cd0608e71e9757f4dae35bcfb4e88f4d1a03a8ab upstream. + +The hypervisor will trap it. However without this patch, +we would crash as the .read_tscp is set to NULL. This patch +fixes it and sets it to the native_read_tscp call. + +Signed-off-by: Konrad Rzeszutek Wilk +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/xen/enlighten.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/arch/x86/xen/enlighten.c ++++ b/arch/x86/xen/enlighten.c +@@ -1135,6 +1135,8 @@ static const struct pv_cpu_ops xen_cpu_o + .read_tsc = native_read_tsc, + .read_pmc = native_read_pmc, + ++ .read_tscp = native_read_tscp, ++ + .iret = xen_iret, + .irq_enable_sysexit = xen_sysexit, + #ifdef CONFIG_X86_64