From: Greg Kroah-Hartman Date: Thu, 18 Jul 2013 05:25:08 +0000 (-0700) Subject: 3.9-stable patches X-Git-Tag: v3.9.11~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d54c019594fe7ee8491a1d32ec09676fc565b656;p=thirdparty%2Fkernel%2Fstable-queue.git 3.9-stable patches added patches: acpica-do-not-use-extended-sleep-registers-unless-hw-reduced-bit-is-set.patch acpi-ec-add-hp-folio-13-to-ec_dmi_table-in-order-to-skip-dsdt-scan.patch acpi-pm-fix-corner-case-in-acpi_bus_update_power.patch ahci-remove-pmp-link-online-check-in-fbs-eh.patch btrfs-fix-estale-with-btrfs-send.patch btrfs-only-do-the-tree_mod_log_free_eb-if-this-is-our-last.patch drivers-rtc-rtc-rv3029c2.c-fix-disabling-aie-irq.patch genirq-fix-can_request_irq-for-irqs-without-an-action.patch nbd-correct-disconnect-behavior.patch ocfs2-xattr-fix-inlined-xattr-reflink.patch pci-finish-sr-iov-vf-setup-before-adding-the-device.patch pci-fix-refcount-issue-in-pci_create_root_bus-error-recovery-path.patch timer-fix-jiffies-wrap-behavior-of-round_jiffies_common.patch xen-pcifront-deal-with-toolstack-missing-xenbusstateclosing-state.patch xen-time-remove-blocked-time-accounting-from-xen-clockchip.patch --- diff --git a/queue-3.9/acpi-ec-add-hp-folio-13-to-ec_dmi_table-in-order-to-skip-dsdt-scan.patch b/queue-3.9/acpi-ec-add-hp-folio-13-to-ec_dmi_table-in-order-to-skip-dsdt-scan.patch new file mode 100644 index 00000000000..2629ccda8c1 --- /dev/null +++ b/queue-3.9/acpi-ec-add-hp-folio-13-to-ec_dmi_table-in-order-to-skip-dsdt-scan.patch @@ -0,0 +1,37 @@ +From eff9a4b62b14cf0d9913e3caf1f26f8b7a6105c9 Mon Sep 17 00:00:00 2001 +From: Lan Tianyu +Date: Wed, 5 Jun 2013 02:27:51 +0000 +Subject: ACPI / EC: Add HP Folio 13 to ec_dmi_table in order to skip DSDT scan + +From: Lan Tianyu + +commit eff9a4b62b14cf0d9913e3caf1f26f8b7a6105c9 upstream. + +HP Folio 13's BIOS defines CMOS RTC Operation Region and the EC's +_REG method will access that region. To allow the CMOS RTC region +handler to be installed before the EC _REG method is first invoked, +add ec_skip_dsdt_scan() as HP Folio 13's callback to ec_dmi_table. + +References: https://bugzilla.kernel.org/show_bug.cgi?id=54621 +Reported-and-tested-by: Stefan Nagy +Signed-off-by: Lan Tianyu +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/acpi/ec.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/acpi/ec.c ++++ b/drivers/acpi/ec.c +@@ -983,6 +983,10 @@ static struct dmi_system_id __initdata e + ec_enlarge_storm_threshold, "CLEVO hardware", { + DMI_MATCH(DMI_SYS_VENDOR, "CLEVO Co."), + DMI_MATCH(DMI_PRODUCT_NAME, "M720T/M730T"),}, NULL}, ++ { ++ ec_skip_dsdt_scan, "HP Folio 13", { ++ DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "HP Folio 13"),}, NULL}, + {}, + }; + diff --git a/queue-3.9/acpi-pm-fix-corner-case-in-acpi_bus_update_power.patch b/queue-3.9/acpi-pm-fix-corner-case-in-acpi_bus_update_power.patch new file mode 100644 index 00000000000..fa5907d3dd1 --- /dev/null +++ b/queue-3.9/acpi-pm-fix-corner-case-in-acpi_bus_update_power.patch @@ -0,0 +1,68 @@ +From 91bdad0b6237c25a7bf8fd4604d0cc64a2005a23 Mon Sep 17 00:00:00 2001 +From: "Rafael J. Wysocki" +Date: Thu, 4 Jul 2013 13:22:11 +0200 +Subject: ACPI / PM: Fix corner case in acpi_bus_update_power() + +From: "Rafael J. Wysocki" + +commit 91bdad0b6237c25a7bf8fd4604d0cc64a2005a23 upstream. + +The role of acpi_bus_update_power() is to update the given ACPI +device object's power.state field to reflect the current physical +state of the device (as inferred from the configuration of power +resources and _PSC, if available). For this purpose it calls +acpi_device_set_power() that should update the power resources' +reference counters and set power.state as appropriate. However, +that doesn't work if the "new" state is D1, D2 or D3hot and the +the current value of power.state means D3cold, because in that +case acpi_device_set_power() will refuse to transition the device +from D3cold to non-D0. + +To address this problem, make acpi_bus_update_power() call +acpi_power_transition() directly to update the power resources' +reference counters and only use acpi_device_set_power() to put +the device into D0 if the current physical state of it cannot +be determined. + +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/acpi/device_pm.c | 23 ++++++++++++++++++----- + 1 file changed, 18 insertions(+), 5 deletions(-) + +--- a/drivers/acpi/device_pm.c ++++ b/drivers/acpi/device_pm.c +@@ -295,14 +295,27 @@ int acpi_bus_update_power(acpi_handle ha + if (result) + return result; + +- if (state == ACPI_STATE_UNKNOWN) ++ if (state == ACPI_STATE_UNKNOWN) { + state = ACPI_STATE_D0; +- +- result = acpi_device_set_power(device, state); +- if (!result && state_p) ++ result = acpi_device_set_power(device, state); ++ if (result) ++ return result; ++ } else { ++ if (device->power.flags.power_resources) { ++ /* ++ * We don't need to really switch the state, bu we need ++ * to update the power resources' reference counters. ++ */ ++ result = acpi_power_transition(device, state); ++ if (result) ++ return result; ++ } ++ device->power.state = state; ++ } ++ if (state_p) + *state_p = state; + +- return result; ++ return 0; + } + EXPORT_SYMBOL_GPL(acpi_bus_update_power); + diff --git a/queue-3.9/acpica-do-not-use-extended-sleep-registers-unless-hw-reduced-bit-is-set.patch b/queue-3.9/acpica-do-not-use-extended-sleep-registers-unless-hw-reduced-bit-is-set.patch new file mode 100644 index 00000000000..c431bcc5f84 --- /dev/null +++ b/queue-3.9/acpica-do-not-use-extended-sleep-registers-unless-hw-reduced-bit-is-set.patch @@ -0,0 +1,48 @@ +From 7cec7048fe22e3e92389da2cd67098f6c4284e7f Mon Sep 17 00:00:00 2001 +From: Lv Zheng +Date: Sat, 8 Jun 2013 00:59:18 +0000 +Subject: ACPICA: Do not use extended sleep registers unless HW-reduced bit is set + +From: Lv Zheng + +commit 7cec7048fe22e3e92389da2cd67098f6c4284e7f upstream. + +Previous implementation incorrectly used the ACPI 5.0 extended +sleep registers if they were simply populated. This caused +problems on some non-HW-reduced machines. As per the ACPI spec, +they should only be used if the HW-reduced bit is set. Lv Zheng, +ACPICA BZ 1020. + +References: https://bugzilla.kernel.org/show_bug.cgi?id=54181 +References: https://bugs.acpica.org/show_bug.cgi?id=1020 +Reported-by: Daniel Rowe +Bisected-by: Brint E. Kriebel +Signed-off-by: Lv Zheng +Signed-off-by: Bob Moore +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/acpi/acpica/hwxfsleep.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +--- a/drivers/acpi/acpica/hwxfsleep.c ++++ b/drivers/acpi/acpica/hwxfsleep.c +@@ -240,12 +240,14 @@ static acpi_status acpi_hw_sleep_dispatc + &acpi_sleep_dispatch[function_id]; + + #if (!ACPI_REDUCED_HARDWARE) +- + /* + * If the Hardware Reduced flag is set (from the FADT), we must +- * use the extended sleep registers ++ * use the extended sleep registers (FADT). Note: As per the ACPI ++ * specification, these extended registers are to be used for HW-reduced ++ * platforms only. They are not general-purpose replacements for the ++ * legacy PM register sleep support. + */ +- if (acpi_gbl_reduced_hardware || acpi_gbl_FADT.sleep_control.address) { ++ if (acpi_gbl_reduced_hardware) { + status = sleep_functions->extended_function(sleep_state); + } else { + /* Legacy sleep */ diff --git a/queue-3.9/ahci-remove-pmp-link-online-check-in-fbs-eh.patch b/queue-3.9/ahci-remove-pmp-link-online-check-in-fbs-eh.patch new file mode 100644 index 00000000000..40651f40cb1 --- /dev/null +++ b/queue-3.9/ahci-remove-pmp-link-online-check-in-fbs-eh.patch @@ -0,0 +1,34 @@ +From 912b9ac683b112615d5605686f1dc086402ce9f7 Mon Sep 17 00:00:00 2001 +From: Shane Huang +Date: Sat, 8 Jun 2013 16:00:16 +0800 +Subject: ahci: remove pmp link online check in FBS EH + +From: Shane Huang + +commit 912b9ac683b112615d5605686f1dc086402ce9f7 upstream. + +ata_link_online() check in ahci_error_intr() is unnecessary, it should +be removed otherwise may lead to lockup with FBS enabled PMP. +http://marc.info/?l=linux-ide&m=137050421603272&w=2 + +Reported-by: Yu Liu +Signed-off-by: Shane Huang +Signed-off-by: Tejun Heo +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/ata/libahci.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/drivers/ata/libahci.c ++++ b/drivers/ata/libahci.c +@@ -1560,8 +1560,7 @@ static void ahci_error_intr(struct ata_p + u32 fbs = readl(port_mmio + PORT_FBS); + int pmp = fbs >> PORT_FBS_DWE_OFFSET; + +- if ((fbs & PORT_FBS_SDE) && (pmp < ap->nr_pmp_links) && +- ata_link_online(&ap->pmp_link[pmp])) { ++ if ((fbs & PORT_FBS_SDE) && (pmp < ap->nr_pmp_links)) { + link = &ap->pmp_link[pmp]; + fbs_need_dec = true; + } diff --git a/queue-3.9/btrfs-fix-estale-with-btrfs-send.patch b/queue-3.9/btrfs-fix-estale-with-btrfs-send.patch new file mode 100644 index 00000000000..ded9cfab47d --- /dev/null +++ b/queue-3.9/btrfs-fix-estale-with-btrfs-send.patch @@ -0,0 +1,73 @@ +From 139f807a1eba1e484941a98fb93ee32ad859a6a1 Mon Sep 17 00:00:00 2001 +From: Josef Bacik +Date: Mon, 20 May 2013 11:26:50 -0400 +Subject: Btrfs: fix estale with btrfs send + +From: Josef Bacik + +commit 139f807a1eba1e484941a98fb93ee32ad859a6a1 upstream. + +This fixes bugzilla 57491. If we take a snapshot of a fs with a unlink ongoing +and then try to send that root we will run into problems. When comparing with a +parent root we will search the parents and the send roots commit_root, which if +we've just created the snapshot will include the file that needs to be evicted +by the orphan cleanup. So when we find a changed extent we will try and copy +that info into the send stream, but when we lookup the inode we use the normal +root, which no longer has the inode because the orphan cleanup deleted it. The +best solution I have for this is to check our otransid with the generation of +the commit root and if they match just commit the transaction again, that way we +get the changes from the orphan cleanup. With this patch the reproducer I made +for this bugzilla no longer returns ESTALE when trying to do the send. Thanks, + +Reported-by: Chris Wilson +Signed-off-by: Josef Bacik +Signed-off-by: Greg Kroah-Hartman + +--- + fs/btrfs/send.c | 35 +++++++++++++++++++++++++++++++++++ + 1 file changed, 35 insertions(+) + +--- a/fs/btrfs/send.c ++++ b/fs/btrfs/send.c +@@ -4579,6 +4579,41 @@ long btrfs_ioctl_send(struct file *mnt_f + send_root = BTRFS_I(file_inode(mnt_file))->root; + fs_info = send_root->fs_info; + ++ /* ++ * This is done when we lookup the root, it should already be complete ++ * by the time we get here. ++ */ ++ WARN_ON(send_root->orphan_cleanup_state != ORPHAN_CLEANUP_DONE); ++ ++ /* ++ * If we just created this root we need to make sure that the orphan ++ * cleanup has been done and committed since we search the commit root, ++ * so check its commit root transid with our otransid and if they match ++ * commit the transaction to make sure everything is updated. ++ */ ++ down_read(&send_root->fs_info->extent_commit_sem); ++ if (btrfs_header_generation(send_root->commit_root) == ++ btrfs_root_otransid(&send_root->root_item)) { ++ struct btrfs_trans_handle *trans; ++ ++ up_read(&send_root->fs_info->extent_commit_sem); ++ ++ trans = btrfs_attach_transaction_barrier(send_root); ++ if (IS_ERR(trans)) { ++ if (PTR_ERR(trans) != -ENOENT) { ++ ret = PTR_ERR(trans); ++ goto out; ++ } ++ /* ENOENT means theres no transaction */ ++ } else { ++ ret = btrfs_commit_transaction(trans, send_root); ++ if (ret) ++ goto out; ++ } ++ } else { ++ up_read(&send_root->fs_info->extent_commit_sem); ++ } ++ + arg = memdup_user(arg_, sizeof(*arg)); + if (IS_ERR(arg)) { + ret = PTR_ERR(arg); diff --git a/queue-3.9/btrfs-only-do-the-tree_mod_log_free_eb-if-this-is-our-last.patch b/queue-3.9/btrfs-only-do-the-tree_mod_log_free_eb-if-this-is-our-last.patch new file mode 100644 index 00000000000..e98ce0976ae --- /dev/null +++ b/queue-3.9/btrfs-only-do-the-tree_mod_log_free_eb-if-this-is-our-last.patch @@ -0,0 +1,38 @@ +From 7fb7d76f96bfcbea25007d190ba828b18e13d29d Mon Sep 17 00:00:00 2001 +From: Josef Bacik +Date: Mon, 1 Jul 2013 16:10:16 -0400 +Subject: Btrfs: only do the tree_mod_log_free_eb if this is our last + ref + +From: Josef Bacik + +commit 7fb7d76f96bfcbea25007d190ba828b18e13d29d upstream. + +There is another bug in the tree mod log stuff in that we're calling +tree_mod_log_free_eb every single time a block is cow'ed. The problem with this +is that if this block is shared by multiple snapshots we will call this multiple +times per block, so if we go to rewind the mod log for this block we'll BUG_ON() +in __tree_mod_log_rewind because we try to rewind a free twice. We only want to +call tree_mod_log_free_eb if we are actually freeing the block. With this patch +I no longer hit the panic in __tree_mod_log_rewind. Thanks, + +Reviewed-by: Jan Schmidt +Signed-off-by: Josef Bacik +Signed-off-by: Greg Kroah-Hartman + +--- + fs/btrfs/ctree.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/fs/btrfs/ctree.c ++++ b/fs/btrfs/ctree.c +@@ -1049,7 +1049,8 @@ static noinline int __btrfs_cow_block(st + btrfs_set_node_ptr_generation(parent, parent_slot, + trans->transid); + btrfs_mark_buffer_dirty(parent); +- tree_mod_log_free_eb(root->fs_info, buf); ++ if (last_ref) ++ tree_mod_log_free_eb(root->fs_info, buf); + btrfs_free_tree_block(trans, root, buf, parent_start, + last_ref); + } diff --git a/queue-3.9/drivers-rtc-rtc-rv3029c2.c-fix-disabling-aie-irq.patch b/queue-3.9/drivers-rtc-rtc-rv3029c2.c-fix-disabling-aie-irq.patch new file mode 100644 index 00000000000..45fdf9a28a4 --- /dev/null +++ b/queue-3.9/drivers-rtc-rtc-rv3029c2.c-fix-disabling-aie-irq.patch @@ -0,0 +1,34 @@ +From 29ecd78c0fd6ee05f2c6b07b23823a6ae43c13ff Mon Sep 17 00:00:00 2001 +From: Axel Lin +Date: Wed, 3 Jul 2013 15:06:45 -0700 +Subject: drivers/rtc/rtc-rv3029c2.c: fix disabling AIE irq + +From: Axel Lin + +commit 29ecd78c0fd6ee05f2c6b07b23823a6ae43c13ff upstream. + +In the disable AIE irq code path, current code passes "1" to enable +parameter of rv3029c2_rtc_i2c_alarm_set_irq(). Thus it does not disable +AIE irq. + +Signed-off-by: Axel Lin +Acked-by: Heiko Schocher +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/rtc/rtc-rv3029c2.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/rtc/rtc-rv3029c2.c ++++ b/drivers/rtc/rtc-rv3029c2.c +@@ -310,7 +310,7 @@ static int rv3029c2_rtc_i2c_set_alarm(st + dev_dbg(&client->dev, "alarm IRQ armed\n"); + } else { + /* disable AIE irq */ +- ret = rv3029c2_rtc_i2c_alarm_set_irq(client, 1); ++ ret = rv3029c2_rtc_i2c_alarm_set_irq(client, 0); + if (ret) + return ret; + diff --git a/queue-3.9/ext4-check-error-return-from-ext4_write_inline_data_end.patch b/queue-3.9/ext4-check-error-return-from-ext4_write_inline_data_end.patch deleted file mode 100644 index 86229632833..00000000000 --- a/queue-3.9/ext4-check-error-return-from-ext4_write_inline_data_end.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 42c832debbbf819f6c4ad8601baa559c44105ba4 Mon Sep 17 00:00:00 2001 -From: Theodore Ts'o -Date: Mon, 1 Jul 2013 08:12:39 -0400 -Subject: ext4: check error return from ext4_write_inline_data_end() - -From: Theodore Ts'o - -commit 42c832debbbf819f6c4ad8601baa559c44105ba4 upstream. - -The function ext4_write_inline_data_end() can return an error. So we -need to assign it to a signed integer variable to check for an error -return (since copied is an unsigned int). - -Signed-off-by: "Theodore Ts'o" -Cc: Zheng Liu -Signed-off-by: Greg Kroah-Hartman - ---- - fs/ext4/inode.c | 11 +++++++---- - 1 file changed, 7 insertions(+), 4 deletions(-) - ---- a/fs/ext4/inode.c -+++ b/fs/ext4/inode.c -@@ -1095,10 +1095,13 @@ static int ext4_generic_write_end(struct - struct inode *inode = mapping->host; - handle_t *handle = ext4_journal_current_handle(); - -- if (ext4_has_inline_data(inode)) -- copied = ext4_write_inline_data_end(inode, pos, len, -- copied, page); -- else -+ if (ext4_has_inline_data(inode)) { -+ ret = ext4_write_inline_data_end(inode, pos, len, -+ copied, page); -+ if (ret < 0) -+ goto errout; -+ copied = ret; -+ } else - copied = block_write_end(file, mapping, pos, - len, copied, page, fsdata); - diff --git a/queue-3.9/genirq-fix-can_request_irq-for-irqs-without-an-action.patch b/queue-3.9/genirq-fix-can_request_irq-for-irqs-without-an-action.patch new file mode 100644 index 00000000000..3eaca8327dc --- /dev/null +++ b/queue-3.9/genirq-fix-can_request_irq-for-irqs-without-an-action.patch @@ -0,0 +1,44 @@ +From 2779db8d37d4b542d9ca2575f5f178dbeaca6c86 Mon Sep 17 00:00:00 2001 +From: Ben Hutchings +Date: Fri, 28 Jun 2013 02:40:30 +0100 +Subject: genirq: Fix can_request_irq() for IRQs without an action + +From: Ben Hutchings + +commit 2779db8d37d4b542d9ca2575f5f178dbeaca6c86 upstream. + +Commit 02725e7471b8 ('genirq: Use irq_get/put functions'), +inadvertently changed can_request_irq() to return 0 for IRQs that have +no action. This causes pcibios_lookup_irq() to select only IRQs that +already have an action with IRQF_SHARED set, or to fail if there are +none. Change can_request_irq() to return 1 for IRQs that have no +action (if the first two conditions are met). + +Reported-by: Bjarni Ingi Gislason +Tested-by: Bjarni Ingi Gislason (against 3.2) +Signed-off-by: Ben Hutchings +Cc: 709647@bugs.debian.org +Link: http://bugs.debian.org/709647 +Link: http://lkml.kernel.org/r/1372383630.23847.40.camel@deadeye.wl.decadent.org.uk +Signed-off-by: Thomas Gleixner +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/irq/manage.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/kernel/irq/manage.c ++++ b/kernel/irq/manage.c +@@ -555,9 +555,9 @@ int can_request_irq(unsigned int irq, un + return 0; + + if (irq_settings_can_request(desc)) { +- if (desc->action) +- if (irqflags & desc->action->flags & IRQF_SHARED) +- canrequest =1; ++ if (!desc->action || ++ irqflags & desc->action->flags & IRQF_SHARED) ++ canrequest = 1; + } + irq_put_desc_unlock(desc, flags); + return canrequest; diff --git a/queue-3.9/nbd-correct-disconnect-behavior.patch b/queue-3.9/nbd-correct-disconnect-behavior.patch new file mode 100644 index 00000000000..08fb212d4b2 --- /dev/null +++ b/queue-3.9/nbd-correct-disconnect-behavior.patch @@ -0,0 +1,73 @@ +From c378f70adbc1bbecd9e6db145019f14b2f688c7c Mon Sep 17 00:00:00 2001 +From: Paul Clements +Date: Wed, 3 Jul 2013 15:09:04 -0700 +Subject: nbd: correct disconnect behavior + +From: Paul Clements + +commit c378f70adbc1bbecd9e6db145019f14b2f688c7c upstream. + +Currently, when a disconnect is requested by the user (via NBD_DISCONNECT +ioctl) the return from NBD_DO_IT is undefined (it is usually one of +several error codes). This means that nbd-client does not know if a +manual disconnect was performed or whether a network error occurred. +Because of this, nbd-client's persist mode (which tries to reconnect after +error, but not after manual disconnect) does not always work correctly. + +This change fixes this by causing NBD_DO_IT to always return 0 if a user +requests a disconnect. This means that nbd-client can correctly either +persist the connection (if an error occurred) or disconnect (if the user +requested it). + +Signed-off-by: Paul Clements +Acked-by: Rob Landley +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/block/nbd.c | 7 ++++++- + include/linux/nbd.h | 1 + + 2 files changed, 7 insertions(+), 1 deletion(-) + +--- a/drivers/block/nbd.c ++++ b/drivers/block/nbd.c +@@ -623,8 +623,10 @@ static int __nbd_ioctl(struct block_devi + if (!nbd->sock) + return -EINVAL; + ++ nbd->disconnect = 1; ++ + nbd_send_req(nbd, &sreq); +- return 0; ++ return 0; + } + + case NBD_CLEAR_SOCK: { +@@ -654,6 +656,7 @@ static int __nbd_ioctl(struct block_devi + nbd->sock = SOCKET_I(inode); + if (max_part > 0) + bdev->bd_invalidated = 1; ++ nbd->disconnect = 0; /* we're connected now */ + return 0; + } else { + fput(file); +@@ -743,6 +746,8 @@ static int __nbd_ioctl(struct block_devi + set_capacity(nbd->disk, 0); + if (max_part > 0) + ioctl_by_bdev(bdev, BLKRRPART, 0); ++ if (nbd->disconnect) /* user requested, ignore socket errors */ ++ return 0; + return nbd->harderror; + } + +--- a/include/linux/nbd.h ++++ b/include/linux/nbd.h +@@ -41,6 +41,7 @@ struct nbd_device { + u64 bytesize; + pid_t pid; /* pid of nbd-client, if attached */ + int xmit_timeout; ++ int disconnect; /* a disconnect has been requested by user */ + }; + + #endif diff --git a/queue-3.9/ocfs2-xattr-fix-inlined-xattr-reflink.patch b/queue-3.9/ocfs2-xattr-fix-inlined-xattr-reflink.patch new file mode 100644 index 00000000000..6e110d8c002 --- /dev/null +++ b/queue-3.9/ocfs2-xattr-fix-inlined-xattr-reflink.patch @@ -0,0 +1,83 @@ +From ef962df057aaafd714f5c22ba3de1be459571fdf Mon Sep 17 00:00:00 2001 +From: Junxiao Bi +Date: Wed, 3 Jul 2013 15:01:03 -0700 +Subject: ocfs2: xattr: fix inlined xattr reflink + +From: Junxiao Bi + +commit ef962df057aaafd714f5c22ba3de1be459571fdf upstream. + +Inlined xattr shared free space of inode block with inlined data or data +extent record, so the size of the later two should be adjusted when +inlined xattr is enabled. See ocfs2_xattr_ibody_init(). But this isn't +done well when reflink. For inode with inlined data, its max inlined +data size is adjusted in ocfs2_duplicate_inline_data(), no problem. But +for inode with data extent record, its record count isn't adjusted. Fix +it, or data extent record and inlined xattr may overwrite each other, +then cause data corruption or xattr failure. + +One panic caused by this bug in our test environment is the following: + + kernel BUG at fs/ocfs2/xattr.c:1435! + invalid opcode: 0000 [#1] SMP + Pid: 10871, comm: multi_reflink_t Not tainted 2.6.39-300.17.1.el5uek #1 + RIP: ocfs2_xa_offset_pointer+0x17/0x20 [ocfs2] + RSP: e02b:ffff88007a587948 EFLAGS: 00010283 + RAX: 0000000000000000 RBX: 0000000000000010 RCX: 00000000000051e4 + RDX: ffff880057092060 RSI: 0000000000000f80 RDI: ffff88007a587a68 + RBP: ffff88007a587948 R08: 00000000000062f4 R09: 0000000000000000 + R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000010 + R13: ffff88007a587a68 R14: 0000000000000001 R15: ffff88007a587c68 + FS: 00007fccff7f06e0(0000) GS:ffff88007fc00000(0000) knlGS:0000000000000000 + CS: e033 DS: 0000 ES: 0000 CR0: 000000008005003b + CR2: 00000000015cf000 CR3: 000000007aa76000 CR4: 0000000000000660 + DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 + DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 + Process multi_reflink_t + Call Trace: + ocfs2_xa_reuse_entry+0x60/0x280 [ocfs2] + ocfs2_xa_prepare_entry+0x17e/0x2a0 [ocfs2] + ocfs2_xa_set+0xcc/0x250 [ocfs2] + ocfs2_xattr_ibody_set+0x98/0x230 [ocfs2] + __ocfs2_xattr_set_handle+0x4f/0x700 [ocfs2] + ocfs2_xattr_set+0x6c6/0x890 [ocfs2] + ocfs2_xattr_user_set+0x46/0x50 [ocfs2] + generic_setxattr+0x70/0x90 + __vfs_setxattr_noperm+0x80/0x1a0 + vfs_setxattr+0xa9/0xb0 + setxattr+0xc3/0x120 + sys_fsetxattr+0xa8/0xd0 + system_call_fastpath+0x16/0x1b + +Signed-off-by: Junxiao Bi +Reviewed-by: Jie Liu +Acked-by: Joel Becker +Cc: Mark Fasheh +Cc: Sunil Mushran +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + fs/ocfs2/xattr.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +--- a/fs/ocfs2/xattr.c ++++ b/fs/ocfs2/xattr.c +@@ -6499,6 +6499,16 @@ static int ocfs2_reflink_xattr_inline(st + } + + new_oi = OCFS2_I(args->new_inode); ++ /* ++ * Adjust extent record count to reserve space for extended attribute. ++ * Inline data count had been adjusted in ocfs2_duplicate_inline_data(). ++ */ ++ if (!(new_oi->ip_dyn_features & OCFS2_INLINE_DATA_FL) && ++ !(ocfs2_inode_is_fast_symlink(args->new_inode))) { ++ struct ocfs2_extent_list *el = &new_di->id2.i_list; ++ le16_add_cpu(&el->l_count, -(inline_size / ++ sizeof(struct ocfs2_extent_rec))); ++ } + spin_lock(&new_oi->ip_lock); + new_oi->ip_dyn_features |= OCFS2_HAS_XATTR_FL | OCFS2_INLINE_XATTR_FL; + new_di->i_dyn_features = cpu_to_le16(new_oi->ip_dyn_features); diff --git a/queue-3.9/pci-finish-sr-iov-vf-setup-before-adding-the-device.patch b/queue-3.9/pci-finish-sr-iov-vf-setup-before-adding-the-device.patch new file mode 100644 index 00000000000..5badedf4eb6 --- /dev/null +++ b/queue-3.9/pci-finish-sr-iov-vf-setup-before-adding-the-device.patch @@ -0,0 +1,50 @@ +From fbf33f516bdbcc2ab1ba1e54dfb720b0cfaa6874 Mon Sep 17 00:00:00 2001 +From: Xudong Hao +Date: Fri, 31 May 2013 12:21:29 +0800 +Subject: PCI: Finish SR-IOV VF setup before adding the device + +From: Xudong Hao + +commit fbf33f516bdbcc2ab1ba1e54dfb720b0cfaa6874 upstream. + +Commit 4f535093cf "PCI: Put pci_dev in device tree as early as possible" +moves device registering from pci_bus_add_devices() to pci_device_add(). +That causes problems for virtual functions because device_add(&virtfn->dev) +is called before setting the virtfn->is_virtfn flag, which then causes Xen +to report PCI virtual functions as PCI physical functions. + +Fix it by setting virtfn->is_virtfn before calling pci_device_add(). + +[Jiang Liu]: Move the setting of virtfn->is_virtfn ahead further for better +readability and modify changelog. + +Signed-off-by: Xudong Hao +Signed-off-by: Jiang Liu +Signed-off-by: Bjorn Helgaas +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/pci/iov.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +--- a/drivers/pci/iov.c ++++ b/drivers/pci/iov.c +@@ -92,6 +92,8 @@ static int virtfn_add(struct pci_dev *de + pci_read_config_word(dev, iov->pos + PCI_SRIOV_VF_DID, &virtfn->device); + pci_setup_device(virtfn); + virtfn->dev.parent = dev->dev.parent; ++ virtfn->physfn = pci_dev_get(dev); ++ virtfn->is_virtfn = 1; + + for (i = 0; i < PCI_SRIOV_NUM_BARS; i++) { + res = dev->resource + PCI_IOV_RESOURCES + i; +@@ -113,9 +115,6 @@ static int virtfn_add(struct pci_dev *de + pci_device_add(virtfn, virtfn->bus); + mutex_unlock(&iov->dev->sriov->lock); + +- virtfn->physfn = pci_dev_get(dev); +- virtfn->is_virtfn = 1; +- + rc = pci_bus_add_device(virtfn); + sprintf(buf, "virtfn%u", id); + rc = sysfs_create_link(&dev->dev.kobj, &virtfn->dev.kobj, buf); diff --git a/queue-3.9/pci-fix-refcount-issue-in-pci_create_root_bus-error-recovery-path.patch b/queue-3.9/pci-fix-refcount-issue-in-pci_create_root_bus-error-recovery-path.patch new file mode 100644 index 00000000000..f7a05cd7531 --- /dev/null +++ b/queue-3.9/pci-fix-refcount-issue-in-pci_create_root_bus-error-recovery-path.patch @@ -0,0 +1,54 @@ +From 343df771e671d821478dd3ef525a0610b808dbf8 Mon Sep 17 00:00:00 2001 +From: Jiang Liu +Date: Fri, 7 Jun 2013 01:10:08 +0800 +Subject: PCI: Fix refcount issue in pci_create_root_bus() error recovery path + +From: Jiang Liu + +commit 343df771e671d821478dd3ef525a0610b808dbf8 upstream. + +After calling device_register(&bridge->dev), the bridge is reference- +counted, and it is illegal to call kfree() on it except in the release +function. + +[bhelgaas: changelog, use put_device() after device_register() failure] +Signed-off-by: Jiang Liu +Signed-off-by: Bjorn Helgaas +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/pci/probe.c | 14 ++++++++------ + 1 file changed, 8 insertions(+), 6 deletions(-) + +--- a/drivers/pci/probe.c ++++ b/drivers/pci/probe.c +@@ -1694,12 +1694,16 @@ struct pci_bus *pci_create_root_bus(stru + bridge->dev.release = pci_release_bus_bridge_dev; + dev_set_name(&bridge->dev, "pci%04x:%02x", pci_domain_nr(b), bus); + error = pcibios_root_bridge_prepare(bridge); +- if (error) +- goto bridge_dev_reg_err; ++ if (error) { ++ kfree(bridge); ++ goto err_out; ++ } + + error = device_register(&bridge->dev); +- if (error) +- goto bridge_dev_reg_err; ++ if (error) { ++ put_device(&bridge->dev); ++ goto err_out; ++ } + b->bridge = get_device(&bridge->dev); + device_enable_async_suspend(b->bridge); + pci_set_bus_of_node(b); +@@ -1753,8 +1757,6 @@ struct pci_bus *pci_create_root_bus(stru + class_dev_reg_err: + put_device(&bridge->dev); + device_unregister(&bridge->dev); +-bridge_dev_reg_err: +- kfree(bridge); + err_out: + kfree(b); + return NULL; diff --git a/queue-3.9/series b/queue-3.9/series index 5f40419a78c..f3f8d9ca172 100644 --- a/queue-3.9/series +++ b/queue-3.9/series @@ -6,10 +6,24 @@ jbd2-move-superblock-checksum-calculation-to-jbd2_write_superblock.patch jbd2-fix-theoretical-race-in-jbd2__journal_restart.patch ext4-fix-corruption-when-online-resizing-a-fs-with-1k-block-size.patch ext3-ext4-don-t-mess-with-dir_file-f_pos-in-htree_dirblock_to_tree.patch -ext4-check-error-return-from-ext4_write_inline_data_end.patch usb-gadget-f_mass_storage-add-missing-memory-barrier-for-thread_wakeup_needed.patch xhci-check-for-failed-dma-pool-allocation.patch usb-host-xhci-plat-release-mem-region-while-removing-module.patch drivers-hv-switch-to-use-mb-instead-of-smp_mb.patch pcmcia-at91_cf-fix-gpio_get_value-in-at91_cf_get_status.patch cgroup-fix-umount-vs-cgroup_event_remove-race.patch +xen-time-remove-blocked-time-accounting-from-xen-clockchip.patch +xen-pcifront-deal-with-toolstack-missing-xenbusstateclosing-state.patch +genirq-fix-can_request_irq-for-irqs-without-an-action.patch +drivers-rtc-rtc-rv3029c2.c-fix-disabling-aie-irq.patch +acpi-ec-add-hp-folio-13-to-ec_dmi_table-in-order-to-skip-dsdt-scan.patch +acpica-do-not-use-extended-sleep-registers-unless-hw-reduced-bit-is-set.patch +acpi-pm-fix-corner-case-in-acpi_bus_update_power.patch +ocfs2-xattr-fix-inlined-xattr-reflink.patch +nbd-correct-disconnect-behavior.patch +pci-finish-sr-iov-vf-setup-before-adding-the-device.patch +pci-fix-refcount-issue-in-pci_create_root_bus-error-recovery-path.patch +ahci-remove-pmp-link-online-check-in-fbs-eh.patch +timer-fix-jiffies-wrap-behavior-of-round_jiffies_common.patch +btrfs-fix-estale-with-btrfs-send.patch +btrfs-only-do-the-tree_mod_log_free_eb-if-this-is-our-last.patch diff --git a/queue-3.9/timer-fix-jiffies-wrap-behavior-of-round_jiffies_common.patch b/queue-3.9/timer-fix-jiffies-wrap-behavior-of-round_jiffies_common.patch new file mode 100644 index 00000000000..d69cf10d56f --- /dev/null +++ b/queue-3.9/timer-fix-jiffies-wrap-behavior-of-round_jiffies_common.patch @@ -0,0 +1,40 @@ +From 9e04d3804d3ac97d8c03a41d78d0f0674b5d01e1 Mon Sep 17 00:00:00 2001 +From: Bart Van Assche +Date: Tue, 21 May 2013 20:43:50 +0200 +Subject: timer: Fix jiffies wrap behavior of round_jiffies_common() + +From: Bart Van Assche + +commit 9e04d3804d3ac97d8c03a41d78d0f0674b5d01e1 upstream. + +Direct compare of jiffies related values does not work in the wrap +around case. Replace it with time_is_after_jiffies(). + +Signed-off-by: Bart Van Assche +Cc: Arjan van de Ven +Cc: Stephen Rothwell +Link: http://lkml.kernel.org/r/519BC066.5080600@acm.org +Signed-off-by: Thomas Gleixner +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/timer.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +--- a/kernel/timer.c ++++ b/kernel/timer.c +@@ -148,9 +148,11 @@ static unsigned long round_jiffies_commo + /* now that we have rounded, subtract the extra skew again */ + j -= cpu * 3; + +- if (j <= jiffies) /* rounding ate our timeout entirely; */ +- return original; +- return j; ++ /* ++ * Make sure j is still in the future. Otherwise return the ++ * unmodified value. ++ */ ++ return time_is_after_jiffies(j) ? j : original; + } + + /** diff --git a/queue-3.9/xen-pcifront-deal-with-toolstack-missing-xenbusstateclosing-state.patch b/queue-3.9/xen-pcifront-deal-with-toolstack-missing-xenbusstateclosing-state.patch new file mode 100644 index 00000000000..40bf0cd009d --- /dev/null +++ b/queue-3.9/xen-pcifront-deal-with-toolstack-missing-xenbusstateclosing-state.patch @@ -0,0 +1,91 @@ +From 098b1aeaf4d6149953b8f1f8d55c21d85536fbff Mon Sep 17 00:00:00 2001 +From: Konrad Rzeszutek Wilk +Date: Mon, 10 Jun 2013 16:48:09 -0400 +Subject: xen/pcifront: Deal with toolstack missing 'XenbusStateClosing' state. + +From: Konrad Rzeszutek Wilk + +commit 098b1aeaf4d6149953b8f1f8d55c21d85536fbff upstream. + +There are two tool-stack that can instruct the Xen PCI frontend +and backend to change states: 'xm' (Python code with a daemon), +and 'xl' (C library - does not keep state changes). + +With the 'xm', the path to disconnect a single PCI device (xm pci-detach + ) is: + +4(Connected)->7(Reconfiguring*)-> 8(Reconfigured)-> 4(Connected)->5(Closing*). + +The * is for states that the tool-stack sets. For 'xl', it is similar: + +4(Connected)->7(Reconfiguring*)-> 8(Reconfigured)-> 4(Connected) + +Both of them also tear down the XenBus structure, so the backend +state ends up going in the 3(Initialised) and calls pcifront_xenbus_remove. + +When a PCI device is plugged back in (xm pci-attach ) +both of them follow the same pattern: + +2(InitWait*), 3(Initialized*), 4(Connected*)->4(Connected). + +[xen-pcifront ignores the 2,3 state changes and only acts when +4 (Connected) has been reached] + +Note that this is for a _single_ PCI device. If there were two +PCI devices and only one was disconnected 'xm' would show the same +state changes. + +The problem is that git commit 3d925320e9e2de162bd138bf97816bda8c3f71be +("xen/pcifront: Use Xen-SWIOTLB when initting if required") introduced +a mechanism to initialize the SWIOTLB when the Xen PCI front moves to +Connected state. It also had some aggressive seatbelt code check that +would warn the user if one tried to change to Connected state without +hitting first the Closing state: + + pcifront pci-0: PCI frontend already installed! + +However, that code can be relaxed and we can continue on working +even if the frontend is instructed to be the 'Connected' state with +no devices and then gets tickled to be in 'Connected' state again. + +In other words, this 4(Connected)->5(Closing)->4(Connected) state +was expected, while 4(Connected)->.... anything but 5(Closing)->4(Connected) +was not. This patch removes that aggressive check and allows +Xen pcifront to work with the 'xl' toolstack (for one or more +PCI devices) and with 'xm' toolstack (for more than two PCI +devices). + +Acked-by: Bjorn Helgaas +Cc: linux-pci@vger.kernel.org +[v2: Added in the description about two PCI devices] +Signed-off-by: Konrad Rzeszutek Wilk +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/pci/xen-pcifront.c | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +--- a/drivers/pci/xen-pcifront.c ++++ b/drivers/pci/xen-pcifront.c +@@ -678,10 +678,9 @@ static int pcifront_connect_and_init_dma + if (!pcifront_dev) { + dev_info(&pdev->xdev->dev, "Installing PCI frontend\n"); + pcifront_dev = pdev; +- } else { +- dev_err(&pdev->xdev->dev, "PCI frontend already installed!\n"); ++ } else + err = -EEXIST; +- } ++ + spin_unlock(&pcifront_dev_lock); + + if (!err && !swiotlb_nr_tbl()) { +@@ -848,7 +847,7 @@ static int pcifront_try_connect(struct p + goto out; + + err = pcifront_connect_and_init_dma(pdev); +- if (err) { ++ if (err && err != -EEXIST) { + xenbus_dev_fatal(pdev->xdev, err, + "Error setting up PCI Frontend"); + goto out; diff --git a/queue-3.9/xen-time-remove-blocked-time-accounting-from-xen-clockchip.patch b/queue-3.9/xen-time-remove-blocked-time-accounting-from-xen-clockchip.patch new file mode 100644 index 00000000000..9adc37e4e04 --- /dev/null +++ b/queue-3.9/xen-time-remove-blocked-time-accounting-from-xen-clockchip.patch @@ -0,0 +1,83 @@ +From 0b0c002c340e78173789f8afaa508070d838cf3d Mon Sep 17 00:00:00 2001 +From: Laszlo Ersek +Date: Tue, 18 Oct 2011 22:42:59 +0200 +Subject: xen/time: remove blocked time accounting from xen "clockchip" + +From: Laszlo Ersek + +commit 0b0c002c340e78173789f8afaa508070d838cf3d upstream. + +... because the "clock_event_device framework" already accounts for idle +time through the "event_handler" function pointer in +xen_timer_interrupt(). + +The patch is intended as the completion of [1]. It should fix the double +idle times seen in PV guests' /proc/stat [2]. It should be orthogonal to +stolen time accounting (the removed code seems to be isolated). + +The approach may be completely misguided. + +[1] https://lkml.org/lkml/2011/10/6/10 +[2] http://lists.xensource.com/archives/html/xen-devel/2010-08/msg01068.html + +John took the time to retest this patch on top of v3.10 and reported: +"idle time is correctly incremented for pv and hvm for the normal +case, nohz=off and nohz=idle." so lets put this patch in. + +Signed-off-by: Laszlo Ersek +Signed-off-by: John Haxby +Signed-off-by: Konrad Rzeszutek Wilk +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/xen/time.c | 17 ++--------------- + 1 file changed, 2 insertions(+), 15 deletions(-) + +--- a/arch/x86/xen/time.c ++++ b/arch/x86/xen/time.c +@@ -36,9 +36,8 @@ static DEFINE_PER_CPU(struct vcpu_runsta + /* snapshots of runstate info */ + static DEFINE_PER_CPU(struct vcpu_runstate_info, xen_runstate_snapshot); + +-/* unused ns of stolen and blocked time */ ++/* unused ns of stolen time */ + static DEFINE_PER_CPU(u64, xen_residual_stolen); +-static DEFINE_PER_CPU(u64, xen_residual_blocked); + + /* return an consistent snapshot of 64-bit time/counter value */ + static u64 get64(const u64 *p) +@@ -115,7 +114,7 @@ static void do_stolen_accounting(void) + { + struct vcpu_runstate_info state; + struct vcpu_runstate_info *snap; +- s64 blocked, runnable, offline, stolen; ++ s64 runnable, offline, stolen; + cputime_t ticks; + + get_runstate_snapshot(&state); +@@ -125,7 +124,6 @@ static void do_stolen_accounting(void) + snap = &__get_cpu_var(xen_runstate_snapshot); + + /* work out how much time the VCPU has not been runn*ing* */ +- blocked = state.time[RUNSTATE_blocked] - snap->time[RUNSTATE_blocked]; + runnable = state.time[RUNSTATE_runnable] - snap->time[RUNSTATE_runnable]; + offline = state.time[RUNSTATE_offline] - snap->time[RUNSTATE_offline]; + +@@ -141,17 +139,6 @@ static void do_stolen_accounting(void) + ticks = iter_div_u64_rem(stolen, NS_PER_TICK, &stolen); + __this_cpu_write(xen_residual_stolen, stolen); + account_steal_ticks(ticks); +- +- /* Add the appropriate number of ticks of blocked time, +- including any left-overs from last time. */ +- blocked += __this_cpu_read(xen_residual_blocked); +- +- if (blocked < 0) +- blocked = 0; +- +- ticks = iter_div_u64_rem(blocked, NS_PER_TICK, &blocked); +- __this_cpu_write(xen_residual_blocked, blocked); +- account_idle_ticks(ticks); + } + + /* Get the TSC speed from Xen */