]> pilppa.com Git - linux-2.6-omap-h63xx.git/commit
ext4: Make sure all the block allocation paths reserve blocks
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Thu, 9 Oct 2008 14:56:23 +0000 (10:56 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 9 Oct 2008 14:56:23 +0000 (10:56 -0400)
commita30d542a0035b886ffaafd0057ced0a2b28c3a4f
tree9e677eaf4eb1611701828554b27a1b0b0ae523fd
parentc4a0c46ec92c194c873232b88debce4e1a448483
ext4: Make sure all the block allocation paths reserve blocks

With delayed allocation we need to make sure block are reserved before
we attempt to allocate them. Otherwise we get block allocation failure
(ENOSPC) during writepages which cannot be handled. This would mean
silent data loss (We do a printk stating data will be lost). This patch
updates the DIO and fallocate code path to do block reservation before
block allocation. This is needed to make sure parallel DIO and fallocate
request doesn't take block out of delayed reserve space.

When free blocks count go below a threshold we switch to a slow patch
which looks at other CPU's accumulated percpu counter values.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/ext4/balloc.c
fs/ext4/ext4.h
fs/ext4/inode.c
fs/ext4/mballoc.c