Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sun, 11 Nov 2001 21:48:14 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sun, 11 Nov 2001 21:48:05 -0500 Received: from fgwmail6.fujitsu.co.jp ([192.51.44.36]:20440 "EHLO fgwmail6.fujitsu.co.jp") by vger.kernel.org with ESMTP id ; Sun, 11 Nov 2001 21:47:51 -0500 Date: Mon, 12 Nov 2001 11:47:41 +0900 Message-ID: <3d3kbt82.wl@nisaaru.dvs.cs.fujitsu.co.jp> From: Tachino Nobuhiro To: wcm@catnap.com (W Christopher Martin) Cc: linux-kernel@vger.kernel.org, padraig@antefacto.com (Padraig Brady) Subject: Re: ramfs leak In-Reply-To: <20011109204043.17315.qmail@gizmo.catnap.com> In-Reply-To: <20011109204043.17315.qmail@gizmo.catnap.com> User-Agent: Wanderlust/2.7.5 (Too Funky) EMIKO/1.14.1 (Choanoflagellata) LIMIT/1.14.7 (Fujiidera) APEL/10.3 Emacs/21.1 (i586-kondara-linux-gnu) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by EMIKO 1.14.1 - "Choanoflagellata") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org 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/