Re: [patch] real fix [Re: [patch] fixed 2.2.1 inode-leakage due bogus design of the free_inodes algo

Steve Dodd (dirk@loth.demon.co.uk)
Thu, 11 Feb 1999 00:02:13 +0000


Hi,

On Wed, Feb 10, 1999 at 09:18:58PM +0100, Andrea Arcangeli wrote:

> Again: free_inode_memory() don't generate free memory: it _only_ move
> inodes from one list to another list.

But the file system can provide a clear_inode() implementation which may
free memory the fs has associated with the inode.

> Could you show me the code you think is freeing memory?

void ntfs_clear_inode(ntfs_inode *ino)
{
int i;
if(!ino->attr){
ntfs_error("ntfs_clear_inode: double free\n");
return;
}
ntfs_free(ino->attr);
ino->attr=0;
ntfs_free(ino->records);
ino->records=0;
for(i=0;i<ino->attr_count;i++)
{
if(ino->attrs[i].name)
ntfs_free(ino->attrs[i].name);
if(ino->attrs[i].resident)
{
if(ino->attrs[i].d.data)
ntfs_free(ino->attrs[i].d.data);
}else{
if(ino->attrs[i].d.r.runlist)
ntfs_free(ino->attrs[i].d.r.runlist);
}
}
ntfs_free(ino->attrs);
ino->attrs=0;
}

S.

-- 
If breastfeeding a pig is sickening to you, what the hell are you
doing on usenet? -- Aimee, on rec.music.tori-amos

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/