Skip to content

Commit

Permalink
[JFFS2] Fix potential memory leak of dead xattrs on unmount.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David Woodhouse committed May 20, 2007
1 parent 8ae5d31 commit 2ad8ee7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fs/jffs2/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2ad8ee7

Please sign in to comment.