1. 16 Jun, 2012 7 commits
    • Linus Torvalds's avatar
      Merge branch 'fixes-for-linus' of git://git.linaro.org/people/mszyprowski/linux-dma-mapping · 56b880e2
      Linus Torvalds authored
      Pull DMA-mapping fixes from Marek Szyprowski:
       "A set of minor fixes for dma-mapping code (ARM and x86) required for
        Contiguous Memory Allocator (CMA) patches merged in v3.5-rc1."
      
      * 'fixes-for-linus' of git://git.linaro.org/people/mszyprowski/linux-dma-mapping:
        x86: dma-mapping: fix broken allocation when dma_mask has been provided
        ARM: dma-mapping: fix debug messages in dmabounce code
        ARM: mm: fix type of the arm_dma_limit global variable
        ARM: dma-mapping: Add missing static storage class specifier
      56b880e2
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc · 1043e3be
      Linus Torvalds authored
      Pull PowerPC fix from Paul Mackerras:
       "Just one commit, and a one-liner at that, but an important one;
        without it hard_irq_disable() does nothing on powerpc."
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc:
        Make hard_irq_disable() actually hard-disable interrupts
      1043e3be
    • Linus Torvalds's avatar
      Merge branch 'for-3.5' of git://linux-nfs.org/~bfields/linux · 93dd048d
      Linus Torvalds authored
      Pull two nfsd bugfixes from J. Bruce Fields.
      
      * 'for-3.5' of git://linux-nfs.org/~bfields/linux:
        nfsd4: BUG_ON(!is_spin_locked()) no good on UP kernels
        NFS: hard-code init_net for NFS callback transports
      93dd048d
    • Linus Torvalds's avatar
      Merge tag 'stable/for-linus-3.5-rc2-tag' of... · 069915b9
      Linus Torvalds authored
      Merge tag 'stable/for-linus-3.5-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen
      
      Pull five Xen bug-fixes from Konrad Rzeszutek Wilk:
      
       - When booting as PVHVM we would try to use PV console - but would not validate
         the parameters causing us to crash during restore b/c we re-use the wrong event
         channel.
       - When booting on machines with SR-IOV PCI bridge we didn't check for the bridge
         and tried to use it.
       - Under AMD machines would advertise the APERFMPERF resulting in needless amount
         of MSRs from the guest.
       - A global value (xen_released_pages) was not subtracted at bootup when pages
         were added back in. This resulted in the balloon worker having the wrong
         account of how many pages were truly released.
       - Fix dead-lock when xen-blkfront is run in the same domain as xen-blkback.
      
      * tag 'stable/for-linus-3.5-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
        xen: mark local pages as FOREIGN in the m2p_override
        xen/setup: filter APERFMPERF cpuid feature out
        xen/balloon: Subtract from xen_released_pages the count that is populated.
        xen/pci: Check for PCI bridge before using it.
        xen/events: Add WARN_ON when quick lookup found invalid type.
        xen/hvc: Check HVM_PARAM_CONSOLE_[EVTCHN|PFN] for correctness.
        xen/hvc: Fix error cases around HVM_PARAM_CONSOLE_PFN
        xen/hvc: Collapse error logic.
      069915b9
    • Linus Torvalds's avatar
      Merge tag 'usb-3.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · 41c8c535
      Linus Torvalds authored
      Pull USB fixes from Greg Kroah-Hartman:
       "Here are a bunch of tiny fixes for the USB core and drivers for
        3.5-rc3
      
        A bunch of gadget fixes, and new device ids, as well as some fixes for
        a number of different regressions that have been reported recently.
        We also fixed some PCI host controllers to resolve a long-standing bug
        with a whole class of host controllers that have been plaguing people
        for a number of kernel releases, preventing their systems from
        suspending properly.
      
        Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>"
      
      * tag 'usb-3.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (41 commits)
        USB: fix gathering of interface associations
        usb: ehci-sh: fix illegal phy_init() running when platform_data is NULL
        usb: cdc-acm: fix devices not unthrottled on open
        Fix OMAP EHCI suspend/resume failure (i693)
        USB: ohci-hub: Mark ohci_finish_controller_resume() as __maybe_unused
        usb: use usb_serial_put in usb_serial_probe errors
        USB: EHCI: Fix build warning in xilinx ehci driver
        USB: fix PS3 EHCI systems
        xHCI: Increase the timeout for controller save/restore state operation
        xhci: Don't free endpoints in xhci_mem_cleanup()
        xhci: Fix invalid loop check in xhci_free_tt_info()
        xhci: Fix error path return value.
        USB: Checking the wrong variable in usb_disable_lpm()
        usb-storage: Add 090c:1000 to unusal-devs
        USB: serial-generic: use a single set of device IDs
        USB: serial: Enforce USB driver and USB serial driver match
        USB: add NO_D3_DURING_SLEEP flag and revert 151b6128
        USB: option: add more YUGA device ids
        USB: mos7840: Fix compilation of usb serial driver
        USB: option: fix memory leak
        ...
      41c8c535
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide · 8e53ed10
      Linus Torvalds authored
      Pull IDE fixes from David S. Miller:
      
      1) Two fixes to icside, one for a build failure and another for a
         warning.  From Christian Dietrich.
      
      2) Fix a bit operation that did erroneous masking, from Julia Lawall.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide:
        drivers/ide/ide-cs.c: adjust suspicious bit operation
        ide: icside.c: fix printk format string compile warning
        ide: icside.c: Fix compile with CONFIG_BLK_DEV_IDEDMA_ICS=n
      8e53ed10
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc · 06da0351
      Linus Torvalds authored
      Pull sparc update from David S. Miller:
       "This just removes some sparc headers that were never, ever, used."
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
        sparc: remove two unused headers
      06da0351
  2. 15 Jun, 2012 28 commits
    • Linus Torvalds's avatar
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · c83119a9
      Linus Torvalds authored
      Pull x86 fixes from Ingo Molnar.
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/smp: Fix topology checks on AMD MCM CPUs
        x86/mm: Fix some kernel-doc warnings
        x86, um: Correct syscall table type attributes breaking gcc 4.8
      c83119a9
    • Linus Torvalds's avatar
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · ed21a66c
      Linus Torvalds authored
      Pull perf fixes from Ingo Molnar.
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        watchdog: Quiet down the boot messages
        perf/x86: Fix broken LBR fixup code
        tracing: Have tracing_off() actually turn tracing off
      ed21a66c
    • Linus Torvalds's avatar
      Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · a95f9b6e
      Linus Torvalds authored
      Pull core updates (RCU and locking) from Ingo Molnar:
       "Most of the diffstat comes from the RCU slow boot regression fixes,
        but there's also a debuggability improvements/fixes."
      
      * 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        memblock: Document memblock_is_region_{memory,reserved}()
        rcu: Precompute RCU_FAST_NO_HZ timer offsets
        rcu: Move RCU_FAST_NO_HZ per-CPU variables to rcu_dynticks structure
        rcu: Update RCU_FAST_NO_HZ tracing for lazy callbacks
        rcu: RCU_FAST_NO_HZ detection of callback adoption
        spinlock: Indicate that a lockup is only suspected
        kdump: Execute kmsg_dump(KMSG_DUMP_PANIC) after smp_send_stop()
        panic: Make panic_on_oops configurable
      a95f9b6e
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending · a41b0e71
      Linus Torvalds authored
      Pull target updates from Nicholas Bellinger:
       "This series contains post merge qla_target.c / tcm_qla2xxx bugfixes
        from the past weeks, including the patch to allow target-core to use
        an optional session shutdown callback to help address an active I/O
        shutdown bug in tcm_qla2xxx code (Joern).
      
        Also included is a target regression bugfix releated to explict ALUA
        target port group CDB emulation that is CC'ed to stable (Roland)."
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending:
        qla2xxx: Remove version.h header file inclusion
        tcm_qla2xxx: Handle malformed wwn strings properly
        tcm_qla2xxx: tcm_qla2xxx_handle_tmr() can be static
        qla2xxx: Don't leak commands we give up on in qlt_do_work()
        qla2xxx: Don't crash if we can't find cmd for failed CTIO
        tcm_qla2xxx: Don't insert nacls without sessions into the btree
        target: Return error to initiator if SET TARGET PORT GROUPS emulation fails
        tcm_qla2xxx: Clear session s_id + loop_id earlier during shutdown
        tcm_qla2xxx: Convert to TFO->put_session() usage
        target: Add TFO->put_session() caller for HW fabric session shutdown
      a41b0e71
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs · 718f58ad
      Linus Torvalds authored
      Pull btrfs update from Chris Mason:
       "The dates look like I had to rebase this morning because there was a
        compiler warning for a printk arg that I had missed earlier.
      
        These are all fixes, including one to prevent using stale pointers for
        device names, and lots of fixes around transaction abort cleanups
        (Josef, Liu Bo).
      
        Jan Schmidt also sent in a number of fixes for the new reference
        number tracking code.
      
        Liu Bo beat me to updating the MAINTAINERS file.  Since he thought to
        also fix the git url, I kept his commit."
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs: (24 commits)
        Btrfs: update MAINTAINERS info for BTRFS FILE SYSTEM
        Btrfs: destroy the items of the delayed inodes in error handling routine
        Btrfs: make sure that we've made everything in pinned tree clean
        Btrfs: avoid memory leak of extent state in error handling routine
        Btrfs: do not resize a seeding device
        Btrfs: fix missing inherited flag in rename
        Btrfs: fix incompat flags setting
        Btrfs: fix defrag regression
        Btrfs: call filemap_fdatawrite twice for compression
        Btrfs: keep inode pinned when compressing writes
        Btrfs: implement ->show_devname
        Btrfs: use rcu to protect device->name
        Btrfs: unlock everything properly in the error case for nocow
        Btrfs: fix btrfs_destroy_marked_extents
        Btrfs: abort the transaction if the commit fails
        Btrfs: wake up transaction waiters when aborting a transaction
        Btrfs: fix locking in btrfs_destroy_delayed_refs
        Btrfs: pass locked_page into extent_clear_unlock_delalloc if theres an error
        Btrfs: fix race in tree mod log addition
        Btrfs: add btrfs_next_old_leaf
        ...
      718f58ad
    • Liu Bo's avatar
      Btrfs: update MAINTAINERS info for BTRFS FILE SYSTEM · 9c106405
      Liu Bo authored
      Update to the latest btrfs's maintainer mail and git repo.
      Signed-off-by: default avatarLiu Bo <liubo2009@cn.fujitsu.com>
      Signed-off-by: default avatarChris Mason <chris.mason@fusionio.com>
      9c106405
    • Miao Xie's avatar
      Btrfs: destroy the items of the delayed inodes in error handling routine · 67cde344
      Miao Xie authored
      the items of the delayed inodes were forgotten to be freed, this patch
      fixes it.
      Signed-off-by: default avatarMiao Xie <miaox@cn.fujitsu.com>
      Signed-off-by: default avatarChris Mason <chris.mason@fusionio.com>
      67cde344
    • Liu Bo's avatar
      Btrfs: make sure that we've made everything in pinned tree clean · ed0eaa14
      Liu Bo authored
      Since we have two trees for recording pinned extents, we need to go through
      both of them to make sure that we've done everything clean.
      Signed-off-by: default avatarLiu Bo <liubo2009@cn.fujitsu.com>
      Signed-off-by: default avatarChris Mason <chris.mason@fusionio.com>
      ed0eaa14
    • Liu Bo's avatar
      Btrfs: avoid memory leak of extent state in error handling routine · 6e841e32
      Liu Bo authored
      We've forgotten to clear extent states in pinned tree, which will results in
      space counter mismatch and memory leak:
      
      WARNING: at fs/btrfs/extent-tree.c:7537 btrfs_free_block_groups+0x1f3/0x2e0 [btrfs]()
      ...
      space_info 2 has 8380416 free, is not full
      space_info total=12582912, used=4096, pinned=4096, reserved=0, may_use=0, readonly=4194304
      btrfs state leak: start 29364224 end 29376511 state 1 in tree ffff880075f20090 refs 1
      ...
      Signed-off-by: default avatarLiu Bo <liubo2009@cn.fujitsu.com>
      Signed-off-by: default avatarChris Mason <chris.mason@fusionio.com>
      6e841e32
    • Liu Bo's avatar
      Btrfs: do not resize a seeding device · 4e42ae1b
      Liu Bo authored
      Seeding devices are not supposed to change any more.
      Signed-off-by: default avatarLiu Bo <liubo2009@cn.fujitsu.com>
      Signed-off-by: default avatarChris Mason <chris.mason@fusionio.com>
      4e42ae1b
    • Liu Bo's avatar
      Btrfs: fix missing inherited flag in rename · bc178237
      Liu Bo authored
      When we move a file into a directory with compression flag, we need to
      inherite BTRFS_INODE_COMPRESS and clear BTRFS_INODE_NOCOMPRESS as well.
      But if we move a file into a directory without compression flag, we need
      to clear both of them.
      
      It is the way how our setflags deals with compression flag, so keep
      the same behaviour here.
      Signed-off-by: default avatarLiu Bo <liubo2009@cn.fujitsu.com>
      Signed-off-by: default avatarChris Mason <chris.mason@fusionio.com>
      bc178237
    • Chris Mason's avatar
    • Paul Mackerras's avatar
      Make hard_irq_disable() actually hard-disable interrupts · f948501b
      Paul Mackerras authored
      At present, hard_irq_disable() does nothing on powerpc because of
      this code in include/linux/interrupt.h:
      
          #ifndef hard_irq_disable
          #define hard_irq_disable()      do { } while(0)
          #endif
      
      So we need to make our hard_irq_disable be a macro.  It was previously
      a macro until commit 7230c564 ("powerpc: Rework lazy-interrupt
      handling") changed it to a static inline function.
      
      Cc: stable@vger.kernel.org
      Acked-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      --
       arch/powerpc/include/asm/hw_irq.h |    3 +++
       1 file changed, 3 insertions(+)
      f948501b
    • Li Zefan's avatar
      Btrfs: fix incompat flags setting · 69e380d1
      Li Zefan authored
      It's a bug, but it happens to work, as BTRFS_COMPRESS_LZO == 2, which
      has only one bit set.
      Signed-off-by: default avatarLi Zefan <lizefan@huawei.com>
      69e380d1
    • Li Zefan's avatar
      Btrfs: fix defrag regression · 6c282eb4
      Li Zefan authored
      If a file has 3 small extents:
      
      | ext1 | ext2 | ext3 |
      
      Running "btrfs fi defrag" will only defrag the last two extents, if those
      extent mappings hasn't been read into memory from disk.
      
      This bug was introduced by commit 17ce6ef8
      ("Btrfs: add a check to decide if we should defrag the range")
      
      The cause is, that commit looked into previous and next extents using
      lookup_extent_mapping() only.
      
      While at it, remove the code that checks the previous extent, since
      it's sufficient to check the next extent.
      Signed-off-by: default avatarLi Zefan <lizefan@huawei.com>
      6c282eb4
    • Josef Bacik's avatar
      Btrfs: call filemap_fdatawrite twice for compression · 7ddf5a42
      Josef Bacik authored
      I removed this in an earlier commit and I was wrong.  Because compression
      can return from filemap_fdatawrite() without having actually set any of it's
      pages as writeback() it can make filemap_fdatawait() do essentially nothing,
      and then we won't find any ordered extents because they may not have been
      created yet.  So not only does this make fsync() completely useless, but it
      will also screw up if you truncate on a non-page aligned offset since we
      zero out the end and then wait on ordered extents and then call drop caches.
      We can drop the cache before the io completes and then we try to unpin the
      extent we just wrote we won't find it and everything goes sideways.  So fix
      this by putting it back and put a giant comment there to keep me from trying
      to remove it in the future.  Thanks,
      Signed-off-by: default avatarJosef Bacik <josef@redhat.com>
      7ddf5a42
    • Josef Bacik's avatar
      Btrfs: keep inode pinned when compressing writes · 8180ef88
      Josef Bacik authored
      A user reported lots of problems using compression on the new code and it
      turns out part of the problem was that igrab() was failing when we added a
      new ordered extent.  This is because when writing out an inode under
      compression we immediately return without actually doing anything to the
      pages, and then in another thread at some point down the line actually do
      the ordered dance.  The problem is between the point that we start writeback
      and we actually add the ordered extent we could be trying to reclaim the
      inode, which makes igrab() return NULL.  So we need to do an igrab() when we
      create the async extent and then drop it when we are done with it.  This
      makes sure we stay pinned in memory until the ordered extent can get a
      reference on it and we are good to go.  With this patch we no longer panic
      in btrfs_finish_ordered_io().  Thanks,
      Signed-off-by: default avatarJosef Bacik <josef@redhat.com>
      8180ef88
    • Josef Bacik's avatar
      Btrfs: implement ->show_devname · 9c5085c1
      Josef Bacik authored
      Because btrfs can remove the device that was mounted we need to have a
      ->show_devname so that in this case we can print out some other device in
      the file system to /proc/mount.  So if there are multiple devices in a btrfs
      file system we will just print the device with the lowest devid that we can
      find.  This will make everything consistent and deal with device removal
      properly.  The drawback is if you mount with a device that is higher than
      the lowest devicd it won't show up as the mounted device in /proc/mounts,
      but this is a small price to pay. This was inspired by Miao Xie's patch.
      Thanks,
      Reviewed-by: default avatarMiao Xie <miaox@cn.fujitsu.com>
      Signed-off-by: default avatarJosef Bacik <josef@redhat.com>
      9c5085c1
    • Josef Bacik's avatar
      Btrfs: use rcu to protect device->name · 606686ee
      Josef Bacik authored
      Al pointed out that we can just toss out the old name on a device and add a
      new one arbitrarily, so anybody who uses device->name in printk could
      possibly use free'd memory.  Instead of adding locking around all of this he
      suggested doing it with RCU, so I've introduced a struct rcu_string that
      does just that and have gone through and protected all accesses to
      device->name that aren't under the uuid_mutex with rcu_read_lock().  This
      protects us and I will use it for dealing with removing the device that we
      used to mount the file system in a later patch.  Thanks,
      Reviewed-by: default avatarDavid Sterba <dsterba@suse.cz>
      Signed-off-by: default avatarJosef Bacik <josef@redhat.com>
      606686ee
    • Josef Bacik's avatar
      Btrfs: unlock everything properly in the error case for nocow · 17ca04af
      Josef Bacik authored
      I was getting hung on umount when a transaction was aborted because a range
      of one of the free space inodes was still locked.  This is because the nocow
      stuff doesn't unlock anything on error.  This fixed the problem and I
      verified that is what was happening.  Thanks,
      Signed-off-by: default avatarJosef Bacik <josef@redhat.com>
      17ca04af
    • Josef Bacik's avatar
      Btrfs: fix btrfs_destroy_marked_extents · ee670f0a
      Josef Bacik authored
      So we're forcing the eb's to have their ref count set to 1 so invalidatepage
      works but this breaks lots of things, for example root nodes, and is just
      plain wrong, we don't need to just evict all of this stuff.  Also drop the
      invalidatepage altogether and add a page_cache_release().  With this patch
      we no longer hang when trying to access the root nodes after an aborted
      transaction and we no longer leak memory.  Thanks,
      Signed-off-by: default avatarJosef Bacik <josef@redhat.com>
      ee670f0a
    • Josef Bacik's avatar
      Btrfs: abort the transaction if the commit fails · 7b8b92af
      Josef Bacik authored
      If a transaction commit fails we don't abort it so we don't set an error on
      the file system.  This patch fixes that by actually calling the abort stuff
      and then adding a check for a fs error in the transaction start stuff to
      make sure it is caught properly.  Thanks,
      Signed-off-by: default avatarJosef Bacik <josef@redhat.com>
      7b8b92af
    • Josef Bacik's avatar
      Btrfs: wake up transaction waiters when aborting a transaction · d7096fc3
      Josef Bacik authored
      I was getting lots of hung tasks and a NULL pointer dereference because we
      are not cleaning up the transaction properly when it aborts.  First we need
      to reset the running_transaction to NULL so we don't get a bad dereference
      for any start_transaction callers after this.  Also we cannot rely on
      waitqueue_active() since it's just a list_empty(), so just call wake_up()
      directly since that will do the barrier for us and such.  Thanks,
      Signed-off-by: default avatarJosef Bacik <josef@redhat.com>
      d7096fc3
    • Josef Bacik's avatar
      Btrfs: fix locking in btrfs_destroy_delayed_refs · b939d1ab
      Josef Bacik authored
      The transaction abort stuff was throwing warnings from the list debugging
      code because we do a list_del_init outside of the delayed_refs spin lock.
      The delayed refs locking makes baby Jesus cry so it's not hard to get wrong,
      but we need to take the ref head mutex to make sure it's not being processed
      currently, and so if it is we need to drop the spin lock and then take and
      drop the mutex and do the search again.  If we can take the mutex then we
      can safely remove the head from the list and carry on.  Now when the
      transaction aborts I don't get the list debugging warnings.  Thanks,
      Signed-off-by: default avatarJosef Bacik <josef@redhat.com>
      b939d1ab
    • Josef Bacik's avatar
      Btrfs: pass locked_page into extent_clear_unlock_delalloc if theres an error · beb42dd7
      Josef Bacik authored
      While doing my enospc work I got a transaction abortion that resulted in a
      panic when we tried to unlock_page() an already unlocked page.  This is
      because we aren't calling extent_clear_unlock_delalloc with the locked page
      so it was unlocking all the pages in the range.  This is wrong since
      __extent_writepage expects to have the page locked still unless we return
      *page_started as 1.  This should keep us from panicing.  Thanks,
      Signed-off-by: default avatarJosef Bacik <josef@redhat.com>
      beb42dd7
    • Daniel Mack's avatar
      USB: fix gathering of interface associations · b3a3dd07
      Daniel Mack authored
      TEAC's UD-H01 (and probably other devices) have a gap in the interface
      number allocation of their descriptors:
      
        Configuration Descriptor:
          bLength                 9
          bDescriptorType         2
          wTotalLength          220
          bNumInterfaces          3
          [...]
          Interface Descriptor:
            bLength                 9
            bDescriptorType         4
            bInterfaceNumber        0
            bAlternateSetting       0
            [...]
          Interface Association:
            bLength                 8
            bDescriptorType        11
            bFirstInterface         2
            bInterfaceCount         2
            bFunctionClass          1 Audio
            bFunctionSubClass       0
            bFunctionProtocol      32
            iFunction               4
          Interface Descriptor:
            bLength                 9
            bDescriptorType         4
            bInterfaceNumber        2
            bAlternateSetting       0
            [...]
      
      Once a configuration is selected, usb_set_configuration() walks the
      known interfaces of a given configuration and calls find_iad() on
      each of them to set the interface association pointer the interface
      is included in.
      
      The problem here is that the loop variable is taken for the interface
      number in the comparison logic that gathers the association. Which is
      fine as long as the descriptors are sane.
      
      In the case above, however, the logic gets out of sync and the
      interface association fields of all interfaces beyond the interface
      number gap are wrong.
      
      Fix this by passing the interface's bInterfaceNumber to find_iad()
      instead.
      Signed-off-by: default avatarDaniel Mack <zonque@gmail.com>
      Reported-by: default avatarbEN <ml_all@circa.be>
      Reported-by: default avatarIvan Perrone <ivanperrone@hotmail.com>
      Tested-by: default avatarivan perrone <ivanperrone@hotmail.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b3a3dd07
    • Shimoda, Yoshihiro's avatar
      usb: ehci-sh: fix illegal phy_init() running when platform_data is NULL · 5897b038
      Shimoda, Yoshihiro authored
      If the platform_data is not set, pdata will be uninitialized value.
      Since the driver has the following code, if the condition is true when
      the pdata is uninitialized value, the driver may jump to the illegal
      phy_init().
      
      	if (pdata && pdata->phy_init)
      		pdata->phy_init();
      
      This patch also fixes the following warning:
      
        CC      drivers/usb/host/ehci-hcd.o
      drivers/usb/host/ehci-sh.c: In function ‘ehci_hcd_sh_probe’:
      drivers/usb/host/ehci-sh.c:104: warning: ‘pdata’ may be used uninitialized in this function
      Signed-off-by: default avatarYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
      Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5897b038
    • Otto Meta's avatar
      usb: cdc-acm: fix devices not unthrottled on open · 6c4707f3
      Otto Meta authored
      Currently CDC-ACM devices stay throttled when their TTY is closed while
      throttled, stalling further communication attempts after the next open.
      
      Unthrottling during open/activate got lost starting with kernel
      3.0.0 and this patch reintroduces it.
      Signed-off-by: default avatarOtto Meta <otto.patches@sister-shadow.de>
      Cc: stable <stable@vger.kernel.org>
      Acked-by: default avatarJohan Hovold <jhovold@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6c4707f3
  3. 14 Jun, 2012 5 commits
    • Stefano Stabellini's avatar
      xen: mark local pages as FOREIGN in the m2p_override · b9e0d95c
      Stefano Stabellini authored
      When the frontend and the backend reside on the same domain, even if we
      add pages to the m2p_override, these pages will never be returned by
      mfn_to_pfn because the check "get_phys_to_machine(pfn) != mfn" will
      always fail, so the pfn of the frontend will be returned instead
      (resulting in a deadlock because the frontend pages are already locked).
      
      INFO: task qemu-system-i38:1085 blocked for more than 120 seconds.
      "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
      qemu-system-i38 D ffff8800cfc137c0     0  1085      1 0x00000000
       ffff8800c47ed898 0000000000000282 ffff8800be4596b0 00000000000137c0
       ffff8800c47edfd8 ffff8800c47ec010 00000000000137c0 00000000000137c0
       ffff8800c47edfd8 00000000000137c0 ffffffff82213020 ffff8800be4596b0
      Call Trace:
       [<ffffffff81101ee0>] ? __lock_page+0x70/0x70
       [<ffffffff81a0fdd9>] schedule+0x29/0x70
       [<ffffffff81a0fe80>] io_schedule+0x60/0x80
       [<ffffffff81101eee>] sleep_on_page+0xe/0x20
       [<ffffffff81a0e1ca>] __wait_on_bit_lock+0x5a/0xc0
       [<ffffffff81101ed7>] __lock_page+0x67/0x70
       [<ffffffff8106f750>] ? autoremove_wake_function+0x40/0x40
       [<ffffffff811867e6>] ? bio_add_page+0x36/0x40
       [<ffffffff8110b692>] set_page_dirty_lock+0x52/0x60
       [<ffffffff81186021>] bio_set_pages_dirty+0x51/0x70
       [<ffffffff8118c6b4>] do_blockdev_direct_IO+0xb24/0xeb0
       [<ffffffff811e71a0>] ? ext3_get_blocks_handle+0xe00/0xe00
       [<ffffffff8118ca95>] __blockdev_direct_IO+0x55/0x60
       [<ffffffff811e71a0>] ? ext3_get_blocks_handle+0xe00/0xe00
       [<ffffffff811e91c8>] ext3_direct_IO+0xf8/0x390
       [<ffffffff811e71a0>] ? ext3_get_blocks_handle+0xe00/0xe00
       [<ffffffff81004b60>] ? xen_mc_flush+0xb0/0x1b0
       [<ffffffff81104027>] generic_file_aio_read+0x737/0x780
       [<ffffffff813bedeb>] ? gnttab_map_refs+0x15b/0x1e0
       [<ffffffff811038f0>] ? find_get_pages+0x150/0x150
       [<ffffffff8119736c>] aio_rw_vect_retry+0x7c/0x1d0
       [<ffffffff811972f0>] ? lookup_ioctx+0x90/0x90
       [<ffffffff81198856>] aio_run_iocb+0x66/0x1a0
       [<ffffffff811998b8>] do_io_submit+0x708/0xb90
       [<ffffffff81199d50>] sys_io_submit+0x10/0x20
       [<ffffffff81a18d69>] system_call_fastpath+0x16/0x1b
      
      The explanation is in the comment within the code:
      
      We need to do this because the pages shared by the frontend
      (xen-blkfront) can be already locked (lock_page, called by
      do_read_cache_page); when the userspace backend tries to use them
      with direct_IO, mfn_to_pfn returns the pfn of the frontend, so
      do_blockdev_direct_IO is going to try to lock the same pages
      again resulting in a deadlock.
      
      A simplified call graph looks like this:
      
      pygrub                          QEMU
      -----------------------------------------------
      do_read_cache_page              io_submit
        |                              |
      lock_page                       ext3_direct_IO
                                       |
                                      bio_add_page
                                       |
                                      lock_page
      
      Internally the xen-blkback uses m2p_add_override to swizzle (temporarily)
      a 'struct page' to have a different MFN (so that it can point to another
      guest). It also can easily find out whether another pfn corresponding
      to the mfn exists in the m2p, and can set the FOREIGN bit
      in the p2m, making sure that mfn_to_pfn returns the pfn of the backend.
      
      This allows the backend to perform direct_IO on these pages, but as a
      side effect prevents the frontend from using get_user_pages_fast on
      them while they are being shared with the backend.
      Signed-off-by: default avatarStefano Stabellini <stefano.stabellini@eu.citrix.com>
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      b9e0d95c
    • J. Bruce Fields's avatar
      nfsd4: BUG_ON(!is_spin_locked()) no good on UP kernels · bc2df47a
      J. Bruce Fields authored
      Most frequent symptom was a BUG triggering in expire_client, with the
      server locking up shortly thereafter.
      
      Introduced by 508dc6e1 "nfsd41:
      free_session/free_client must be called under the client_lock".
      
      Cc: stable@kernel.org
      Cc: Benny Halevy <bhalevy@tonian.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      bc2df47a
    • Stanislav Kinsbursky's avatar
      NFS: hard-code init_net for NFS callback transports · 12918b10
      Stanislav Kinsbursky authored
      In case of destroying mount namespace on child reaper exit, nsproxy is zeroed
      to the point already. So, dereferencing of it is invalid.
      This patch hard-code "init_net" for all network namespace references for NFS
      callback services. This will be fixed with proper NFS callback
      containerization.
      Signed-off-by: default avatarStanislav Kinsbursky <skinsbursky@parallels.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      12918b10
    • Jan Schmidt's avatar
      Btrfs: fix race in tree mod log addition · 3310c36e
      Jan Schmidt authored
      When adding to the tree modification log, we grab two locks at different
      stages. We must not drop the outer lock until we're done with section
      protected by the inner lock. This moves the unlock call for the outer lock
      to the appropriate position.
      Signed-off-by: default avatarJan Schmidt <list.btrfs@jan-o-sch.net>
      3310c36e
    • Jan Schmidt's avatar
      Btrfs: add btrfs_next_old_leaf · 3d7806ec
      Jan Schmidt authored
      To make sense of the tree mod log, the backref walker not only needs
      btrfs_search_old_slot, but it also called btrfs_next_leaf, which in turn was
      calling btrfs_search_slot. This obviously didn't give the correct result.
      
      This commit adds btrfs_next_old_leaf, a drop-in replacement for
      btrfs_next_leaf with a time_seq parameter. If it is zero, it behaves exactly
      like btrfs_next_leaf. If it is non-zero, it will use btrfs_search_old_slot
      with this time_seq parameter.
      Signed-off-by: default avatarJan Schmidt <list.btrfs@jan-o-sch.net>
      3d7806ec