summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTahsin Erdogan <tahsin@google.com>2016-02-16 22:34:39 +0100
committerJens Axboe <axboe@fb.com>2016-02-16 22:57:21 +0100
commit3d65ae4634ed8350aee98a4e6f4e41fe40c7d282 (patch)
tree4efaf7fb8a92eeb7fb5a1d854fa8172512d28696
parentwriteback: keep superblock pinned during cgroup writeback association switches (diff)
downloadlinux-3d65ae4634ed8350aee98a4e6f4e41fe40c7d282.tar.xz
linux-3d65ae4634ed8350aee98a4e6f4e41fe40c7d282.zip
writeback: initialize inode members that track writeback history
inode struct members that track cgroup writeback information should be reinitialized when inode gets allocated from kmem_cache. Otherwise, their values remain and get used by the new inode. Signed-off-by: Tahsin Erdogan <tahsin@google.com> Acked-by: Tejun Heo <tj@kernel.org> Fixes: d10c80955265 ("writeback: implement foreign cgroup inode bdi_writeback switching") Signed-off-by: Jens Axboe <axboe@fb.com>
-rw-r--r--fs/inode.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/inode.c b/fs/inode.c
index 9f62db3bcc3e..69b8b526c194 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -154,6 +154,12 @@ int inode_init_always(struct super_block *sb, struct inode *inode)
inode->i_rdev = 0;
inode->dirtied_when = 0;
+#ifdef CONFIG_CGROUP_WRITEBACK
+ inode->i_wb_frn_winner = 0;
+ inode->i_wb_frn_avg_time = 0;
+ inode->i_wb_frn_history = 0;
+#endif
+
if (security_inode_alloc(inode))
goto out;
spin_lock_init(&inode->i_lock);