提交 2ad8ee71 编写于 作者: D David Woodhouse

[JFFS2] Fix potential memory leak of dead xattrs on unmount.

An xattr_datum which ends up orphaned should be freed by the GC 
thread. But if we umount before the GC thread is finished, or if we 
mount read-only and the GC thread never runs, they might never be 
freed. Clean them up during unmount, if there are any left.
Signed-off-by: NDavid Woodhouse <dwmw2@infradead.org>
上级 8ae5d312
......@@ -754,6 +754,10 @@ void jffs2_clear_xattr_subsystem(struct jffs2_sb_info *c)
list_del(&xd->xindex);
jffs2_free_xattr_datum(xd);
}
list_for_each_entry_safe(xd, _xd, &c->xattr_unchecked, xindex) {
list_del(&xd->xindex);
jffs2_free_xattr_datum(xd);
}
}
#define XREF_TMPHASH_SIZE (128)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册