jffs2: hold erase_completion_lock on exit
authorAlexey Khoroshilov <khoroshilov@ispras.ru>
Mon, 5 Nov 2012 18:40:14 +0000 (22:40 +0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Jan 2013 16:43:55 +0000 (08:43 -0800)
commit43f5d330de7b4238cd4c0b3f287218e1734332af
treebd779da295d374d7af32e5e172464acc9e2c1b0c
parent113b47f82db411f22e10cfa374328031cc394976
jffs2: hold erase_completion_lock on exit

commit 2cbba75a56ea78e6876b4e2547a882f10b3fe72b upstream.

Users of jffs2_do_reserve_space() expect they still held
erase_completion_lock after call to it. But there is a path
where jffs2_do_reserve_space() leaves erase_completion_lock unlocked.
The patch fixes it.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/jffs2/nodemgmt.c