From d72ee0e8c2d0979de64ff67b796e269357a6a5a3 Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Tue, 16 Jun 2015 18:48:31 -0400 Subject: [PATCH] vfs, writeback: replace FS_CGROUP_WRITEBACK with SB_I_CGROUPWB FS_CGROUP_WRITEBACK indicates whether a file_system_type supports cgroup writeback; however, different super_blocks of the same file_system_type may or may not support cgroup writeback depending on filesystem options. This patch replaces FS_CGROUP_WRITEBACK with a per-super_block flag. super_block->s_flags carries some internal flags in the high bits but it's exposd to userland through uapi header and running out of space anyway. This patch adds a new field super_block->s_iflags to carry kernel-internal flags. It is currently only used by the new SB_I_CGROUPWB flag whose concatenated and abbreviated name is for consistency with other super_block flags. ext2_fill_super() is updated to set SB_I_CGROUPWB. v2: Added super_block->s_iflags instead of stealing another high bit from sb->s_flags as suggested by Christoph and Jan. Signed-off-by: Tejun Heo Cc: Alexander Viro Cc: linux-fsdevel@vger.kernel.org Cc: Christoph Hellwig Cc: Jan Kara Cc: linux-ext4@vger.kernel.org Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe (cherry picked from commit 46b15caa7cb19b0f6e3bc8ebaee5bc1bb2e35110) Orabug: 26540416 CVE: CVE-2016-10044 Signed-off-by: Tim Tianyang Chen Reviewed-by: Jack Vogel Conflicts: include/linux/backing-dev.h include/linux/fs.h fs/ext2/super.c --- include/linux/fs.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/fs.h b/include/linux/fs.h index c7c49c5e3e59..1c57d74c1372 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1372,6 +1372,9 @@ struct super_block { * Indicates how deep in a filesystem stack this SB is */ int s_stack_depth; +#ifndef __GENKSYMS__ + unsigned long s_iflags; /* internal SB_I_* flags */ +#endif }; extern struct timespec current_fs_time(struct super_block *sb); -- 2.50.1