On Thu, Jan 07, 2021 at 01:46:37PM -0800, Eric Biggers wrote: > It looks like that's going to work, and it fixes the XFS bug too. > > Note that if __writeback_single_inode() is called from writeback_single_inode() > (rather than writeback_sb_inodes()), then the inode might not be queued for > sync, in which case mark_inode_dirty_sync() will move it to a writeback list. > > That's okay because afterwards, writeback_single_inode() will delete the inode > from any writeback list if it's been fully cleaned, right? So clean inodes > won't get left on a writeback list. > > It's confusing because there are comments in writeback_single_inode() and above > __writeback_single_inode() that say that the inode must not be moved between > writeback lists. I take it that those comments are outdated, as they predate > I_SYNC_QUEUED being introduced by commit 5afced3bf281 ("writeback: Avoid > skipping inode writeback")? Yes. I think we need to update the comment as well.