]> Git Repo - linux.git/commit
writeback: synchronize sync(2) against cgroup writeback membership switches
authorTejun Heo <[email protected]>
Tue, 12 Dec 2017 16:38:30 +0000 (08:38 -0800)
committerJens Axboe <[email protected]>
Tue, 22 Jan 2019 21:39:38 +0000 (14:39 -0700)
commit7fc5854f8c6efae9e7624970ab49a1eac2faefb1
tree7c9ac9ab43c0a47dbaefd155da89c8ba7f7923db
parent698cef173983b086977e633e46476e0f925ca01e
writeback: synchronize sync(2) against cgroup writeback membership switches

sync_inodes_sb() can race against cgwb (cgroup writeback) membership
switches and fail to writeback some inodes.  For example, if an inode
switches to another wb while sync_inodes_sb() is in progress, the new
wb might not be visible to bdi_split_work_to_wbs() at all or the inode
might jump from a wb which hasn't issued writebacks yet to one which
already has.

This patch adds backing_dev_info->wb_switch_rwsem to synchronize cgwb
switch path against sync_inodes_sb() so that sync_inodes_sb() is
guaranteed to see all the target wbs and inodes can't jump wbs to
escape syncing.

v2: Fixed misplaced rwsem init.  Spotted by Jiufei.

Signed-off-by: Tejun Heo <[email protected]>
Reported-by: Jiufei Xue <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Acked-by: Jan Kara <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
fs/fs-writeback.c
include/linux/backing-dev-defs.h
mm/backing-dev.c
This page took 0.05885 seconds and 4 git commands to generate.