diff options
author | David Woodhouse <dwmw2@infradead.org> | 2007-05-07 19:12:58 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@infradead.org> | 2007-05-20 11:30:38 -0400 |
commit | 2ad8ee713566671875216ebcec64f2eda47bd19d (patch) | |
tree | b8ad57ea0041b66b68eae2bb089f0c70b13a7ab9 /fs/jffs2 | |
parent | 8ae5d31263c746f1680d005b33a82d167cdb9eb6 (diff) |
[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: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'fs/jffs2')
-rw-r--r-- | fs/jffs2/xattr.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/jffs2/xattr.c b/fs/jffs2/xattr.c index 073469856d4e..e48665984cb3 100644 --- a/fs/jffs2/xattr.c +++ b/fs/jffs2/xattr.c | |||
@@ -754,6 +754,10 @@ void jffs2_clear_xattr_subsystem(struct jffs2_sb_info *c) | |||
754 | list_del(&xd->xindex); | 754 | list_del(&xd->xindex); |
755 | jffs2_free_xattr_datum(xd); | 755 | jffs2_free_xattr_datum(xd); |
756 | } | 756 | } |
757 | list_for_each_entry_safe(xd, _xd, &c->xattr_unchecked, xindex) { | ||
758 | list_del(&xd->xindex); | ||
759 | jffs2_free_xattr_datum(xd); | ||
760 | } | ||
757 | } | 761 | } |
758 | 762 | ||
759 | #define XREF_TMPHASH_SIZE (128) | 763 | #define XREF_TMPHASH_SIZE (128) |