writeback: Add asserts for adding freed inode to lists
authorJan Kara <jack@suse.cz>
Mon, 12 Dec 2022 11:36:33 +0000 (12:36 +0100)
committerJens Axboe <axboe@kernel.dk>
Mon, 12 Dec 2022 20:08:34 +0000 (13:08 -0700)
commita9438b44bc7015b18931e312bbd249a25bb59a65
treefb38dd733afe5765d9d2ffa1ed759266faa96558
parenteb7081409f94a9a8608593d0fb63a1aa3d6f95d8
writeback: Add asserts for adding freed inode to lists

In the past we had several use-after-free issues with inodes getting
added to writeback lists after evict() removed them. These are painful
to debug so add some asserts to catch the problem earlier. The only
non-obvious change in the commit is that we need to tweak
redirty_tail_locked() to avoid triggering assertion in
inode_io_list_move_locked().

Signed-off-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20221212113633.29181-1-jack@suse.cz
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/fs-writeback.c