1. 05 2月, 2013 1 次提交
  2. 02 2月, 2013 3 次提交
  3. 31 1月, 2013 3 次提交
  4. 30 1月, 2013 2 次提交
  5. 26 1月, 2013 9 次提交
    • A
      USB: EHCI: fix timer bug affecting port resume · ee74290b
      Alan Stern 提交于
      This patch (as1652) fixes a long-standing bug in ehci-hcd.  The driver
      relies on status polls to know when to stop port-resume signalling.
      It uses the root-hub status timer to schedule these status polls.  But
      when the driver for the root hub is resumed, the timer is rescheduled
      to go off immediately -- before the port is ready.  When this happens
      the timer does not get re-enabled, which prevents the port resume from
      finishing until some other event occurs.
      
      The symptom is that when a new device is plugged in, it doesn't get
      recognized or enumerated until lsusb is run or something else happens.
      
      The solution is to re-enable the root-hub status timer after every
      status poll while a port resume is in progress.
      
      This bug hasn't surfaced before now because we never used to try to
      suspend the root hub in the middle of a port resume (except by
      coincidence).
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Reported-and-tested-by: NNorbert Preining <preining@logic.at>
      Tested-by: NMing Lei <ming.lei@canonical.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ee74290b
    • A
      USB: UHCI: notify usbcore about port resumes · 840008bb
      Alan Stern 提交于
      This patch (as1651) adds calls to the new
      usb_hcd_{start,end}_port_resume() functions to uhci-hcd.  Now UHCI
      root hubs won't be runtime suspended while they are sending a resume
      signal to one of their ports.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      840008bb
    • A
      USB: EHCI: notify usbcore about port resumes · f292e7f9
      Alan Stern 提交于
      This patch (as1650) adds calls to the new
      usb_hcd_{start,end}_port_resume() functions to ehci-hcd.  Now EHCI
      root hubs won't be runtime suspended while they are sending a resume
      signal to one of their ports.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Tested-by: NMing Lei <ming.lei@canonical.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f292e7f9
    • A
      USB: add usb_hcd_{start,end}_port_resume · da0aa716
      Alan Stern 提交于
      This patch (as1649) adds a mechanism for host controller drivers to
      inform usbcore when they have begun or ended resume signalling on a
      particular root-hub port.  The core will then make sure that the root
      hub does not get runtime-suspended while the port resume is going on.
      
      Since commit 596d789a (USB: set hub's
      default autosuspend delay as 0), the system tries to suspend hubs
      whenever they aren't in use.  While a root-hub port is being resumed,
      the root hub does not appear to be in use.  Attempted runtime suspends
      fail because of the ongoing port resume, but the PM core just keeps on
      trying over and over again.  We want to prevent this wasteful effort.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Tested-by: NMing Lei <ming.lei@canonical.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      da0aa716
    • A
      USB: EHCI: unlink one async QH at a time · 6e0c3339
      Alan Stern 提交于
      This patch (as1648) fixes a regression affecting nVidia EHCI
      controllers.  Evidently they don't like to have more than one async QH
      unlinked at a time.  I can't imagine how they manage to mess it up,
      but at least one of them does.
      
      The patch changes the async unlink logic in two ways:
      
      	Each time an IAA cycle is started, only the first QH on the
      	async unlink list is handled (rather than all of them).
      
      	Async QHs do not all get unlinked as soon as they have been
      	empty for long enough.  Instead, only the last one (i.e., the
      	one that has been on the schedule the longest) is unlinked,
      	and then only if no other unlinks are in progress at the time.
      
      This means that when multiple QHs are empty, they won't be unlinked as
      quickly as before.  That's okay; it won't affect correct operation of
      the driver or add an excessive load.  Multiple unlinks tend to be
      relatively rare in any case.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Reported-and-tested-by: NPiergiorgio Sartor <piergiorgio.sartor@nexgo.de>
      Cc: stable <stable@vger.kernel.org> # 3.6
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6e0c3339
    • A
      USB: EHCI: remove ASS/PSS polling timeout · 55bcdce8
      Alan Stern 提交于
      This patch (as1647) attempts to work around a problem that seems to
      affect some nVidia EHCI controllers.  They sometimes take a very long
      time to turn off their async or periodic schedules.  I don't know if
      this is a result of other problems, but in any case it seems wise not
      to depend on schedule enables or disables taking effect in any
      specific length of time.
      
      The patch removes the existing 20-ms timeout for enabling and
      disabling the schedules.  The driver will now continue to poll the
      schedule state at 1-ms intervals until the controller finally decides
      to obey the most recent command issued by the driver.  Just in case
      this hides a problem, a debugging message will be logged if the
      controller takes longer than 20 polls.
      
      I don't know if this will actually fix anything, but it can't hurt.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Tested-by: NPiergiorgio Sartor <piergiorgio.sartor@nexgo.de>
      CC: <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      55bcdce8
    • G
      Merge tag 'for-usb-linus-2012-01-24' of... · a28dde61
      Greg Kroah-Hartman 提交于
      Merge tag 'for-usb-linus-2012-01-24' of git://git.kernel.org/pub/scm/linux/kernel/git/sarah/xhci into usb-linus
      
      Sarah writes:
      	USB/xhci: Misc fixes for 3.8.
      
      	Hi Greg,
      
      	Here's six patches for xHCI and the USB core.  There's a couple of
      	patches to fix xHCI 1.0 field formats, some memory leaks, dead ports,
      	and USB 3.0 remote wakeup disabling.
      
      	All of these are marked for stable.
      
      	I know I owe you some re-works of failed stable patches from my last
      	patchset round, but I don't think I'm going to get to them before I head
      	off to Linux Conf Australia tomorrow.
      
      	Sarah Sharp
      a28dde61
    • L
      Linux 3.8-rc5 · 949db153
      Linus Torvalds 提交于
      949db153
    • L
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs · d7df025e
      Linus Torvalds 提交于
      Pull btrfs fixes from Chris Mason:
       "It turns out that we had two crc bugs when running fsx-linux in a
        loop.  Many thanks to Josef, Miao Xie, and Dave Sterba for nailing it
        all down.  Miao also has a new OOM fix in this v2 pull as well.
      
        Ilya fixed a regression Liu Bo found in the balance ioctls for pausing
        and resuming a running balance across drives.
      
        Josef's orphan truncate patch fixes an obscure corruption we'd see
        during xfstests.
      
        Arne's patches address problems with subvolume quotas.  If the user
        destroys quota groups incorrectly the FS will refuse to mount.
      
        The rest are smaller fixes and plugs for memory leaks."
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs: (30 commits)
        Btrfs: fix repeated delalloc work allocation
        Btrfs: fix wrong max device number for single profile
        Btrfs: fix missed transaction->aborted check
        Btrfs: Add ACCESS_ONCE() to transaction->abort accesses
        Btrfs: put csums on the right ordered extent
        Btrfs: use right range to find checksum for compressed extents
        Btrfs: fix panic when recovering tree log
        Btrfs: do not allow logged extents to be merged or removed
        Btrfs: fix a regression in balance usage filter
        Btrfs: prevent qgroup destroy when there are still relations
        Btrfs: ignore orphan qgroup relations
        Btrfs: reorder locks and sanity checks in btrfs_ioctl_defrag
        Btrfs: fix unlock order in btrfs_ioctl_rm_dev
        Btrfs: fix unlock order in btrfs_ioctl_resize
        Btrfs: fix "mutually exclusive op is running" error code
        Btrfs: bring back balance pause/resume logic
        btrfs: update timestamps on truncate()
        btrfs: fix btrfs_cont_expand() freeing IS_ERR em
        Btrfs: fix a bug when llseek for delalloc bytes behind prealloc extents
        Btrfs: fix off-by-one in lseek
        ...
      d7df025e
  6. 25 1月, 2013 22 次提交
    • L
      Merge branch 'for-next' of git://git.samba.org/sfrench/cifs-2.6 · 66e2d3e8
      Linus Torvalds 提交于
      Pull cifs fixes from Steve French:
       "Two small cifs fixes"
      
      * 'for-next' of git://git.samba.org/sfrench/cifs-2.6:
        fs/cifs/cifs_dfs_ref.c: fix potential memory leakage
        cifs: fix srcip_matches() for ipv6
      66e2d3e8
    • L
      Merge git://git.kernel.org/pub/scm/virt/kvm/kvm · d93816a6
      Linus Torvalds 提交于
      Pull kvm fixlet from Marcelo Tosatti.
      
      * git://git.kernel.org/pub/scm/virt/kvm/kvm:
        KVM: PPC: Emulate dcbf
      d93816a6
    • L
      Merge branch 'fixes' of git://git.linaro.org/people/rmk/linux-arm · 01acd3ef
      Linus Torvalds 提交于
      Pull ARM fixes from Russell King:
       "A number of fixes:
      
        Patrik found a problem with preempt counting in the VFP assembly
        functions which can cause the preempt count to be upset.
      
        Nicolas fixed a problem with the parsing of the DT when it straddles a
        1MB boundary.
      
        Subhash Jadavani reported a problem with sparsemem and our highmem
        support for cache maintanence for DMA areas, and TI found a bug in
        their strongly ordered memory mapping type.
      
        Also, three fixes by way of Will Deacon's tree from Dave Martin for
        instruction compatibility and Marc Zyngier to fix hypervisor boot mode
        issues."
      
      * 'fixes' of git://git.linaro.org/people/rmk/linux-arm:
        ARM: 7629/1: mm: Fix missing XN flag for for MT_MEMORY_SO
        ARM: DMA: Fix struct page iterator in dma_cache_maint() to work with sparsemem
        ARM: 7628/1: head.S: map one extra section for the ATAG/DTB area
        ARM: 7627/1: Predicate preempt logic on PREEMP_COUNT not PREEMPT alone
        ARM: virt: simplify __hyp_stub_install epilog
        ARM: virt: boot secondary CPUs through the right entry point
        ARM: virt: Avoid bx instruction for compatibility with <=ARMv4
      01acd3ef
    • L
      Merge tag 'fixes-for-linus2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · 1496ec13
      Linus Torvalds 提交于
      Pull ARM SoC fixes from Olof Johansson:
       "Here's a long-pending fixes pull request for arm-soc (I didn't send
        one in the -rc4 cycle).
      
        The larger deltas are from:
      
         - A fixup of error paths in the mvsdio driver
      
         - Header file move for a driver that hadn't been properly converted
           to multiplatform on i.MX, which was causing build failures when
           included
      
         - Device tree updates for at91 dealing mostly with their new pinctrl
           setup merged in 3.8 and mistakes in those initial configs
      
        The rest are the normal mix of small fixes all over the place; sunxi,
        omap, imx, mvebu, etc, etc."
      
      * tag 'fixes-for-linus2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (40 commits)
        mfd: vexpress-sysreg: Don't skip initialization on probe
        ARM: vexpress: Enable A7 cores in V2P-CA15_A7's Device Tree
        ARM: vexpress: extend the MPIDR range used for pen release check
        ARM: at91/dts: correct comment in at91sam9x5.dtsi for mii
        ARM: at91/at91_dt_defconfig: add at91sam9n12 SoC to DT defconfig
        ARM: at91/at91_dt_defconfig: remove memory specification to cmdline
        ARM: at91/dts: add macb mii pinctrl config for kizbox
        ARM: at91: rm9200: remake the BGA as default version
        ARM: at91: fix gpios on i2c-gpio for RM9200 DT
        ARM: at91/at91sam9x5 DTS: add SCK USART pins
        ARM: at91/at91sam9x5 DTS: correct wrong PIO BANK values on u(s)arts
        ARM: at91/at91-pinctrl documentation: fix typo and add some details
        ARM: kirkwood: fix missing #interrupt-cells property
        mmc: mvsdio: use devm_ API to simplify/correct error paths.
        clk: mvebu/clk-cpu.c: fix memory leakage
        ARM: OMAP2+: omap4-panda: add UART2 muxing for WiLink shared transport
        ARM: OMAP2+: DT node Timer iteration fix
        ARM: OMAP2+: Fix section warning for omap_init_ocp2scp()
        ARM: OMAP2+: fix build break for omapdrm
        ARM: OMAP2: Fix missing omap2xxx_clkt_vps_late_init function calls
        ...
      1496ec13
    • L
      Merge tag 'pm+acpi-for-3.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · ba2ab41f
      Linus Torvalds 提交于
      Pull ACPI and power management fixes from Rafael Wysocki:
      
       - Two cpuidle initialization fixes from Konrad Rzeszutek Wilk.
      
       - cpufreq regression fixes for AMD processors from Borislav Petkov,
         Stefan Bader, and Matthew Garrett.
      
       - ACPI cpufreq fix from Thomas Schlichter.
      
       - cpufreq and devfreq fixes related to incorrect usage of operating
         performance points (OPP) framework and RCU from Nishanth Menon.
      
       - APEI workaround for incorrect BIOS information from Lans Zhang.
      
      * tag 'pm+acpi-for-3.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        cpufreq: Add module aliases for acpi-cpufreq
        ACPI: Check MSR valid bit before using P-state frequencies
        PM / devfreq: exynos4_bus: honor RCU lock usage
        PM / devfreq: add locking documentation for recommended_opp
        cpufreq: cpufreq-cpu0: use RCU locks around usage of OPP
        cpufreq: OMAP: use RCU locks around usage of OPP
        ACPI, APEI: Fixup incorrect 64-bit access width firmware bug
        ACPI / processor: Get power info before updating the C-states
        powernow-k8: Add a kconfig dependency on acpi-cpufreq
        ACPI / cpuidle: Fix NULL pointer issues when cpuidle is disabled
        intel_idle: Don't register CPU notifier if we are not running.
      ba2ab41f
    • L
      Merge tag 'regmap-fix-3.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap · bff92411
      Linus Torvalds 提交于
      Pull regmap fixes from Mark Brown:
       "One more oversight in the debugfs code was reported and fixed, plus a
        documentation fix."
      
      * tag 'regmap-fix-3.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap:
        regmap: fix small typo in regmap_bulk_write comment
        regmap: debugfs: Fix seeking from the cache
      bff92411
    • L
      Merge branch 'fixes' of git://git.infradead.org/users/vkoul/slave-dma · 3f58e094
      Linus Torvalds 提交于
      Pull slave-dmaengine fixes from Vinod Koul:
       "A few fixes on slave dmanengine.  There are trivial fixes in imx-dma,
        tegra-dma & ioat driver"
      
      * 'fixes' of git://git.infradead.org/users/vkoul/slave-dma:
        dma: tegra: implement flags parameters for cyclic transfer
        dmaengine: imx-dma: Disable use of hw_chain to fix sg_dma transfers.
        ioat: Fix DMA memory sync direction correct flag
      3f58e094
    • L
      Merge branch 'i2c-embedded/for-current' of git://git.pengutronix.de/git/wsa/linux · acc5da0f
      Linus Torvalds 提交于
      Pill i2c fixes from Wolfram Sang:
       "Here are a few, typical driver fixes for the I2C subsystem"
      
      * 'i2c-embedded/for-current' of git://git.pengutronix.de/git/wsa/linux:
        i2c-designware: add missing MODULE_LICENSE
        i2c: omap: fix draining irq handling
        i2c: omap: errata i462: fix incorrect ack for arbitration lost interrupt
        i2c: muxes: fix wrong use of sizeof(ptr)
        i2c: sirf: register i2c_client from dt child-nodes in probe entry
        i2c: mxs: Fix type of error code
        i2c: mxs: Fix misuse init_completion
      acc5da0f
    • L
      usb: Using correct way to clear usb3.0 device's remote wakeup feature. · 54a3ac0c
      Lan Tianyu 提交于
      Usb3.0 device defines function remote wakeup which is only for interface
      recipient rather than device recipient. This is different with usb2.0 device's
      remote wakeup feature which is defined for device recipient. According usb3.0
      spec 9.4.5, the function remote wakeup can be modified by the SetFeature()
      requests using the FUNCTION_SUSPEND feature selector. This patch is to use
      correct way to disable usb3.0 device's function remote wakeup after suspend
      error and resuming.
      
      This should be backported to kernels as old as 3.4, that contain the
      commit 623bef9e "USB/xhci: Enable remote
      wakeup for USB3 devices."
      Signed-off-by: NLan Tianyu <tianyu.lan@intel.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable@vger.kernel.org
      54a3ac0c
    • D
      usb: Prevent dead ports when xhci is not enabled · 58b2939b
      David Moore 提交于
      When the xHCI driver is not available, actively switch the ports to EHCI
      mode since some BIOSes leave them in xHCI mode where they would
      otherwise appear dead.  This was discovered on a  Dell Optiplex 7010,
      but it's possible other systems could be affected.
      
      This should be backported to kernels as old as 3.0, that contain the
      commit 69e848c2 "Intel xhci: Support
      EHCI/xHCI port switching."
      Signed-off-by: NDavid Moore <david.moore@gmail.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable@vger.kernel.org
      58b2939b
    • A
      USB: XHCI: fix memory leak of URB-private data · 48c3375c
      Alan Stern 提交于
      This patch (as1640) fixes a memory leak in xhci-hcd.  The urb_priv
      data structure isn't always deallocated in the handle_tx_event()
      routine for non-control transfers.  The patch adds a kfree() call so
      that all paths end up freeing the memory properly.
      
      This patch should be backported to kernels as old as 2.6.36, that
      contain the commit 8e51adcc "USB: xHCI:
      Introduce urb_priv structure"
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Reported-and-tested-by: NMartin Mokrejs <mmokrejs@fold.natur.cuni.cz>
      CC: <stable@vger.kernel.org>
      48c3375c
    • N
      drivers: xhci: fix incorrect bit test · ba7b5c22
      Nickolai Zeldovich 提交于
      Fix incorrect bit test that originally showed up in
      4ee823b8 "USB/xHCI: Support
      device-initiated USB 3.0 resume."
      
      Use '&' instead of '&&'.
      
      This should be backported to kernels as old as 3.4.
      Signed-off-by: NNickolai Zeldovich <nickolai@csail.mit.edu>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable@vger.kernel.org
      ba7b5c22
    • S
      xhci: Fix TD size for isochronous URBs. · f18f8ed2
      Sarah Sharp 提交于
      To calculate the TD size for a particular TRB in an isoc TD, we need
      know the endpoint's max packet size.  Isochronous endpoints also encode
      the number of additional service opportunities in their wMaxPacketSize
      field.  The TD size calculation did not mask off those bits before using
      the field.  This resulted in incorrect TD size information for
      isochronous TRBs when an URB frame buffer crossed a 64KB boundary.
      
      For example:
       - an isoc endpoint has 2 additional service opportunites and
         a max packet size of 1020 bytes
       - a frame transfer buffer contains 3060 bytes
       - one frame buffer crosses a 64KB boundary, and must be split into
         one 1276 byte TRB, and one 1784 byte TRB.
      
      The TD size is is the number of packets that remain to be transferred
      for a TD after processing all the max packet sized packets in the
      current TRB and all previous TRBs.
      
      For this TD, the number of packets to be transferred is (3060 / 1020),
      or 3.  The first TRB contains 1276 bytes, which means it contains one
      full packet, and a 256 byte remainder.  After processing all the max
      packet-sized packets in the first TRB, the host will have 2 packets left
      to transfer.
      
      The old code would calculate the TD size for the first TRB as:
      
      total packet count = DIV_ROUND_UP (TD length / endpoint wMaxPacketSize)
      total packet count - (first TRB length / endpoint wMaxPacketSize)
      
      The math should have been:
      
      total packet count = DIV_ROUND_UP (3060 / 1020) = 3
      3 - (1276 / 1020) = 2
      
      Since the old code didn't mask off the additional service interval bits
      from the wMaxPacketSize field, the math ended up as
      
      total packet count = DIV_ROUND_UP (3060 / 5116) = 1
      1 - (1276 / 5116) = 1
      
      Fix this by masking off the number of additional service opportunities
      in the wMaxPacketSize field.
      
      This patch should be backported to stable kernels as old as 3.0, that
      contain the commit 4da6e6f2 "xhci 1.0:
      Update TD size field format."  It may not apply well to kernels older
      than 3.2 because of commit 29cc8897
      "USB: use usb_endpoint_maxp() instead of le16_to_cpu()".
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable@vger.kernel.org
      f18f8ed2
    • S
      xhci: Fix isoc TD encoding. · 760973d2
      Sarah Sharp 提交于
      An isochronous TD is comprised of one isochronous TRB chained to zero or
      more normal TRBs.  Only the isoc TRB has the TBC and TLBPC fields.  The
      normal TRBs must set those fields to zeroes.  The code was setting the
      TBC and TLBPC fields for both isoc and normal TRBs.  Fix this.
      
      This should be backported to stable kernels as old as 3.0, that contain
      the commit b61d378f " xhci 1.0: Set
      transfer burst last packet count field."
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable@vger.kernel.org
      760973d2
    • M
      Btrfs: fix repeated delalloc work allocation · 1eafa6c7
      Miao Xie 提交于
      btrfs_start_delalloc_inodes() locks the delalloc_inodes list, fetches the
      first inode, unlocks the list, triggers btrfs_alloc_delalloc_work/
      btrfs_queue_worker for this inode, and then it locks the list, checks the
      head of the list again. But because we don't delete the first inode that it
      deals with before, it will fetch the same inode. As a result, this function
      allocates a huge amount of btrfs_delalloc_work structures, and OOM happens.
      
      Fix this problem by splice this delalloc list.
      Reported-by: NAlex Lyakas <alex.btrfs@zadarastorage.com>
      Signed-off-by: NMiao Xie <miaox@cn.fujitsu.com>
      Signed-off-by: NJosef Bacik <jbacik@fusionio.com>
      1eafa6c7
    • M
      Btrfs: fix wrong max device number for single profile · c9f01bfe
      Miao Xie 提交于
      The max device number of single profile is 1, not 0 (0 means 'as many as
      possible'). Fix it.
      
      Cc: Liu Bo <bo.li.liu@oracle.com>
      Signed-off-by: NMiao Xie <miaox@cn.fujitsu.com>
      Reviewed-by: NLiu Bo <bo.li.liu@oracle.com>
      Signed-off-by: NJosef Bacik <jbacik@fusionio.com>
      c9f01bfe
    • M
      Btrfs: fix missed transaction->aborted check · 2cba30f1
      Miao Xie 提交于
      First, though the current transaction->aborted check can stop the commit early
      and avoid unnecessary operations, it is too early, and some transaction handles
      don't end, those handles may set transaction->aborted after the check.
      
      Second, when we commit the transaction, we will wake up some worker threads to
      flush the space cache and inode cache. Those threads also allocate some transaction
      handles and may set transaction->aborted if some serious error happens.
      
      So we need more check for ->aborted when committing the transaction. Fix it.
      Signed-off-by: NMiao Xie <miaox@cn.fujitsu.com>
      Signed-off-by: NJosef Bacik <jbacik@fusionio.com>
      2cba30f1
    • M
      Btrfs: Add ACCESS_ONCE() to transaction->abort accesses · 8d25a086
      Miao Xie 提交于
      We may access and update transaction->aborted on the different CPUs without
      lock, so we need ACCESS_ONCE() wrapper to prevent the compiler from creating
      unsolicited accesses and make sure we can get the right value.
      Signed-off-by: NMiao Xie <miaox@cn.fujitsu.com>
      Signed-off-by: NJosef Bacik <jbacik@fusionio.com>
      8d25a086
    • J
      Btrfs: put csums on the right ordered extent · e58dd74b
      Josef Bacik 提交于
      I noticed a WARN_ON going off when adding csums because we were going over
      the amount of csum bytes that should have been allowed for an ordered
      extent.  This is a leftover from when we used to hold the csums privately
      for direct io, but now we use the normal ordered sum stuff so we need to
      make sure and check if we've moved on to another extent so that the csums
      are added to the right extent.  Without this we could end up with csums for
      bytenrs that don't have extents to cover them yet.  Thanks,
      Signed-off-by: NJosef Bacik <jbacik@fusionio.com>
      e58dd74b
    • L
      Btrfs: use right range to find checksum for compressed extents · 192000dd
      Liu Bo 提交于
      For compressed extents, the range of checksum is covered by disk length,
      and the disk length is different with ram length, so we need to use disk
      length instead to get us the right checksum.
      Signed-off-by: NLiu Bo <bo.li.liu@oracle.com>
      Signed-off-by: NJosef Bacik <jbacik@fusionio.com>
      192000dd
    • J
      Btrfs: fix panic when recovering tree log · b0175117
      Josef Bacik 提交于
      A user reported a BUG_ON(ret) that occured during tree log replay.  Ret was
      -EAGAIN, so what I think happened is that we removed an extent that covered
      a bitmap entry and an extent entry.  We remove the part from the bitmap and
      return -EAGAIN and then search for the next piece we want to remove, which
      happens to be an entire extent entry, so we just free the sucker and return.
      The problem is ret is still set to -EAGAIN so we trip the BUG_ON().  The
      user used btrfs-zero-log so I'm not 100% sure this is what happened so I've
      added a WARN_ON() to catch the other possibility.  Thanks,
      Reported-by: NJan Steffens <jan.steffens@gmail.com>
      Signed-off-by: NJosef Bacik <jbacik@fusionio.com>
      b0175117
    • J
      Btrfs: do not allow logged extents to be merged or removed · 201a9038
      Josef Bacik 提交于
      We drop the extent map tree lock while we're logging extents, so somebody
      could come in and merge another extent into this one and screw up our
      logging, or they could even remove us from the list which would keep us from
      logging the extent or freeing our ref on it, so we need to make sure to not
      clear LOGGING until after the extent is logged, and then we can merge it to
      adjacent extents.  Thanks,
      Signed-off-by: NJosef Bacik <jbacik@fusionio.com>
      201a9038