lkml.org 
[lkml]   [2013]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[ 09/57] bcache: Fix a shrinker deadlock
    Date
    3.11-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Kent Overstreet <kmo@daterainc.com>

    commit a698e08c82dfb9771e0bac12c7337c706d729b6d upstream.

    GFP_NOIO means we could be getting called recursively - mca_alloc() ->
    mca_data_alloc() - definitely can't use mutex_lock(bucket_lock) then.
    Whoops.

    Signed-off-by: Kent Overstreet <kmo@daterainc.com>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    drivers/md/bcache/btree.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    --- a/drivers/md/bcache/btree.c
    +++ b/drivers/md/bcache/btree.c
    @@ -617,7 +617,7 @@ static int bch_mca_shrink(struct shrinke
    return mca_can_free(c) * c->btree_pages;

    /* Return -1 if we can't do anything right now */
    - if (sc->gfp_mask & __GFP_WAIT)
    + if (sc->gfp_mask & __GFP_IO)
    mutex_lock(&c->bucket_lock);
    else if (!mutex_trylock(&c->bucket_lock))
    return -1;



    \
     
     \ /
      Last update: 2013-10-03 07:41    [W:4.148 / U:0.288 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site