Skip to content

Commit

Permalink
writeback: initialize inode members that track writeback history
Browse files Browse the repository at this point in the 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 <[email protected]>
Acked-by: Tejun Heo <[email protected]>
Fixes: d10c809 ("writeback: implement foreign cgroup inode bdi_writeback switching")
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Tahsin Erdogan authored and axboe committed Feb 16, 2016
1 parent 5ff8eaa commit 3d65ae4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions fs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 3d65ae4

Please sign in to comment.