Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Nov 2006 21:35:32 +0300
From:      "Andrew Pantyukhin" <infofarmer@FreeBSD.org>
To:        "Dan Nelson" <dnelson@allantgroup.com>
Cc:        Peter Schuller <peter.schuller@infidyne.com>, freebsd-questions@freebsd.org
Subject:   Re: Empty directory 60M in size; used to contain 1.7 million files
Message-ID:  <cb5206420611271035x4c1eee63oc70c4d257098f662@mail.gmail.com>
In-Reply-To: <20061127020422.GH29363@dan.emsphone.com>
References:  <200611270131.44366.peter.schuller@infidyne.com> <20061127020422.GH29363@dan.emsphone.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 11/27/06, Dan Nelson <dnelson@allantgroup.com> wrote:
> In the last episode (Nov 27), Peter Schuller said:
> > Observe:
> >
> > hyperion# ls -la
> > total 61634
> > drwxr-xr-x  2 xxx yyy  63047168 Nov 18 21:33 .
> > drwxr-xr-x  6 xxx yyy         512 Oct  8 16:39 ..
> > hyperion# find .
> > .
> > hyperion#
> >
> > The one special circumstance is that the directory previously
> > contained 1.7 million small files, that are now deleted. This is on
> > FreeBSD 6.1 with UFS2 + softupdates. No snapshots exist of the
> > filesystem.
> >
> > 1.7 million files may be extreme, but I don't see why an empty
> > directory would ever consume more than one inode?
>
> Directories are only shrunk when a file is created and the slack
> directory space can be trivially truncated.  This is to avoid useless
> compaction during "rm -rf"-style activities of a directory that will
> just be deleted anyway.

Shouldn't it be done after a timeout? I can imagine scenarios
when millions of small files are created and deleted in different
dirs. Should it result in no disk space (and a clueless user)?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?cb5206420611271035x4c1eee63oc70c4d257098f662>