]> git.baikalelectronics.ru Git - kernel.git/commit
writeback: Fix inode->i_io_list not be protected by inode->i_lock error
authorJchao Sun <sunjunchao2870@gmail.com>
Tue, 24 May 2022 15:05:40 +0000 (08:05 -0700)
committerJan Kara <jack@suse.cz>
Mon, 6 Jun 2022 07:54:30 +0000 (09:54 +0200)
commit2eacea2ab2b2981a8eaabf9466f5d44c8c79b6d9
tree5b310f971484c41cf2d7842a39038c3e537445a3
parent102dde55df7b5090f06883b98559f60f450e0015
writeback: Fix inode->i_io_list not be protected by inode->i_lock error

Commit 908cbac77d10 ("writeback: Protect inode->i_io_list with
inode->i_lock") made inode->i_io_list not only protected by
wb->list_lock but also inode->i_lock, but inode_io_list_move_locked()
was missed. Add lock there and also update comment describing
things protected by inode->i_lock. This also fixes a race where
__mark_inode_dirty() could move inode under flush worker's hands
and thus sync(2) could miss writing some inodes.

Fixes: 908cbac77d10 ("writeback: Protect inode->i_io_list with inode->i_lock")
Link: https://lore.kernel.org/r/20220524150540.12552-1-sunjunchao2870@gmail.com
CC: stable@vger.kernel.org
Signed-off-by: Jchao Sun <sunjunchao2870@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
fs/fs-writeback.c
fs/inode.c