Commit a2d93b2f authored by Tahsin Erdogan's avatar Tahsin Erdogan Committed by Stefan Bader

writeback: initialize inode members that track writeback history

BugLink: https://bugs.launchpad.net/bugs/1826212

[ Upstream commit 3d65ae46 ]

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: default avatarTahsin Erdogan <tahsin@google.com>
Acked-by: default avatarTejun Heo <tj@kernel.org>
Fixes: d10c8095 ("writeback: implement foreign cgroup inode bdi_writeback switching")
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 2f2b589a
...@@ -154,6 +154,12 @@ int inode_init_always(struct super_block *sb, struct inode *inode) ...@@ -154,6 +154,12 @@ int inode_init_always(struct super_block *sb, struct inode *inode)
inode->i_rdev = 0; inode->i_rdev = 0;
inode->dirtied_when = 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)) if (security_inode_alloc(inode))
goto out; goto out;
spin_lock_init(&inode->i_lock); spin_lock_init(&inode->i_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment