On Sun, Jul 22, 2001 at 01:51:00PM -0600, D. Stimits wrote:
> Federico Sevilla III wrote:
> >
> > On Sun, 22 Jul 2001 at 08:03, Steve Lord wrote:
> > > If you create a large number of files in XFS, inodes are allocated
> > > dynamically for them. If you remove all the files, the inodes are not
> > > returned to free space. On something like ext2 inodes are allocated at
> > > mkfs time and the space is never available for anything else. This I
> > > think is what you were referring to.
> >
> > Yes, this is what I was referring to. I was under the impression that this
> > was "bad", though, and one effectively "lost space". Are inodes allocated
> > dynamically for large files different from those allocated dynamically for
> > a bunch of small files? Meaning, if inodes are allocated for a large file,
> > then the large file is deleted, and the inodes are not returned to free
> > space, will filling up these allocated inodes with small files be "bad" or
> > would filling up the free space with small files (thus creating inodes for
> > them) have had the same effect anyway?
>
> I had a minor, nagging worry, that if there is no cap on inode density,
> that something like a fork bomb could become a denial of service
> attack...allocate till much of the system is inode, and no way to get it
> back. It would be good to have a cap on inode density, does something
> like that exist now?
>From mkfs.xfs(8):
-i Inode options.
[...stuff deleted]
The option maxpct=value specifies the maximum per
centage of space in the filesystem that can be
allocated to inodes. The default value is 25%.
Setting the value to 0 means that essentially all
of the filesystem can become inode blocks.
So by default you can only fill up an fs, with 25% worth of inodes.
(I ran into this recently when testing xfsrestore on a small filesystem
with heaps of inodes - I was doing this as I had a small test filesystem
but wanted a lot of inodes to model a customer site.)
--Tim
|