lkml.org 
[lkml]   [2001]   [Nov]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: ramfs leak

Hello,

At Fri, 9 Nov 2001 15:40:43 -0500 (EST),
W Christopher Martin wrote:
>
> Padraig Brady writes:
> > When I remove files from a ramfs the space is not reclaimed?
> > What am I doing wrong? Details below.
>
> Nothing. We've noticed the same thing. It's a bug and was
> first reported back in July, but no one has provided a fix yet.
> I've had a brief look at the source code, but nothing obvious
> pops out at me.

I think you should use tmpfs instead of ramfs, but if you really want to use ramfs,
the patch below may fix the problem.

diff -Nur linux-2.4.13-ac7.org/fs/ramfs/inode.c linux-2.4.13-ac7/fs/ramfs/inode.c
--- linux-2.4.13-ac7.org/fs/ramfs/inode.c Mon Nov 12 11:00:47 2001
+++ linux-2.4.13-ac7/fs/ramfs/inode.c Mon Nov 12 11:26:40 2001
@@ -182,12 +182,9 @@
{
struct ramfs_sb_info *rsb = RAMFS_SB(inode->i_sb);

- if (! Page_Uptodate(page))
- return;
-
lock_rsb(rsb);
-
- ClearPageDirty(page);
+ if (Page_Uptodate(page))
+ ClearPageDirty(page);

rsb->free_pages++;
inode->i_blocks -= IBLOCKS_PER_PAGE;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:13    [W:0.048 / U:3.372 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site