aboutsummaryrefslogtreecommitdiffstats
path: root/fs/super.c
diff options
context:
space:
mode:
authorTejun Heo <[email protected]>2016-02-29 23:28:53 +0000
committerJens Axboe <[email protected]>2016-03-03 21:42:50 +0000
commita1a0e23e49037c23ea84bc8cc146a03584d13577 (patch)
treeb8bb7792ed9dd97358bdea0a6a2f36fdb617bbf0 /fs/super.c
parentNVMe: Fix 0-length integrity payload (diff)
downloadkernel-a1a0e23e49037c23ea84bc8cc146a03584d13577.tar.gz
kernel-a1a0e23e49037c23ea84bc8cc146a03584d13577.zip
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 5ff8eaac1636 ("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. 5ff8eaac1636 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 <[email protected]> Reported-by: Tahsin Erdogan <[email protected]> Cc: Jan Kara <[email protected]> Cc: Al Viro <[email protected]> Link: http://lkml.kernel.org/g/CAAeU0aNCq7LGODvVGRU-oU_o-6enii5ey0p1c26D1ZzYwkDc5A@mail.gmail.com Fixes: 5ff8eaac1636 ("writeback: keep superblock pinned during cgroup writeback association switches") Cc: [email protected] #v4.5 Reviewed-by: Jan Kara <[email protected]> Tested-by: Tahsin Erdogan <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
Diffstat (limited to 'fs/super.c')
-rw-r--r--fs/super.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/super.c b/fs/super.c
index 1182af8fd5ff..74914b1bae70 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -415,6 +415,7 @@ void generic_shutdown_super(struct super_block *sb)
sb->s_flags &= ~MS_ACTIVE;
fsnotify_unmount_inodes(sb);
+ cgroup_writeback_umount();
evict_inodes(sb);