Files
android_kernel_xiaomi_sm8450/include/linux
Tejun Heo a1a0e23e49 writeback: flush inode cgroup wb switches instead of pinning super_block
If cgroup writeback is in use, inodes can be scheduled for
asynchronous wb switching.  Before 5ff8eaac16 ("writeback: keep
superblock pinned during cgroup writeback association switches"), this
could race with umount leading to super_block being destroyed while
inodes are pinned for wb switching.  5ff8eaac16 fixed it by bumping
s_active while wb switches are in flight; however, this allowed
in-flight wb switches to make umounts asynchronous when the userland
expected synchronosity - e.g. fsck immediately following umount may
fail because the device is still busy.

This patch removes the problematic super_block pinning and instead
makes generic_shutdown_super() flush in-flight wb switches.  wb
switches are now executed on a dedicated isw_wq so that they can be
flushed and isw_nr_in_flight keeps track of the number of in-flight wb
switches so that flushing can be avoided in most cases.

v2: Move cgroup_writeback_umount() further below and add MS_ACTIVE
    check in inode_switch_wbs() as Jan an Al suggested.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Tahsin Erdogan <tahsin@google.com>
Cc: Jan Kara <jack@suse.cz>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Link: http://lkml.kernel.org/g/CAAeU0aNCq7LGODvVGRU-oU_o-6enii5ey0p1c26D1ZzYwkDc5A@mail.gmail.com
Fixes: 5ff8eaac16 ("writeback: keep superblock pinned during cgroup writeback association switches")
Cc: stable@vger.kernel.org #v4.5
Reviewed-by: Jan Kara <jack@suse.cz>
Tested-by: Tahsin Erdogan <tahsin@google.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
2016-03-03 14:42:50 -07:00
..
2016-02-04 18:26:08 +01:00
2015-10-17 21:22:08 -07:00
2015-10-07 18:08:15 +01:00
2016-01-05 18:04:58 +01:00
2015-11-16 15:41:49 +00:00
2015-12-23 08:37:10 -07:00
2015-08-03 12:01:54 -04:00
2015-12-22 09:38:34 -07:00
2015-12-06 12:46:31 +01:00
2015-10-07 16:02:49 -07:00
2015-09-04 16:54:41 -07:00
2015-10-18 10:14:39 -07:00
2015-10-31 19:05:59 -04:00
2016-01-08 01:12:06 +01:00
2015-10-30 01:47:27 -04:00
2015-12-28 13:41:50 +01:00
2016-01-15 17:56:32 -08:00
2015-11-25 09:22:00 -07:00
2015-10-23 05:44:28 -07:00
2016-01-20 17:09:18 -08:00
2015-10-01 15:06:43 +02:00
2015-12-14 10:03:46 +01:00
2015-07-28 08:50:42 +01:00
2016-01-15 17:56:32 -08:00
2016-01-15 17:56:32 -08:00
2016-01-15 17:56:32 -08:00
2015-10-27 18:55:31 -07:00
2016-02-03 08:28:43 -08:00
2016-02-03 08:28:43 -08:00
2015-10-20 22:10:45 +08:00
2015-07-21 10:39:05 -07:00
2016-02-08 15:20:01 -05:00
2015-09-10 13:29:01 -07:00
2015-09-10 13:29:01 -07:00
2016-01-22 17:02:18 -08:00
2016-02-11 18:35:48 -08:00
2016-02-11 18:35:48 -08:00
2016-01-07 14:31:27 -05:00
2015-10-06 17:08:19 +02:00
2015-10-22 08:59:18 -07:00
2015-11-16 09:23:47 +01:00
2016-01-10 22:13:15 -05:00
2015-12-13 19:59:48 -08:00
2016-01-04 16:11:11 -05:00
2016-02-09 04:28:06 -05:00
2016-01-04 10:20:19 -05:00
2015-11-05 14:36:09 -05:00
2016-01-15 22:34:39 +01:00
2015-08-17 11:25:28 -07:00
2015-10-01 09:57:59 -07:00
2015-10-19 01:01:21 +02:00
2015-11-23 09:44:58 +01:00
2015-12-21 15:28:11 -07:00
2016-01-12 20:47:02 +02:00
2016-01-15 17:56:32 -08:00
2016-01-14 16:00:49 -08:00
2015-12-03 07:24:29 -08:00
2015-09-08 15:35:28 -07:00