Commit db6e5e16 authored by Kees Cook's avatar Kees Cook Committed by Sasha Levin
Browse files

pstore: inode: Only d_invalidate() is needed



[ Upstream commit a43e0fc5 ]

Unloading a modular pstore backend with records in pstorefs would
trigger the dput() double-drop warning:

  WARNING: CPU: 0 PID: 2569 at fs/dcache.c:762 dput.part.0+0x3f3/0x410

Using the combo of d_drop()/dput() (as mentioned in
Documentation/filesystems/vfs.rst) isn't the right approach here, and
leads to the reference counting problem seen above. Use d_invalidate()
and update the code to not bother checking for error codes that can
never happen.

Suggested-by: default avatarAlexander Viro <viro@zeniv.linux.org.uk>
Fixes: 609e28bb ("pstore: Remove filesystem records when backend is unregistered")
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
parent be52ee92
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment