From: Kent Overstreet Date: Tue, 24 Sep 2013 06:17:34 +0000 (-0700) Subject: bcache: Fix a shrinker deadlock X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=a698e08c82dfb9771e0bac12c7337c706d729b6d;p=openwrt%2Fstaging%2Fblogic.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 Signed-off-by: Linus Torvalds --- diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c index 8fad8402fb2e..f42fc7ed9cd6 100644 --- a/drivers/md/bcache/btree.c +++ b/drivers/md/bcache/btree.c @@ -612,7 +612,7 @@ static unsigned long bch_mca_scan(struct shrinker *shrink, return SHRINK_STOP; /* 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;