diff options
author | Kent Overstreet <kmo@daterainc.com> | 2013-09-24 02:17:34 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-10-05 10:13:09 -0400 |
commit | 7866bece346caecd88c53c6603e178ce4ebda87b (patch) | |
tree | e3828214fc61f44d6b2d42f8a6e61eff0723d02f /drivers/md | |
parent | ff1a51b9bf5808f2d40b8e605ff7f7cdc7973b3e (diff) |
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>
Diffstat (limited to 'drivers/md')
-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) | |||
633 | return mca_can_free(c) * c->btree_pages; | 633 | return mca_can_free(c) * c->btree_pages; |
634 | 634 | ||
635 | /* Return -1 if we can't do anything right now */ | 635 | /* Return -1 if we can't do anything right now */ |
636 | if (sc->gfp_mask & __GFP_WAIT) | 636 | if (sc->gfp_mask & __GFP_IO) |
637 | mutex_lock(&c->bucket_lock); | 637 | mutex_lock(&c->bucket_lock); |
638 | else if (!mutex_trylock(&c->bucket_lock)) | 638 | else if (!mutex_trylock(&c->bucket_lock)) |
639 | return -1; | 639 | return -1; |