1. 03 Jan, 2013 2 commits
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client · 58890c06
      Linus Torvalds authored
      Pull Ceph fixes from Sage Weil:
       "Two of Alex's patches deal with a race when reseting server
        connections for open RBD images, one demotes some non-fatal BUGs to
        WARNs, and my patch fixes a protocol feature bit failure path."
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client:
        libceph: fix protocol feature mismatch failure path
        libceph: WARN, don't BUG on unexpected connection states
        libceph: always reset osds when kicking
        libceph: move linger requests sooner in kick_requests()
      58890c06
    • Mel Gorman's avatar
      mm: mempolicy: Convert shared_policy mutex to spinlock · 42288fe3
      Mel Gorman authored
      Sasha was fuzzing with trinity and reported the following problem:
      
        BUG: sleeping function called from invalid context at kernel/mutex.c:269
        in_atomic(): 1, irqs_disabled(): 0, pid: 6361, name: trinity-main
        2 locks held by trinity-main/6361:
         #0:  (&mm->mmap_sem){++++++}, at: [<ffffffff810aa314>] __do_page_fault+0x1e4/0x4f0
         #1:  (&(&mm->page_table_lock)->rlock){+.+...}, at: [<ffffffff8122f017>] handle_pte_fault+0x3f7/0x6a0
        Pid: 6361, comm: trinity-main Tainted: G        W
        3.7.0-rc2-next-20121024-sasha-00001-gd95ef01-dirty #74
        Call Trace:
          __might_sleep+0x1c3/0x1e0
          mutex_lock_nested+0x29/0x50
          mpol_shared_policy_lookup+0x2e/0x90
          shmem_get_policy+0x2e/0x30
          get_vma_policy+0x5a/0xa0
          mpol_misplaced+0x41/0x1d0
          handle_pte_fault+0x465/0x6a0
      
      This was triggered by a different version of automatic NUMA balancing
      but in theory the current version is vunerable to the same problem.
      
      do_numa_page
        -> numa_migrate_prep
          -> mpol_misplaced
            -> get_vma_policy
              -> shmem_get_policy
      
      It's very unlikely this will happen as shared pages are not marked
      pte_numa -- see the page_mapcount() check in change_pte_range() -- but
      it is possible.
      
      To address this, this patch restores sp->lock as originally implemented
      by Kosaki Motohiro.  In the path where get_vma_policy() is called, it
      should not be calling sp_alloc() so it is not necessary to treat the PTL
      specially.
      Signed-off-by: default avatarKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Tested-by: default avatarKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Signed-off-by: default avatarMel Gorman <mgorman@suse.de>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      42288fe3
  2. 02 Jan, 2013 4 commits
    • Linus Torvalds's avatar
      Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 · 5439ca6b
      Linus Torvalds authored
      Pull ext4 bug fixes from Ted Ts'o:
       "Various bug fixes for ext4.  Perhaps the most serious bug fixed is one
        which could cause file system corruptions when performing file punch
        operations."
      
      * tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
        ext4: avoid hang when mounting non-journal filesystems with orphan list
        ext4: lock i_mutex when truncating orphan inodes
        ext4: do not try to write superblock on ro remount w/o journal
        ext4: include journal blocks in df overhead calcs
        ext4: remove unaligned AIO warning printk
        ext4: fix an incorrect comment about i_mutex
        ext4: fix deadlock in journal_unmap_buffer()
        ext4: split off ext4_journalled_invalidatepage()
        jbd2: fix assertion failure in jbd2_journal_flush()
        ext4: check dioread_nolock on remount
        ext4: fix extent tree corruption caused by hole punch
      5439ca6b
    • Hugh Dickins's avatar
      mempolicy: remove arg from mpol_parse_str, mpol_to_str · a7a88b23
      Hugh Dickins authored
      Remove the unused argument (formerly no_context) from mpol_parse_str()
      and from mpol_to_str().
      Signed-off-by: default avatarHugh Dickins <hughd@google.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a7a88b23
    • Hugh Dickins's avatar
      tmpfs mempolicy: fix /proc/mounts corrupting memory · f2a07f40
      Hugh Dickins authored
      Recently I suggested using "mount -o remount,mpol=local /tmp" in NUMA
      mempolicy testing.  Very nasty.  Reading /proc/mounts, /proc/pid/mounts
      or /proc/pid/mountinfo may then corrupt one bit of kernel memory, often
      in a page table (causing "Bad swap" or "Bad page map" warning or "Bad
      pagetable" oops), sometimes in a vm_area_struct or rbnode or somewhere
      worse.  "mpol=prefer" and "mpol=prefer:Node" are equally toxic.
      
      Recent NUMA enhancements are not to blame: this dates back to 2.6.35,
      when commit e17f74af "mempolicy: don't call mpol_set_nodemask() when
      no_context" skipped mpol_parse_str()'s call to mpol_set_nodemask(),
      which used to initialize v.preferred_node, or set MPOL_F_LOCAL in flags.
      With slab poisoning, you can then rely on mpol_to_str() to set the bit
      for node 0x6b6b, probably in the next page above the caller's stack.
      
      mpol_parse_str() is only called from shmem_parse_options(): no_context
      is always true, so call it unused for now, and remove !no_context code.
      Set v.nodes or v.preferred_node or MPOL_F_LOCAL as mpol_to_str() might
      expect.  Then mpol_to_str() can ignore its no_context argument also,
      the mpol being appropriately initialized whether contextualized or not.
      Rename its no_context unused too, and let subsequent patch remove them
      (that's not needed for stable backporting, which would involve rejects).
      
      I don't understand why MPOL_LOCAL is described as a pseudo-policy:
      it's a reasonable policy which suffers from a confusing implementation
      in terms of MPOL_PREFERRED with MPOL_F_LOCAL.  I believe this would be
      much more robust if MPOL_LOCAL were recognized in switch statements
      throughout, MPOL_F_LOCAL deleted, and MPOL_PREFERRED use the (possibly
      empty) nodes mask like everyone else, instead of its preferred_node
      variant (I presume an optimization from the days before MPOL_LOCAL).
      But that would take me too long to get right and fully tested.
      Signed-off-by: default avatarHugh Dickins <hughd@google.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      f2a07f40
    • Eric Wong's avatar
      epoll: prevent missed events on EPOLL_CTL_MOD · 128dd175
      Eric Wong authored
      EPOLL_CTL_MOD sets the interest mask before calling f_op->poll() to
      ensure events are not missed.  Since the modifications to the interest
      mask are not protected by the same lock as ep_poll_callback, we need to
      ensure the change is visible to other CPUs calling ep_poll_callback.
      
      We also need to ensure f_op->poll() has an up-to-date view of past
      events which occured before we modified the interest mask.  So this
      barrier also pairs with the barrier in wq_has_sleeper().
      
      This should guarantee either ep_poll_callback or f_op->poll() (or both)
      will notice the readiness of a recently-ready/modified item.
      
      This issue was encountered by Andreas Voellmy and Junchang(Jason) Wang in:
      http://thread.gmane.org/gmane.linux.kernel/1408782/Signed-off-by: default avatarEric Wong <normalperson@yhbt.net>
      Cc: Hans Verkuil <hans.verkuil@cisco.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Davide Libenzi <davidel@xmailserver.org>
      Cc: Hans de Goede <hdegoede@redhat.com>
      Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
      Cc: David Miller <davem@davemloft.net>
      Cc: Eric Dumazet <eric.dumazet@gmail.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andreas Voellmy <andreas.voellmy@yale.edu>
      Tested-by: default avatar"Junchang(Jason) Wang" <junchang.wang@yale.edu>
      Cc: netdev@vger.kernel.org
      Cc: linux-fsdevel@vger.kernel.org
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      128dd175
  3. 30 Dec, 2012 13 commits
    • Linus Torvalds's avatar
      Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux · 4a490b78
      Linus Torvalds authored
      Pull DRM update from Dave Airlie:
       "This is a bit larger due to me not bothering to do anything since
        before Xmas, and other people working too hard after I had clearly
        given up.
      
        It's got the 3 main x86 driver fixes pulls, and a bunch of tegra
        fixes, doesn't fix the Ironlake bug yet, but that does seem to be
        getting closer.
      
         - radeon: gpu reset fixes and userspace packet support
         - i915: watermark fixes, workarounds, i830/845 fix,
         - nouveau: nvd9/kepler microcode fixes, accel is now enabled and
           working, gk106 support
         - tegra: misc fixes."
      
      * 'drm-next' of git://people.freedesktop.org/~airlied/linux: (34 commits)
        Revert "drm: tegra: protect DC register access with mutex"
        drm: tegra: program only one window during modeset
        drm: tegra: clean out old gem prototypes
        drm: tegra: remove redundant tegra2_tmds_config entry
        drm: tegra: protect DC register access with mutex
        drm: tegra: don't leave clients host1x member uninitialized
        drm: tegra: fix front_porch <-> back_porch mixup
        drm/nve0/graph: fix fuc, and enable acceleration on all known chipsets
        drm/nvc0/graph: fix fuc, and enable acceleration on GF119
        drm/nouveau/bios: cache ramcfg strap on later chipsets
        drm/nouveau/mxm: silence output if no bios data
        drm/nouveau/bios: parse/display extra version component
        drm/nouveau/bios: implement opcode 0xa9
        drm/nouveau/bios: update gpio parsing apis to match current design
        drm/nouveau: initial support for GK106
        drm/radeon: add WAIT_UNTIL to evergreen VM safe reg list
        drm/i915: disable shrinker lock stealing for create_mmap_offset
        drm/i915: optionally disable shrinker lock stealing
        drm/i915: fix flags in dma buf exporting
        drm/radeon: add support for MEM_WRITE packet
        ...
      4a490b78
    • Linus Torvalds's avatar
      Merge tag 'omap-late-cleanups' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · 8d91a42e
      Linus Torvalds authored
      Pull late ARM cleanups for omap from Olof Johansson:
       "From Tony Lindgren:
      
        Here are few more patches to finish the omap changes for multiplatform
        conversion that are not strictly fixes, but were too complex to do
        with the dependencies during the merge window.  Those are to move of
        serial-omap.h to platform_data, and the removal of remaining
        cpu_is_omap macro usage outside mach-omap2.
      
        Then there are several trivial fixes for typos and few minimal
        omap2plus_defconfig updates."
      
      * tag 'omap-late-cleanups' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
        arch/arm/mach-omap2/dpll3xxx.c: drop if around WARN_ON
        OMAP2: Fix a typo - replace regist with register.
        ARM/omap: use module_platform_driver macro
        ARM: OMAP2+: PMU: Remove unused header
        ARM: OMAP4: remove duplicated include from omap_hwmod_44xx_data.c
        ARM: OMAP2+: omap2plus_defconfig: enable twl4030 SoC audio
        ARM: OMAP2+: omap2plus_defconfig: Add tps65217 support
        ARM: OMAP2+: enable devtmpfs and devtmpfs automount
        ARM: OMAP2+: omap_twl: Change TWL4030_MODULE_PM_RECEIVER to TWL_MODULE_PM_RECEIVER
        ARM: OMAP2+: Drop plat/cpu.h for omap2plus
        ARM: OMAP: Split fb.c to remove last remaining cpu_is_omap usage
        MAINTAINERS: Add an entry for omap related .dts files
      8d91a42e
    • Linus Torvalds's avatar
      Merge tag 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · 4fe2dfab
      Linus Torvalds authored
      Pull ARM SoC fixes from Olof Johansson:
       "It's been quiet over the holidays, but we have had a couple of trivial
        fixes coming in for the newly introduced sunxi platform; one to add it
        to the multiplatform defconfig for build coverage, and one fixup for
        device tree strings."
      
      * tag 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
        sunxi: Change the machine compatible string.
        ARM: multi_v7_defconfig: Add ARCH_SUNXI
      4fe2dfab
    • Dave Airlie's avatar
      Revert "drm: tegra: protect DC register access with mutex" · d5757dbe
      Dave Airlie authored
      This reverts commit 83c0bcb6.
      
      Lucas pointed out this was a mistake, and I missed the discussion,
      so just revert it out to save a rebase.
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      d5757dbe
    • Lucas Stach's avatar
      drm: tegra: program only one window during modeset · 500df2e5
      Lucas Stach authored
      The intention is to program exactly WIN_A, not WIN_A and possibly
      others.
      Signed-off-by: default avatarLucas Stach <dev@lynxeye.de>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      500df2e5
    • Lucas Stach's avatar
      drm: tegra: clean out old gem prototypes · e39250aa
      Lucas Stach authored
      There is no gem.c anymore, those functions are implemented by the
      drm_cma_helpers now.
      Signed-off-by: default avatarLucas Stach <dev@lynxeye.de>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      e39250aa
    • Lucas Stach's avatar
      drm: tegra: remove redundant tegra2_tmds_config entry · fa416ddc
      Lucas Stach authored
      The 720p and 1080p entries are completely redundant, as we are matching
      the table entries against <=pclk.
      Also generalize the comment, as we are using those table entries even
      when driving other modes than the standard TV ones.
      Signed-off-by: default avatarLucas Stach <dev@lynxeye.de>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      fa416ddc
    • Lucas Stach's avatar
      drm: tegra: protect DC register access with mutex · 83c0bcb6
      Lucas Stach authored
      Window properties are programmed through a shared aperture and have to
      happen atomically. Also we do the read-update-write dance on some of the
      shared regs.
      To make sure that different functions don't stumble over each other
      protect the register access with a mutex.
      Signed-off-by: default avatarLucas Stach <dev@lynxeye.de>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      83c0bcb6
    • Lucas Stach's avatar
      drm: tegra: don't leave clients host1x member uninitialized · 4026bfb3
      Lucas Stach authored
      No real problem for now, as nothing is using this, but leaving it
      unitialized is asking for trouble later on.
      Signed-off-by: default avatarLucas Stach <dev@lynxeye.de>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      4026bfb3
    • Lucas Stach's avatar
      drm: tegra: fix front_porch <-> back_porch mixup · 40495089
      Lucas Stach authored
      Fixes wrong picture offset observed when using HDMI output with a
      Technisat HD TV.
      Signed-off-by: default avatarLucas Stach <dev@lynxeye.de>
      Acked-by: default avatarMark Zhang <markz@nvidia.com>
      Tested-by: default avatarMark Zhang <markz@nvidia.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      40495089
    • Dave Airlie's avatar
      Merge branch 'drm-intel-fixes' of git://people.freedesktop.org/~danvet/drm-intel into drm-next · 8be0e5c4
      Dave Airlie authored
      Some fixes for 3.8:
      - Watermark fixups from Chris Wilson (4 pieces).
      - 2 snb workarounds, seem to be recently added to our internal DB.
      - workaround for the infamous i830/i845 hang, seems now finally solid!
        Based on Chris' fix for SNA, now also for UXA/mesa&old SNA.
      - Some more fixlets for shrinker-pulls-the-rug issues (Chris&me).
      - Fix dma-buf flags when exporting (you).
      - Disable the VGA plane if it's enabled on lid open - similar fix in
        spirit to the one I've sent you last weeek, BIOS' really like to mess
        with the display when closing the lid (awesome debug work from Krzysztof
        Mazur).
      
      * 'drm-intel-fixes' of git://people.freedesktop.org/~danvet/drm-intel:
        drm/i915: disable shrinker lock stealing for create_mmap_offset
        drm/i915: optionally disable shrinker lock stealing
        drm/i915: fix flags in dma buf exporting
        i915: ensure that VGA plane is disabled
        drm/i915: Preallocate the drm_mm_node prior to manipulating the GTT drm_mm manager
        drm: Export routines for inserting preallocated nodes into the mm manager
        drm/i915: don't disable disconnected outputs
        drm/i915: Implement workaround for broken CS tlb on i830/845
        drm/i915: Implement WaSetupGtModeTdRowDispatch
        drm/i915: Implement WaDisableHiZPlanesWhenMSAAEnabled
        drm/i915: Prefer CRTC 'active' rather than 'enabled' during WM computations
        drm/i915: Clear self-refresh watermarks when disabled
        drm/i915: Double the cursor self-refresh latency on Valleyview
        drm/i915: Fixup cursor latency used for IVB lp3 watermarks
      8be0e5c4
    • Dave Airlie's avatar
      Merge branch 'drm-fixes-3.8' of git://people.freedesktop.org/~agd5f/linux into drm-next · b1d778b9
      Dave Airlie authored
      Misc fixes for reset and new packets for userspace usage.
      
      * 'drm-fixes-3.8' of git://people.freedesktop.org/~agd5f/linux:
        drm/radeon: add WAIT_UNTIL to evergreen VM safe reg list
        drm/radeon: add support for MEM_WRITE packet
        drm/radeon: restore modeset late in GPU reset path
        drm/radeon: avoid deadlock in pm path when waiting for fence
        drm/radeon: don't leave fence blocked process on failed GPU reset
      b1d778b9
    • Dave Airlie's avatar
      Merge branch 'drm-nouveau-fixes-3.8' of... · 344f9067
      Dave Airlie authored
      Merge branch 'drm-nouveau-fixes-3.8' of git://anongit.freedesktop.org/git/nouveau/linux-2.6 into drm-next
      
      Fixes the accel support for nvd9 + kepler chipsets, also fixes GK106 support.
      
      * 'drm-nouveau-fixes-3.8' of git://anongit.freedesktop.org/git/nouveau/linux-2.6:
        drm/nve0/graph: fix fuc, and enable acceleration on all known chipsets
        drm/nvc0/graph: fix fuc, and enable acceleration on GF119
        drm/nouveau/bios: cache ramcfg strap on later chipsets
        drm/nouveau/mxm: silence output if no bios data
        drm/nouveau/bios: parse/display extra version component
        drm/nouveau/bios: implement opcode 0xa9
        drm/nouveau/bios: update gpio parsing apis to match current design
        drm/nouveau: initial support for GK106
      344f9067
  4. 28 Dec, 2012 6 commits
    • Zlatko Calusic's avatar
      mm: fix null pointer dereference in wait_iff_congested() · ecccd124
      Zlatko Calusic authored
      An unintended consequence of commit 4ae0a48b ("mm: modify
      pgdat_balanced() so that it also handles order-0") is that
      wait_iff_congested() can now be called with NULL 'struct zone *'
      producing kernel oops like this:
      
        BUG: unable to handle kernel NULL pointer dereference
        IP: [<ffffffff811542d9>] wait_iff_congested+0x59/0x140
      
      This trivial patch fixes it.
      Reported-by: default avatarZhouping Liu <zliu@redhat.com>
      Reported-and-tested-by: default avatarSedat Dilek <sedat.dilek@gmail.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Mel Gorman <mgorman@suse.de>
      Cc: Hugh Dickins <hughd@google.com>
      Signed-off-by: default avatarZlatko Calusic <zlatko.calusic@iskon.hr>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      ecccd124
    • Olof Johansson's avatar
      Merge tag 'sunxi-fixes-for-3.8-rc2' of git://github.com/mripard/linux into fixes · 2e376799
      Olof Johansson authored
      From Maxime Ripard:
      Fixes for the sunxi core to be merged in 3.8-rc2
      
      * tag 'sunxi-fixes-for-3.8-rc2' of git://github.com/mripard/linux:
        sunxi: Change the machine compatible string.
        ARM: multi_v7_defconfig: Add ARCH_SUNXI
      2e376799
    • Sage Weil's avatar
      libceph: fix protocol feature mismatch failure path · 0fa6ebc6
      Sage Weil authored
      We should not set con->state to CLOSED here; that happens in
      ceph_fault() in the caller, where it first asserts that the state
      is not yet CLOSED.  Avoids a BUG when the features don't match.
      
      Since the fail_protocol() has become a trivial wrapper, replace
      calls to it with direct calls to reset_connection().
      Signed-off-by: default avatarSage Weil <sage@inktank.com>
      Reviewed-by: default avatarAlex Elder <elder@inktank.com>
      0fa6ebc6
    • Alex Elder's avatar
      libceph: WARN, don't BUG on unexpected connection states · 122070a2
      Alex Elder authored
      A number of assertions in the ceph messenger are implemented with
      BUG_ON(), killing the system if connection's state doesn't match
      what's expected.  At this point our state model is (evidently) not
      well understood enough for these assertions to trigger a BUG().
      Convert all BUG_ON(con->state...) calls to be WARN_ON(con->state...)
      so we learn about these issues without killing the machine.
      
      We now recognize that a connection fault can occur due to a socket
      closure at any time, regardless of the state of the connection.  So
      there is really nothing we can assert about the state of the
      connection at that point so eliminate that assertion.
      Reported-by: default avatarUgis <ugis22@gmail.com>
      Tested-by: default avatarUgis <ugis22@gmail.com>
      Signed-off-by: default avatarAlex Elder <elder@inktank.com>
      Reviewed-by: default avatarSage Weil <sage@inktank.com>
      122070a2
    • Alex Elder's avatar
      libceph: always reset osds when kicking · e6d50f67
      Alex Elder authored
      When ceph_osdc_handle_map() is called to process a new osd map,
      kick_requests() is called to ensure all affected requests are
      updated if necessary to reflect changes in the osd map.  This
      happens in two cases:  whenever an incremental map update is
      processed; and when a full map update (or the last one if there is
      more than one) gets processed.
      
      In the former case, the kick_requests() call is followed immediately
      by a call to reset_changed_osds() to ensure any connections to osds
      affected by the map change are reset.  But for full map updates
      this isn't done.
      
      Both cases should be doing this osd reset.
      
      Rather than duplicating the reset_changed_osds() call, move it into
      the end of kick_requests().
      Signed-off-by: default avatarAlex Elder <elder@inktank.com>
      Reviewed-by: default avatarSage Weil <sage@inktank.com>
      e6d50f67
    • Alex Elder's avatar
      libceph: move linger requests sooner in kick_requests() · ab60b16d
      Alex Elder authored
      The kick_requests() function is called by ceph_osdc_handle_map()
      when an osd map change has been indicated.  Its purpose is to
      re-queue any request whose target osd is different from what it
      was when it was originally sent.
      
      It is structured as two loops, one for incomplete but registered
      requests, and a second for handling completed linger requests.
      As a special case, in the first loop if a request marked to linger
      has not yet completed, it is moved from the request list to the
      linger list.  This is as a quick and dirty way to have the second
      loop handle sending the request along with all the other linger
      requests.
      
      Because of the way it's done now, however, this quick and dirty
      solution can result in these incomplete linger requests never
      getting re-sent as desired.  The problem lies in the fact that
      the second loop only arranges for a linger request to be sent
      if it appears its target osd has changed.  This is the proper
      handling for *completed* linger requests (it avoids issuing
      the same linger request twice to the same osd).
      
      But although the linger requests added to the list in the first loop
      may have been sent, they have not yet completed, so they need to be
      re-sent regardless of whether their target osd has changed.
      
      The first required fix is we need to avoid calling __map_request()
      on any incomplete linger request.  Otherwise the subsequent
      __map_request() call in the second loop will find the target osd
      has not changed and will therefore not re-send the request.
      
      Second, we need to be sure that a sent but incomplete linger request
      gets re-sent.  If the target osd is the same with the new osd map as
      it was when the request was originally sent, this won't happen.
      This can be fixed through careful handling when we move these
      requests from the request list to the linger list, by unregistering
      the request *before* it is registered as a linger request.  This
      works because a side-effect of unregistering the request is to make
      the request's r_osd pointer be NULL, and *that* will ensure the
      second loop actually re-sends the linger request.
      
      Processing of such a request is done at that point, so continue with
      the next one once it's been moved.
      Signed-off-by: default avatarAlex Elder <elder@inktank.com>
      Reviewed-by: default avatarSage Weil <sage@inktank.com>
      ab60b16d
  5. 27 Dec, 2012 5 commits
    • Linus Torvalds's avatar
      Merge tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging · 101e5c74
      Linus Torvalds authored
      Pull hwmon fixes from Guenter Roeck:
      
       - Report i2c errors to userspace in lm73 driver
      
       - Fix problem with DIV_ROUND_CLOSEST and unsigned divisors in emc6w201
         driver
      
      * tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
        hwmon: (emc6w201) Fix DIV_ROUND_CLOSEST problem with unsigned divisors
        hwmon: (lm73} Detect and report i2c bus errors
      101e5c74
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace · ddf75ae3
      Linus Torvalds authored
      Pull namespace fixes from Eric Biederman:
       "This tree includes two bug fixes for problems Oleg spotted on his
        review of the recent pid namespace work.  A small fix to not enable
        bottom halves with irqs disabled, and a trivial build fix for f2fs
        with user namespaces enabled."
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace:
        f2fs: Don't assign e_id in f2fs_acl_from_disk
        proc: Allow proc_free_inum to be called from any context
        pidns: Stop pid allocation when init dies
        pidns: Outlaw thread creation after unshare(CLONE_NEWPID)
      ddf75ae3
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 7fd83b47
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
      1) GRE tunnel drivers don't set the transport header properly, they also
         blindly deref the inner protocol ipv4 and needs some checks.  Fixes
         from Isaku Yamahata.
      
      2) Fix sleeps while atomic in netdevice rename code, from Eric Dumazet.
      
      3) Fix double-spinlock in solos-pci driver, from Dan Carpenter.
      
      4) More ARP bug fixes.  Fix lockdep splat in arp_solicit() and then the
         bug accidentally added by that fix.  From Eric Dumazet and Cong Wang.
      
      5) Remove some __dev* annotations that slipped back in, as well as all
         HOTPLUG references.  From Greg KH
      
      6) RDS protocol uses wrong interfaces to access scatter-gather elements,
         causing a regression.  From Mike Marciniszyn.
      
      7) Fix build error in cpts driver, from Richard Cochran.
      
      8) Fix arithmetic in packet scheduler, from Stefan Hasko.
      
      9) Similarly, fix association during calculation of random backoff in
         batman-adv.  From Akinobu Mita.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (21 commits)
        ipv6/ip6_gre: set transport header correctly
        ipv4/ip_gre: set transport header correctly to gre header
        IB/rds: suppress incompatible protocol when version is known
        IB/rds: Correct ib_api use with gs_dma_address/sg_dma_len
        net/vxlan: Use the underlying device index when joining/leaving multicast groups
        tcp: should drop incoming frames without ACK flag set
        netprio_cgroup: define sk_cgrp_prioidx only if NETPRIO_CGROUP is enabled
        cpts: fix a run time warn_on.
        cpts: fix build error by removing useless code.
        batman-adv: fix random jitter calculation
        arp: fix a regression in arp_solicit()
        net: sched: integer overflow fix
        CONFIG_HOTPLUG removal from networking core
        Drivers: network: more __dev* removal
        bridge: call br_netpoll_disable in br_add_if
        ipv4: arp: fix a lockdep splat in arp_solicit()
        tuntap: dont use a private kmem_cache
        net: devnet_rename_seq should be a seqcount
        ip_gre: fix possible use after free
        ip_gre: make ipgre_tunnel_xmit() not parse network header as IP unconditionally
        ...
      7fd83b47
    • Theodore Ts'o's avatar
      ext4: avoid hang when mounting non-journal filesystems with orphan list · 0e9a9a1a
      Theodore Ts'o authored
      When trying to mount a file system which does not contain a journal,
      but which does have a orphan list containing an inode which needs to
      be truncated, the mount call with hang forever in
      ext4_orphan_cleanup() because ext4_orphan_del() will return
      immediately without removing the inode from the orphan list, leading
      to an uninterruptible loop in kernel code which will busy out one of
      the CPU's on the system.
      
      This can be trivially reproduced by trying to mount the file system
      found in tests/f_orphan_extents_inode/image.gz from the e2fsprogs
      source tree.  If a malicious user were to put this on a USB stick, and
      mount it on a Linux desktop which has automatic mounts enabled, this
      could be considered a potential denial of service attack.  (Not a big
      deal in practice, but professional paranoids worry about such things,
      and have even been known to allocate CVE numbers for such problems.)
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      Reviewed-by: default avatarZheng Liu <wenqing.lz@taobao.com>
      Cc: stable@vger.kernel.org
      0e9a9a1a
    • Theodore Ts'o's avatar
      ext4: lock i_mutex when truncating orphan inodes · 721e3eba
      Theodore Ts'o authored
      Commit c278531d added a warning when ext4_flush_unwritten_io() is
      called without i_mutex being taken.  It had previously not been taken
      during orphan cleanup since races weren't possible at that point in
      the mount process, but as a result of this c278531d, we will now see
      a kernel WARN_ON in this case.  Take the i_mutex in
      ext4_orphan_cleanup() to suppress this warning.
      Reported-by: default avatarAlexander Beregalov <a.beregalov@gmail.com>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      Reviewed-by: default avatarZheng Liu <wenqing.lz@taobao.com>
      Cc: stable@vger.kernel.org
      721e3eba
  6. 26 Dec, 2012 10 commits