]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit - fs/ext4/super.c
ext4: add max_dir_size_kb mount option
authorTheodore Ts'o <tytso@mit.edu>
Fri, 17 Aug 2012 13:48:17 +0000 (09:48 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 17 Aug 2012 13:48:17 +0000 (09:48 -0400)
commitdf981d03eeff7971ac7e6ff37000bfa702327ef1
tree4e944139b9e45c4af910c517b57f2d9bc7c81a1a
parent01fc48e8929e45e67527200017cff4e74e4ba054
ext4: add max_dir_size_kb mount option

Very large directories can cause significant performance problems, or
perhaps even invoke the OOM killer, if the process is running in a
highly constrained memory environment (whether it is VM's with a small
amount of memory or in a small memory cgroup).

So it is useful, in cloud server/data center environments, to be able
to set a filesystem-wide cap on the maximum size of a directory, to
ensure that directories never get larger than a sane size.  We do this
via a new mount option, max_dir_size_kb.  If there is an attempt to
grow the directory larger than max_dir_size_kb, the system call will
return ENOSPC instead.

Google-Bug-Id: 6863013

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Documentation/filesystems/ext4.txt
fs/ext4/ext4.h
fs/ext4/namei.c
fs/ext4/super.c