mirror of
https://github.com/armbian/linux.git
synced 2026-01-06 10:13:00 -08:00
bcache: Fix a shrinker deadlock
commit a698e08c82 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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
ff1a51b9bf
commit
7866bece34
@@ -633,7 +633,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;
|
||||
|
||||
Reference in New Issue
Block a user