Skip to contentSkip to conversation

writeback: initialize inode members that track writeback history

PATCH In review Tahsin Erdogan 3 participants 3 messages Feb 16, 2016 – Feb 17, 2016 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 fs/inode.c | 6 ++++++
 1 file changed, 6 insertions(+)
fs/inode.c +6 -0
index 9f62db3..69b8b52 100644
@@ -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);
Signature · 1 line
2.7.0.rc3.207.g0ac5344
#1 lore raw

Hello,

Quoted 7 lines · Tahsin Erdogan

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.

This one should go for 4.5 and also prolly have the following tag.

Fixes d10c80955265 ("writeback: implement foreign cgroup inode bdi_writeback switching")

Thanks.

Signature · 1 line
tejun
#2 lore raw
Quoted 8 lines · Tejun Heo

Hello,

Quoted 5 lines · Tahsin Erdogan

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.

Quoted 6 lines
Quoted 2 lines

This one should go for 4.5 and also prolly have the following tag.

Fixes d10c80955265 ("writeback: implement foreign cgroup inode bdi_writeback switching")

I've added it for 4.5 with the fixes tag.

Signature · 1 line
Jens Axboe