pstore: Do not leave timer disabled for next backend
authorKees Cook <keescook@chromium.org>
Wed, 6 May 2020 04:36:15 +0000 (21:36 -0700)
committerKees Cook <keescook@chromium.org>
Sat, 30 May 2020 17:34:02 +0000 (10:34 -0700)
commit78c83c828c043f2e18929137c1e218e8977349b1
tree216de382f5364dbb88e1691c2317346f44413ea2
parent27e5041a87e8af2d0b6452dffe053d0253e914cc
pstore: Do not leave timer disabled for next backend

The pstore.update_ms value was being disabled during pstore_unregister(),
which would cause any prior value to go unnoticed on the next
pstore_register(). Instead, just let del_timer() stop the timer, which
was always sufficient. This additionally refactors the timer reset code
and allows the timer to be enabled if the module parameter is changed
away from the default.

Link: https://lore.kernel.org/lkml/20200506152114.50375-10-keescook@chromium.org/
Signed-off-by: Kees Cook <keescook@chromium.org>
fs/pstore/platform.c