md/r5cache: call mddev_lock/unlock() in r5c_journal_mode_set
authorSong Liu <songliubraving@fb.com>
Mon, 31 Jul 2017 21:52:26 +0000 (14:52 -0700)
committerShaohua Li <shli@fb.com>
Tue, 8 Aug 2017 14:42:36 +0000 (07:42 -0700)
commitb44886c54a999771060371c3a05d5fedfc7e2102
tree6803f9f24871193e61cecde1e21132006eac6d27
parent81fe48e9aa00bdd509bd3c37a76d1132da6b9f09
md/r5cache: call mddev_lock/unlock() in r5c_journal_mode_set

In r5c_journal_mode_set(), it is necessary to call mddev_lock()
before accessing conf and conf->log. Otherwise, the conf->log
may change (and become NULL).

Shaohua: fix unlock in failure cases

Signed-off-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Shaohua Li <shli@fb.com>
drivers/md/raid5-cache.c