From: Kent Overstreet Date: Fri, 30 Aug 2013 21:12:24 +0000 (-0700) Subject: bcache: Fix a shrinker deadlock X-Git-Tag: next-20130912~34^2~6^2~51 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=b5a1a5cfffbcf355f52e67a9b57db4914395ca70;p=karo-tx-linux.git bcache: Fix a shrinker deadlock 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 Cc: linux-stable # >= v3.10 --- diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c index 60908de2af5f..55e8666f9544 100644 --- a/drivers/md/bcache/btree.c +++ b/drivers/md/bcache/btree.c @@ -617,7 +617,7 @@ static int bch_mca_shrink(struct shrinker *shrink, struct shrink_control *sc) 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;