mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-10 07:00:48 +00:00
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 <kmo@daterainc.com> Cc: linux-stable <stable@vger.kernel.org> # >= v3.10 Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
79e3dab90d
commit
a698e08c82
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user