+28
−9
+1
−1
Loading
mainline inclusion from mainline-v5.19-rc2 commit 10e14073 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IAZJPL Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=10e14073107dd0b6d97d9516a02845a8e501c2c9 -------------------------------- Commit b35250c0 ("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: b35250c0 ("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> Conflicts: fs/fs-writeback.c [Context conflict caused by commit 35d14f27 ("fs: clean up __mark_inode_dirty() a bit") not being backported.] Signed-off-by:
Baokun Li <libaokun1@huawei.com>