]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
writeback: Fix sync livelock due to b_dirty_time processing
authorJan Kara <jack@suse.cz>
Fri, 29 May 2020 14:08:58 +0000 (16:08 +0200)
committerKhalid Elmously <khalid.elmously@canonical.com>
Wed, 16 Sep 2020 09:15:01 +0000 (05:15 -0400)
commitaa68c474b1deb5cc918a5a22425cfacdeccc7dcf
treefb4d4b72bf9623bfe395360767276cc0180acad9
parent0a7fc9c1c54435baf501bc7ec39ac2bfecbc9312
writeback: Fix sync livelock due to b_dirty_time processing

BugLink: https://bugs.launchpad.net/bugs/1895174
commit f9cae926f35e8230330f28c7b743ad088611a8de upstream.

When we are processing writeback for sync(2), move_expired_inodes()
didn't set any inode expiry value (older_than_this). This can result in
writeback never completing if there's steady stream of inodes added to
b_dirty_time list as writeback rechecks dirty lists after each writeback
round whether there's more work to be done. Fix the problem by using
sync(2) start time is inode expiry value when processing b_dirty_time
list similarly as for ordinarily dirtied inodes. This requires some
refactoring of older_than_this handling which simplifies the code
noticeably as a bonus.

Fixes: 0ae45f63d4ef ("vfs: add support for a lazytime mount option")
CC: stable@vger.kernel.org
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
fs/fs-writeback.c
include/trace/events/writeback.h