linux/fs
Theodore Ts'o 9d0be50230 ext4: Calculate metadata requirements more accurately
In the past, ext4_calc_metadata_amount(), and its sub-functions
ext4_ext_calc_metadata_amount() and ext4_indirect_calc_metadata_amount()
badly over-estimated the number of metadata blocks that might be
required for delayed allocation blocks.  This didn't matter as much
when functions which managed the reserved metadata blocks were more
aggressive about dropping reserved metadata blocks as delayed
allocation blocks were written, but unfortunately they were too
aggressive.  This was fixed in commit 0637c6f, but as a result the
over-estimation by ext4_calc_metadata_amount() would lead to reserving
2-3 times the number of pending delayed allocation blocks as
potentially required metadata blocks.  So if there are 1 megabytes of
blocks which have been not yet been allocation, up to 3 megabytes of
space would get reserved out of the user's quota and from the file
system free space pool until all of the inode's data blocks have been
allocated.

This commit addresses this problem by much more accurately estimating
the number of metadata blocks that will be required.  It will still
somewhat over-estimate the number of blocks needed, since it must make
a worst case estimate not knowing which physical blocks will be
needed, but it is much more accurate than before.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-01-01 02:41:30 -05:00
..
9p 9p: fix build breakage introduced by FS-Cache 2009-12-01 07:35:11 -08:00
adfs
affs
afs afs: remove manual O_SYNC handling 2009-12-10 15:02:50 +01:00
autofs
autofs4 autofs4: always use lookup for lookup 2009-12-16 07:19:58 -08:00
befs
bfs
btrfs Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable 2009-12-17 16:01:03 -08:00
cachefiles Untangling ima mess, part 2: deal with counters 2009-12-16 12:16:47 -05:00
cifs Merge branch 'for-2.6.33' of git://linux-nfs.org/~bfields/linux 2009-12-16 10:43:34 -08:00
coda sysctl: Drop & in front of every proc_handler. 2009-11-18 08:37:40 -08:00
configfs
cramfs
debugfs debugfs: fix create mutex racy fops and private data 2009-12-11 11:24:53 -08:00
devpts devpts_get_tty() should validate inode 2009-12-11 15:18:05 -08:00
dlm Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/dlm 2009-12-10 09:33:59 -08:00
ecryptfs fsstack/ecryptfs: remove unused get_nlinks param to fsstack_copy_attr_all 2009-12-17 10:57:30 -05:00
efs
exofs exofs: Multi-device mirror support 2009-12-10 09:59:23 +02:00
exportfs nfs: new subdir Documentation/filesystems/nfs 2009-10-27 19:34:04 -04:00
ext2 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6 2009-12-16 12:04:02 -08:00
ext3 ext3: Replace lock/unlock_super() with an explicit lock for resizing 2009-12-23 13:44:12 +01:00
ext4 ext4: Calculate metadata requirements more accurately 2010-01-01 02:41:30 -05:00
fat Merge git://git.kernel.org/pub/scm/linux/kernel/git/hirofumi/fatfs-2.6 2009-12-16 10:29:26 -08:00
freevxfs
fscache FS-Cache: Avoid maybe-used-uninitialised warning on variable 2009-12-16 07:20:13 -08:00
fuse fuse: reject O_DIRECT flag also in fuse_create 2009-11-27 16:37:13 +01:00
gfs2 Revert "task_struct: make journal_info conditional" 2009-12-17 13:23:24 -08:00
hfs hfs: fix a potential buffer overflow 2009-12-15 08:53:10 -08:00
hfsplus hfsplus: refuse to mount volumes larger than 2TB 2009-10-29 07:39:27 -07:00
hostfs
hpfs hpfs: use bitmap_weight() 2009-12-16 07:20:06 -08:00
hppfs
hugetlbfs Untangling ima mess, part 1: alloc_file() 2009-12-16 12:16:47 -05:00
isofs Merge branch 'for-2.6.33' of git://linux-nfs.org/~bfields/linux 2009-12-16 10:43:34 -08:00
jbd jbd: jbd-debug and jbd2-debug should be writable 2009-12-23 13:44:13 +01:00
jbd2 jbd2: don't use __GFP_NOFAIL in journal_init_common() 2009-12-23 08:05:15 -05:00
jffs2 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6 2009-12-16 12:04:02 -08:00
jfs jfs: Fix 32bit build warning 2009-12-22 12:27:35 -05:00
lockd Merge branch 'for-2.6.33' of git://linux-nfs.org/~bfields/linux 2009-12-16 10:43:34 -08:00
minix
ncpfs tree-wide: fix assorted typos all over the place 2009-12-04 15:39:55 +01:00
nfs Revert "fix mismerge with Trond's stuff (create_mnt_ns() export is gone now)" 2009-12-17 12:51:05 -08:00
nfs_common
nfsd nfsd: fix "insecure" export option 2009-12-20 20:19:51 -08:00
nilfs2 Revert "task_struct: make journal_info conditional" 2009-12-17 13:23:24 -08:00
nls
notify switch alloc_file() to passing struct path 2009-12-16 12:16:42 -05:00
ntfs kill I_LOCK 2009-12-17 11:03:25 -05:00
ocfs2 Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/ocfs2 2009-12-24 12:59:11 -08:00
omfs tree-wide: fix assorted typos all over the place 2009-12-04 15:39:55 +01:00
openpromfs
partitions partitions: read whole sector with EFI GPT header 2009-11-23 09:29:58 +01:00
proc Merge branch 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-12-19 09:47:49 -08:00
qnx4 qnx4: use hweight8 2009-12-16 07:20:18 -08:00
quota quota: Improve checking of quota file header 2009-12-23 13:44:13 +01:00
ramfs nommu: ramfs: remove unused local var 2009-12-17 15:45:31 -08:00
reiserfs reiserfs: truncate blocks not used by a write 2009-12-17 15:45:30 -08:00
romfs ROMFS: fix length used with romfs_dev_strnlen() function 2009-10-11 11:33:56 -07:00
smbfs
squashfs
sysfs Driver core: bin_attribute parameters can often be const* 2009-12-23 11:23:43 -08:00
sysv
ubifs kill I_LOCK 2009-12-17 11:03:25 -05:00
udf udf: Avoid IO in udf_clear_inode 2009-12-14 21:40:04 +01:00
ufs ufs: NFS support 2009-12-16 07:20:06 -08:00
xfs kill I_LOCK 2009-12-17 11:03:25 -05:00
aio.c aio: remove unused field 2009-12-16 07:20:13 -08:00
anon_inodes.c Sanitize f_flags helpers 2009-12-22 12:27:34 -05:00
attr.c
bad_inode.c
binfmt_aout.c mm: introduce coredump parameter structure 2009-12-17 15:45:31 -08:00
binfmt_elf_fdpic.c mm: introduce coredump parameter structure 2009-12-17 15:45:31 -08:00
binfmt_elf.c mm: introduce coredump parameter structure 2009-12-17 15:45:31 -08:00
binfmt_em86.c
binfmt_flat.c mm: introduce coredump parameter structure 2009-12-17 15:45:31 -08:00
binfmt_misc.c
binfmt_script.c
binfmt_som.c mm: introduce coredump parameter structure 2009-12-17 15:45:31 -08:00
bio-integrity.c
bio.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2009-12-09 19:43:33 -08:00
block_dev.c Merge branch 'for-linus' into for-2.6.33 2009-11-03 21:14:39 +01:00
buffer.c
char_dev.c
compat_binfmt_elf.c
compat_ioctl.c fs/compat_ioctl.c: fix build error when !BLOCK 2009-12-22 12:27:33 -05:00
compat.c compat.c: Remove dependence on nfsd private headers 2009-12-14 18:12:10 -05:00
dcache.c libfs: move EXPORT_SYMBOL for d_alloc_name 2009-12-16 12:16:48 -05:00
dcookies.c
direct-io.c dio: fix use-after-free 2009-12-17 04:52:13 -05:00
drop_caches.c
eventfd.c anonfd: Allow making anon files read-only 2009-12-22 12:27:34 -05:00
eventpoll.c anonfd: Allow making anon files read-only 2009-12-22 12:27:34 -05:00
exec.c mm: introduce coredump parameter structure 2009-12-17 15:45:31 -08:00
fcntl.c fcntl: rename F_OWNER_GID to F_OWNER_PGRP 2009-11-17 17:40:33 -08:00
fifo.c
file_table.c alloc_file(): simplify handling of mnt_clone_write() errors 2009-12-22 12:27:33 -05:00
file.c headers: remove sched.h from interrupt.h 2009-10-11 11:20:58 -07:00
filesystems.c
fs_struct.c
fs-writeback.c fs-writeback: Add helper function to start writeback if idle 2009-12-23 07:57:07 -05:00
generic_acl.c make generic_acl slightly more generic 2009-12-16 12:16:49 -05:00
inode.c kill I_LOCK 2009-12-17 11:03:25 -05:00
internal.h Fix f_flags/f_mode in case of lookup_instantiate_filp() from open(pathname, 3) 2009-12-22 12:27:34 -05:00
ioctl.c __generic_block_fiemap(): fix for files bigger than 4GB 2009-11-12 07:26:01 -08:00
ioprio.c
Kconfig Revert "task_struct: make journal_info conditional" 2009-12-17 13:23:24 -08:00
Kconfig.binfmt
libfs.c libfs: move EXPORT_SYMBOL for d_alloc_name 2009-12-16 12:16:48 -05:00
locks.c
Makefile
mbcache.c
mpage.c
namei.c Sanitize f_flags helpers 2009-12-22 12:27:34 -05:00
namespace.c Revert "fix mismerge with Trond's stuff (create_mnt_ns() export is gone now)" 2009-12-17 12:51:05 -08:00
nfsctl.c vfs: nfsctl.c un-used nfsd #includes 2009-12-14 18:12:11 -05:00
no-block.c
open.c Sanitize f_flags helpers 2009-12-22 12:27:34 -05:00
pipe.c fs: no games with DCACHE_UNHASHED 2009-12-17 10:51:40 -05:00
pnode.c
pnode.h
posix_acl.c
read_write.c sendfile(): check f_op.splice_write() rather than f_op.sendpage() 2009-11-04 09:09:52 +01:00
read_write.h
readdir.c
select.c
seq_file.c
signalfd.c anonfd: Allow making anon files read-only 2009-12-22 12:27:34 -05:00
splice.c sendfile(): check f_op.splice_write() rather than f_op.sendpage() 2009-11-04 09:09:52 +01:00
stack.c VFS/fsstack: handle 32-bit smp + preempt + large files in fsstack_copy_inode_size 2009-12-17 10:58:17 -05:00
stat.c Add unlocked version of inode_add_bytes() function 2009-12-23 13:33:54 +01:00
super.c vfs: get_sb_single() - do not pass options twice 2009-12-23 11:23:43 -08:00
sync.c fold do_sync_file_range into sys_sync_file_range 2009-12-17 11:03:25 -05:00
timerfd.c anonfd: Allow making anon files read-only 2009-12-22 12:27:34 -05:00
utimes.c
xattr_acl.c VFS: Use GFP_NOFS in posix_acl_from_xattr() 2009-12-03 11:48:07 +00:00
xattr.c sanitize xattr handler prototypes 2009-12-16 12:16:49 -05:00