diff options
author | Kent Overstreet <kmo@daterainc.com> | 2013-09-23 23:17:34 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-10-05 07:13:09 -0700 |
commit | 7866bece346caecd88c53c6603e178ce4ebda87b (patch) | |
tree | e3828214fc61f44d6b2d42f8a6e61eff0723d02f | |
parent | ff1a51b9bf5808f2d40b8e605ff7f7cdc7973b3e (diff) | |
download | lwn-7866bece346caecd88c53c6603e178ce4ebda87b.tar.gz lwn-7866bece346caecd88c53c6603e178ce4ebda87b.zip |
bcache: Fix a shrinker deadlock
commit a698e08c82dfb9771e0bac12c7337c706d729b6d 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>
-rw-r--r-- | drivers/md/bcache/btree.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c index 833c590806ba..7d3deab11fce 100644 --- a/drivers/md/bcache/btree.c +++ b/drivers/md/bcache/btree.c @@ -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; |