Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Commits on Apr 5, 2012
  1. Merge branch 'configs-3.3' into pf-3.3

    Oleksandr Natalenko authored
  2. configs-3.3: add config for Dell Inspiron 1525 laptop

    Oleksandr Natalenko authored
  3. Merge branch 'bfq-3.3' into pf-3.3

    Oleksandr Natalenko authored
  4. bfq-3.3: merge BFQ v3r3 for Linux v3.3

    Oleksandr Natalenko authored
Commits on Apr 2, 2012
  1. fix merge conflict

    Oleksandr Natalenko authored
  2. @gregkh

    Linux 3.3.1

    gregkh authored
  3. @gregkh

    ASPM: Fix pcie devices with non-pcie children

    Matthew Garrett authored gregkh committed
    commit c9651e7 upstream.
    
    Since 3.2.12 and 3.3, some systems are failing to boot with a BUG_ON.
    Some other systems using the pata_jmicron driver fail to boot because no
    disks are detected.  Passing pcie_aspm=force on the kernel command line
    works around it.
    
    The cause: commit 4949be1 ("PCI: ignore pre-1.1 ASPM quirking when
    ASPM is disabled") changed the behaviour of pcie_aspm_sanity_check() to
    always return 0 if aspm is disabled, in order to avoid cases where we
    changed ASPM state on pre-PCIe 1.1 devices.
    
    This skipped the secondary function of pcie_aspm_sanity_check which was
    to avoid us enabling ASPM on devices that had non-PCIe children, causing
    trouble later on.  Move the aspm_disabled check so we continue to honour
    that scenario.
    
    Addresses https://bugzilla.kernel.org/show_bug.cgi?id=42979 and
              http://bugs.debian.org/665420
    
    Reported-by: Romain Francoise <romain@orebokech.com> # kernel panic
    Reported-by: Chris Holland <bandidoirlandes@gmail.com> # disk detection trouble
    Signed-off-by: Matthew Garrett <mjg@redhat.com>
    Tested-by: Hatem Masmoudi <hatem.masmoudi@gmail.com> # Dell Latitude E5520
    Tested-by: janek <jan0x6c@gmail.com> # pata_jmicron with JMB362/JMB363
    [jn: with more symptoms in log message]
    Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  4. @gregkh

    serial: sh-sci: fix a race of DMA submit_tx on transfer

    Yoshii Takashi authored gregkh committed
    commit 49d4bca upstream.
    
    When DMA is enabled, sh-sci transfer begins with
     uart_start()
      sci_start_tx()
        if (cookie_tx < 0) schedule_work()
    Then, starts DMA when wq scheduled, -- (A)
     process_one_work()
      work_fn_rx()
       cookie_tx = desc->submit_tx()
    And finishes when DMA transfer ends, -- (B)
     sci_dma_tx_complete()
      async_tx_ack()
      cookie_tx = -EINVAL
      (possible another schedule_work())
    
    This A to B sequence is not reentrant, since controlling variables
    (for example, cookie_tx above) are not queues nor lists. So, they
    must be invoked as A B A B..., otherwise results in kernel crash.
    
    To ensure the sequence, sci_start_tx() seems to test if cookie_tx < 0
    (represents "not used") to call schedule_work().
    But cookie_tx will not be set (to a cookie, also means "used") until
    in the middle of work queue scheduled function work_fn_tx().
    
    This gap between the test and set allows the breakage of the sequence
    under the very frequently call of uart_start().
    Another gap between async_tx_ack() and another schedule_work() results
    in the same issue, too.
    
    This patch introduces a new condition "cookie_tx == 0" just to mark
    it is "busy" and assign it within spin-locked region to fill the gaps.
    
    Signed-off-by: Takashi Yoshii <takashi.yoshii.zj@renesas.com>
    Reviewed-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
    Signed-off-by: Paul Mundt <lethal@linux-sh.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  5. @swarren @gregkh

    ARM: tegra: Fix device tree AUXDATA for USB/EHCI

    swarren authored gregkh committed
    commit 8c3ec84 upstream.
    
    Commit 4a53f4e "USB: ehci-tegra: add probing through device tree" added
    AUXDATA for Tegra's USB/EHCI controller. However, it pointed the platform
    data at a location containing the address of the intended platform data,
    rather than the platform data itself. This change fixes that.
    
    Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  6. @gregkh

    nfsd: don't allow zero length strings in cache_parse()

    Dan Carpenter authored gregkh committed
    commit 6d8d174 upstream.
    
    There is no point in passing a zero length string here and quite a
    few of that cache_parse() implementations will Oops if count is
    zero.
    
    Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
    Signed-off-by: J. Bruce Fields <bfields@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  7. @johnstultz-work @gregkh

    rtc: Provide flag for rtc devices that don't support UIE

    johnstultz-work authored gregkh committed
    commit 4a64990 upstream.
    
    Richard Weinberger noticed that on some RTC hardware that
    doesn't support UIE mode, due to coarse granular alarms
    (like 1minute resolution), the current virtualized RTC
    support doesn't properly error out when UIE is enabled.
    
    Instead the current code queues an alarm for the next second,
    but it won't fire until up to a miniute later.
    
    This patch provides a generic way to flag this sort of hardware
    and fixes the issue on the mpc5121 where Richard noticed the
    problem.
    
    Reported-by: Richard Weinberger <richard@nod.at>
    Tested-by: Richard Weinberger <richard@nod.at>
    Signed-off-by: John Stultz <john.stultz@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  8. @cmetcalf-tilera @gregkh

    compat: use sys_sendfile64() implementation for sendfile syscall

    cmetcalf-tilera authored gregkh committed
    commit 1631fce upstream.
    
    <asm-generic/unistd.h> was set up to use sys_sendfile() for the 32-bit
    compat API instead of sys_sendfile64(), but in fact the right thing to
    do is to use sys_sendfile64() in all cases.  The 32-bit sendfile64() API
    in glibc uses the sendfile64 syscall, so it has to be capable of doing
    full 64-bit operations.  But the sys_sendfile() kernel implementation
    has a MAX_NON_LFS test in it which explicitly limits the offset to 2^32.
    So, we need to use the sys_sendfile64() implementation in the kernel
    for this case.
    
    Acked-by: Arnd Bergmann <arnd@arndb.de>
    Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  9. @gregkh

    x86, tls: Off by one limit check

    Dan Carpenter authored gregkh committed
    commit 8f0750f upstream.
    
    These are used as offsets into an array of GDT_ENTRY_TLS_ENTRIES members
    so GDT_ENTRY_TLS_ENTRIES is one past the end of the array.
    
    Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
    Link: http://lkml.kernel.org/r/20120324075250.GA28258@elgon.mountain
    Signed-off-by: H. Peter Anvin <hpa@zytor.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  10. @gregkh

    x86, tsc: Skip refined tsc calibration on systems with reliable TSC

    Alok Kataria authored gregkh committed
    commit 57779dc upstream.
    
    While running the latest Linux as guest under VMware in highly
    over-committed situations, we have seen cases when the refined TSC
    algorithm fails to get a valid tsc_start value in
    tsc_refine_calibration_work from multiple attempts. As a result the
    kernel keeps on scheduling the tsc_irqwork task for later. Subsequently
    after several attempts when it gets a valid start value it goes through
    the refined calibration and either bails out or uses the new results.
    Given that the kernel originally read the TSC frequency from the
    platform, which is the best it can get, I don't think there is much
    value in refining it.
    
    So  for systems which get the TSC frequency from the platform we
    should skip the refined tsc algorithm.
    
    We can use the TSC_RELIABLE cpu cap flag to detect this, right now it is
    set only on VMware and for Moorestown Penwell both of which have there
    own TSC calibration methods.
    
    Signed-off-by: Alok N Kataria <akataria@vmware.com>
    Cc: John Stultz <johnstul@us.ibm.com>
    Cc: Dirk Brandewie <dirk.brandewie@gmail.com>
    Cc: Alan Cox <alan@linux.intel.com>
    [jstultz: Reworked to simply not schedule the refining work,
    rather then scheduling the work and bombing out later]
    Signed-off-by: John Stultz <john.stultz@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  11. @neilbrown @gregkh

    lockd: fix arg parsing for grace_period and timeout.

    neilbrown authored gregkh committed
    commit de5b8e8 upstream.
    
    If you try to set grace_period or timeout via a module parameter
    to lockd, and do this on a big-endian machine where
    
       sizeof(int) != sizeof(unsigned long)
    
    it won't work.  This number given will be effectively shifted right
    by the difference in those two sizes.
    
    So cast kp->arg properly to get correct result.
    
    Signed-off-by: NeilBrown <neilb@suse.de>
    Signed-off-by: J. Bruce Fields <bfields@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  12. @gregkh

    net: fix a potential rcu_read_lock() imbalance in rt6_fill_node()

    Eric Dumazet authored gregkh committed
    [ Upstream commit 94f826b ]
    
    Commit f2c31e3 (net: fix NULL dereferences in check_peer_redir() )
    added a regression in rt6_fill_node(), leading to rcu_read_lock()
    imbalance.
    
    Thats because NLA_PUT() can make a jump to nla_put_failure label.
    
    Fix this by using nla_put()
    
    Many thanks to Ben Greear for his help
    
    Reported-by: Ben Greear <greearb@candelatech.com>
    Reported-by: Dave Jones <davej@redhat.com>
    Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
    Tested-by: Ben Greear <greearb@candelatech.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  13. @gregkh

    xfrm: Access the replay notify functions via the registered callbacks

    Steffen Klassert authored gregkh committed
    [ Upstream commit 1265fd6 ]
    
    We call the wrong replay notify function when we use ESN replay
    handling. This leads to the fact that we don't send notifications
    if we use ESN. Fix this by calling the registered callbacks instead
    of xfrm_replay_notify().
    
    Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  14. @gregkh

    sky2: override for PCI legacy power management

    stephen hemminger authored gregkh committed
    [ Upstream commit 5676cc7 ]
    
    Some BIOS's don't setup power management correctly (what else is
    new) and don't allow use of PCI Express power control. Add a special
    exception module parameter to allow working around this issue.
    Based on slightly different patch by Knut Petersen.
    
    Reported-by: Arkadiusz Miskiewicz <arekm@maven.pl>
    Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  15. @gregkh

    net: fix napi_reuse_skb() skb reserve

    Eric Dumazet authored gregkh committed
    [ Upstream commit 2a2a459 ]
    
    napi->skb is allocated in napi_get_frags() using
    netdev_alloc_skb_ip_align(), with a reserve of NET_SKB_PAD +
    NET_IP_ALIGN bytes.
    
    However, when such skb is recycled in napi_reuse_skb(), it ends with a
    reserve of NET_IP_ALIGN which is suboptimal.
    
    Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
    Cc: Herbert Xu <herbert@gondor.apana.org.au>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  16. @bcrl @gregkh

    Fix pppol2tp getsockname()

    bcrl authored gregkh committed
    [ Upstream commit bbdb32c ]
    
    While testing L2TP functionality, I came across a bug in getsockname().  The
    IP address returned within the pppol2tp_addr's addr memember was not being
    set to the IP  address in use.  This bug is caused by using inet_sk() on the
    wrong socket (the L2TP socket rather than the underlying UDP socket), and was
    likely introduced during the addition of L2TPv3 support.
    
    Signed-off-by: Benjamin LaHaise <bcrl@kvack.org>
    Signed-off-by: James Chapman <jchapman@katalix.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  17. @kernelslacker @gregkh

    Remove printk from rds_sendmsg

    kernelslacker authored gregkh committed
    [ Upstream commit a6506e1 ]
    
    no socket layer outputs a message for this error and neither should rds.
    
    Signed-off-by: Dave Jones <davej@redhat.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  18. @gregkh

    ipv6: fix incorrent ipv6 ipsec packet fragment

    Gao feng authored gregkh committed
    [ Upstream commit 1f85851 ]
    
    Since commit 299b076(ipv6: Fix IPsec slowpath fragmentation problem)
    In func ip6_append_data,after call skb_put(skb, fraglen + dst_exthdrlen)
    the skb->len contains dst_exthdrlen,and we don't reduce dst_exthdrlen at last
    This will make fraggap>0 in next "while cycle",and cause the size of skb incorrent
    
    Fix this by reserve headroom for dst_exthdrlen.
    
    Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
    Acked-by: Steffen Klassert <steffen.klassert@secunet.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  19. @gregkh

    net: bpf_jit: fix BPF_S_LDX_B_MSH compilation

    Eric Dumazet authored gregkh committed
    [ Upstream commit dc72d99 ]
    
    Matt Evans spotted that x86 bpf_jit was incorrectly handling negative
    constant offsets in BPF_S_LDX_B_MSH instruction.
    
    We need to abort JIT compilation like we do in common_load so that
    filter uses the interpreter code and can call __load_pointer()
    
    Reference: http://lists.openwall.net/netdev/2011/07/19/11
    
    Thanks to Indan Zupancic to bring back this issue.
    
    Reported-by: Matt Evans <matt@ozlabs.org>
    Reported-by: Indan Zupancic <indan@nul.nu>
    Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  20. @gregkh

    drm/i915: suspend fbdev device around suspend/hibernate

    Dave Airlie authored gregkh committed
    commit 3fa016a upstream.
    
    Looking at hibernate overwriting I though it looked like a cursor,
    so I tracked down this missing piece to stop the cursor blink
    timer. I've no idea if this is sufficient to fix the hibernate
    problems people are seeing, but please test it.
    
    Both radeon and nouveau have done this for a long time.
    
    I've run this personally all night hib/resume cycles with no fails.
    
    Reviewed-by: Keith Packard <keithp@keithp.com>
    Reported-by: Petr Tesarik <kernel@tesarici.cz>
    Reported-by: Stanislaw Gruszka <sgruszka@redhat.com>
    Reported-by: Lots of misc segfaults after hibernate across the world.
    Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=37142
    Tested-by: Dave Airlie <airlied@redhat.com>
    Tested-by: Bojan Smojver <bojan@rexursive.com>
    Tested-by: Andreas Hartmann <andihartmann@01019freenet.de>
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  21. @sashalevin @gregkh

    module: Remove module size limit

    sashalevin authored gregkh committed
    commit f946eeb upstream.
    
    Module size was limited to 64MB, this was legacy limitation due to vmalloc()
    which was removed a while ago.
    
    Limiting module size to 64MB is both pointless and affects real world use
    cases.
    
    Cc: Tim Abbott <tim.abbott@oracle.com>
    Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  22. @gregkh

    NFSv4.1: Fix layoutcommit error handling

    Trond Myklebust authored gregkh committed
    commit e59d27e upstream.
    
    Firstly, task->tk_status will always return negative error values,
    so the current tests for 'NFS4ERR_DELEG_REVOKED' etc. are all being
    ignored.
    Secondly, clean up the code so that we only need to test
    task->tk_status once!
    
    Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  23. @gregkh

    NFSv4: Fix two infinite loops in the mount code

    Trond Myklebust authored gregkh committed
    commit 05e9cfb upstream.
    
    We can currently loop forever in nfs4_lookup_root() and in
    nfs41_proc_secinfo_no_name(), if the first iteration returns a
    NFS4ERR_DELAY or something else that causes exception.retry to get
    set.
    
    Reported-by: Weston Andros Adamson <dros@netapp.com>
    Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  24. @gregkh

    slub: Do not hold slub_lock when calling sysfs_slab_add()

    Christoph Lameter authored gregkh committed
    commit 66c4c35 upstream.
    
    sysfs_slab_add() calls various sysfs functions that actually may
    end up in userspace doing all sorts of things.
    
    Release the slub_lock after adding the kmem_cache structure to the list.
    At that point the address of the kmem_cache is not known so we are
    guaranteed exlusive access to the following modifications to the
    kmem_cache structure.
    
    If the sysfs_slab_add fails then reacquire the slub_lock to
    remove the kmem_cache structure from the list.
    
    Reported-by: Sasha Levin <levinsasha928@gmail.com>
    Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
    Signed-off-by: Christoph Lameter <cl@linux.com>
    Signed-off-by: Pekka Enberg <penberg@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  25. @jankara @gregkh

    xfs: Fix oops on IO error during xlog_recover_process_iunlinks()

    jankara authored gregkh committed
    commit d97d32e upstream.
    
    When an IO error happens during inode deletion run from
    xlog_recover_process_iunlinks() filesystem gets shutdown. Thus any subsequent
    attempt to read buffers fails. Code in xlog_recover_process_iunlinks() does not
    count with the fact that read of a buffer which was read a while ago can
    really fail which results in the oops on
      agi = XFS_BUF_TO_AGI(agibp);
    
    Fix the problem by cleaning up the buffer handling in
    xlog_recover_process_iunlinks() as suggested by Dave Chinner. We release buffer
    lock but keep buffer reference to AG buffer. That is enough for buffer to stay
    pinned in memory and we don't have to call xfs_read_agi() all the time.
    
    Signed-off-by: Jan Kara <jack@suse.cz>
    Reviewed-by: Dave Chinner <dchinner@redhat.com>
    Signed-off-by: Ben Myers <bpm@sgi.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  26. @standby24x7 @gregkh

    backlight: fix typo in tosa_lcd.c

    standby24x7 authored gregkh committed
    commit 8da00ed upstream.
    
    Fix typo in drivers/video/backlight/tosa_lcd.c
    "tosa_lcd_reume" should be "tosa_lcd_resume".
    
    Signed-off-by: Masanari Iida <standby24x7@gmail.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  27. @jthornber @gregkh

    dm thin: fix stacked bi_next usage

    jthornber authored gregkh committed
    commit 6f94a4c upstream.
    
    Avoid using the bi_next field for the holder of a cell when deferring
    bios because a stacked device below might change it.  Store the
    holder in a new field in struct cell instead.
    
    When a cell is created, the bio that triggered creation (the holder) was
    added to the same bio list as subsequent bios.  In some cases we pass
    this holder bio directly to devices underneath.  If those devices use
    the bi_next field there will be trouble...
    
    This also simplifies some code that had to work out which bio was the
    holder.
    
    Signed-off-by: Joe Thornber <ejt@redhat.com>
    Signed-off-by: Mike Snitzer <snitzer@redhat.com>
    Signed-off-by: Alasdair G Kergon <agk@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  28. @jthornber @gregkh

    dm persistent data: fix btree rebalancing after remove

    jthornber authored gregkh committed
    commit b098890 upstream.
    
    When we remove an entry from a node we sometimes rebalance with it's
    two neighbours.  This wasn't being done correctly; in some cases
    entries have to move all the way from the right neighbour to the left
    neighbour, or vice versa.  This patch pretty much re-writes the
    balancing code to fix it.
    
    This code is barely used currently; only when you delete a thin
    device, and then only if you have hundreds of them in the same pool.
    Once we have discard support, which removes mappings, this will be used
    much more heavily.
    
    Signed-off-by: Joe Thornber <ejt@redhat.com>
    Signed-off-by: Mike Snitzer <snitzer@redhat.com>
    Signed-off-by: Alasdair G Kergon <agk@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  29. @andreiw @gregkh

    dm exception store: fix init error path

    andreiw authored gregkh committed
    commit aadbe26 upstream.
    
    Call the correct exit function on failure in dm_exception_store_init.
    
    Signed-off-by: Andrei Warkentin <andrey.warkentin@gmail.com>
    Acked-by: Mike Snitzer <snitzer@redhat.com>
    Signed-off-by: Alasdair G Kergon <agk@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  30. @gregkh

    dm crypt: add missing error handling

    Mikulas Patocka authored gregkh committed
    commit 72c6e7a upstream.
    
    Always set io->error to -EIO when an error is detected in dm-crypt.
    
    There were cases where an error code would be set only if we finish
    processing the last sector. If there were other encryption operations in
    flight, the error would be ignored and bio would be returned with
    success as if no error happened.
    
    This bug is present in kcryptd_crypt_write_convert, kcryptd_crypt_read_convert
    and kcryptd_async_done.
    
    Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
    Reviewed-by: Milan Broz <mbroz@redhat.com>
    Signed-off-by: Alasdair G Kergon <agk@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  31. @gregkh

    dm crypt: fix mempool deadlock

    Mikulas Patocka authored gregkh committed
    commit aeb2dea upstream.
    
    This patch fixes a possible deadlock in dm-crypt's mempool use.
    
    Currently, dm-crypt reserves a mempool of MIN_BIO_PAGES reserved pages.
    It allocates first MIN_BIO_PAGES with non-failing allocation (the allocation
    cannot fail and waits until the mempool is refilled). Further pages are
    allocated with different gfp flags that allow failing.
    
    Because allocations may be done in parallel, this code can deadlock. Example:
    There are two processes, each tries to allocate MIN_BIO_PAGES and the processes
    run simultaneously.
    It may end up in a situation where each process allocates (MIN_BIO_PAGES / 2)
    pages. The mempool is exhausted. Each process waits for more pages to be freed
    to the mempool, which never happens.
    
    To avoid this deadlock scenario, this patch changes the code so that only
    the first page is allocated with non-failing gfp mask. Allocation of further
    pages may fail.
    
    Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
    Signed-off-by: Milan Broz <mbroz@redhat.com>
    Signed-off-by: Alasdair G Kergon <agk@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Something went wrong with that request. Please try again.