Tejun Heo
494c4399ef
writeback: synchronize sync(2) against cgroup writeback membership switches
...
[ Upstream commit 7fc5854f8c6efae9e7624970ab49a1eac2faefb1 ]
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 <tj@kernel.org>
Reported-by: Jiufei Xue <xuejiufei@gmail.com>
Link: http://lkml.kernel.org/r/dc694ae2-f07f-61e1-7097-7c8411cee12d@gmail.com
Acked-by: Jan Kara <jack@suse.cz>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-03-05 17:58:01 +01:00
..
2018-08-24 13:09:12 +02:00
2019-03-05 17:58:01 +01:00
2018-10-13 09:27:30 +02:00
2017-11-02 11:10:55 +01:00
2017-06-05 16:59:12 +02:00
2017-11-02 11:10:55 +01:00
2017-10-13 16:18:32 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-09-19 22:43:48 +02:00
2017-02-27 18:43:47 -08:00
2018-02-25 11:08:03 +01:00
2018-09-15 09:45:28 +02:00
2017-11-02 11:10:55 +01:00
2018-04-24 09:36:39 +02:00
2018-03-03 10:24:21 +01:00
2016-07-26 16:19:19 -07:00
2018-07-17 11:39:29 +02:00
2017-11-02 11:10:55 +01:00
2019-01-13 10:01:02 +01:00
2018-12-05 19:41:08 +01:00
2018-12-08 13:03:37 +01:00
2017-05-03 15:52:12 -07:00
2017-11-02 11:10:55 +01:00
2017-09-06 17:27:30 -07:00
2017-09-08 18:26:49 -07:00
2018-05-22 18:53:58 +02:00
2018-02-22 15:42:24 +01:00
2018-12-05 19:41:09 +01:00
2018-05-30 07:52:21 +02:00
2018-07-03 11:25:03 +02:00
2017-10-03 17:54:25 -07:00
2016-05-22 17:21:27 -07:00
2018-10-10 08:54:22 +02:00
2018-02-22 15:42:24 +01:00
2018-03-28 18:24:39 +02:00
2018-09-05 09:26:32 +02:00
2019-01-13 10:01:02 +01:00
2019-02-06 17:31:36 +01:00
2019-01-16 22:07:11 +01:00
2019-02-27 10:08:01 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2019-02-06 17:31:37 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-07-17 11:39:29 +02:00
2017-03-02 08:42:38 +01:00
2017-08-31 16:13:00 -07:00
2017-11-02 11:10:55 +01:00
2018-08-15 18:12:51 +02:00
2018-10-20 09:48:53 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-09-14 18:13:32 -07:00
2019-02-06 17:31:36 +01:00
2018-12-17 09:28:54 +01:00
2017-11-02 11:10:55 +01:00
2017-11-24 08:37:05 +01:00
2018-05-30 07:52:24 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-05-30 07:52:21 +02:00
2017-11-02 11:10:55 +01:00
2018-11-13 11:15:08 -08:00
2019-01-26 09:37:06 +01:00
2017-11-24 08:37:04 +01:00
2017-11-02 11:10:55 +01:00
2019-02-12 19:46:05 +01:00
2017-09-27 14:45:57 -07:00
2018-04-08 14:26:29 +02:00
2018-10-18 09:16:23 +02:00
2017-11-02 11:10:55 +01:00
2017-03-02 08:42:28 +01:00
2017-11-02 11:10:55 +01:00
2018-09-09 19:55:53 +02:00
2018-10-13 09:27:22 +02:00
2017-10-03 17:54:24 -07:00
2018-12-08 13:03:37 +01:00
2018-12-01 09:42:51 +01:00
2019-01-16 22:07:11 +01:00
2018-02-22 15:42:23 +01:00
2017-11-02 11:10:55 +01:00
2018-10-03 17:00:55 -07:00
2017-11-02 11:10:55 +01:00
2018-05-16 10:10:27 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-10-03 17:54:24 -07:00
2019-01-26 09:37:06 +01:00
2018-12-08 13:03:40 +01:00
2017-04-05 12:30:18 -07:00
2018-12-08 13:03:38 +01:00
2019-01-16 22:07:11 +01:00
2018-09-19 22:43:48 +02:00
2018-08-03 07:50:23 +02:00
2017-07-10 16:32:31 -07:00
2018-12-29 13:39:11 +01:00
2018-12-08 13:03:40 +01:00
2017-11-02 11:10:55 +01:00
2018-12-01 09:42:54 +01:00
2017-12-14 09:53:10 +01:00
2018-09-05 09:26:30 +02:00