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: firefly_0821_release~176^2~4^2~11^2~3 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=1f565de67d6f2991f10ab591d819135ba4d3fe0f;p=firefly-linux-kernel-4.4.55.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 (cherry picked from commit 3d65ae4634ed8350aee98a4e6f4e41fe40c7d282) Signed-off-by: Alex Shi --- diff --git a/fs/inode.c b/fs/inode.c index b0edef500590..2c16b758831d 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);