Skip to content

Commit

Permalink
bcache: Fix a shrinker deadlock
Browse files Browse the repository at this point in the history
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>
Cc: linux-stable <stable@vger.kernel.org> # >= v3.10
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Kent Overstreet authored and Linus Torvalds committed Sep 24, 2013
1 parent 79e3dab commit a698e08
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/md/bcache/btree.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a698e08

Please sign in to comment.