summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorTahsin Erdogan <tahsin@google.com>2016-02-16 13:34:39 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-04-03 06:23:21 +0200
commit9bda5e6b1819daf09fafb66c2e9d4f0625ac8ad4 (patch)
treed8eb0eb1ffa2c5f6f9602c54b0d43cd87541a150 /fs
parentcb8251f8d66785fbd8cc8f3ffc38bafdd5017272 (diff)
downloadlinux-stable-9bda5e6b1819daf09fafb66c2e9d4f0625ac8ad4.tar.gz
linux-stable-9bda5e6b1819daf09fafb66c2e9d4f0625ac8ad4.tar.bz2
linux-stable-9bda5e6b1819daf09fafb66c2e9d4f0625ac8ad4.zip
writeback: initialize inode members that track writeback history
[ Upstream commit 3d65ae4634ed8350aee98a4e6f4e41fe40c7d282 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/inode.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/inode.c b/fs/inode.c
index a39c2724d8a0..b5c3a6473aaa 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);