Skip to content

Commit

Permalink
raid5: handle register_shrinker failure
Browse files Browse the repository at this point in the history
register_shrinker() now can fail. When it happens, shrinker.nr_deferred is
null. We use it to determine if unregister_shrinker is required.

Signed-off-by: Shaohua Li <shli@fb.com>
  • Loading branch information
Shaohua Li committed Sep 21, 2016
1 parent 6a0f53f commit 30c8946
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/md/raid5.c
Original file line number Diff line number Diff line change
Expand Up @@ -6372,7 +6372,7 @@ static void free_conf(struct r5conf *conf)
{
if (conf->log)
r5l_exit_log(conf->log);
if (conf->shrinker.seeks)
if (conf->shrinker.nr_deferred)
unregister_shrinker(&conf->shrinker);

free_thread_groups(conf);
Expand Down

0 comments on commit 30c8946

Please sign in to comment.