From: Tahsin Erdogan Date: Tue, 16 Feb 2016 21:34:39 +0000 (-0800) Subject: writeback: initialize inode members that track writeback history X-Git-Tag: MMI-PSA29.97-13-9~8497^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3d65ae4634ed8350aee98a4e6f4e41fe40c7d282;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git 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 Acked-by: Tejun Heo Fixes: d10c80955265 ("writeback: implement foreign cgroup inode bdi_writeback switching") Signed-off-by: Jens Axboe --- 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);