]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
ext4: Make sure all the block allocation paths reserve blocks
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Tue, 16 Mar 2010 00:25:57 +0000 (20:25 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 26 May 2010 21:27:05 +0000 (14:27 -0700)
commit05b6ea26438ab615144075c14a484d0d7940934f
tree07627b1e16063efbfeb2f672aae1dea0f3fb4552
parentac6016e3a8c7967cf8e3fe9102a9b87d7092b4bf
ext4: Make sure all the block allocation paths reserve blocks

commit a30d542a0035b886ffaafd0057ced0a2b28c3a4f upstream.

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>
Signed-off-by: Jayson R. King <dev@jaysonking.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/ext4/balloc.c
fs/ext4/ext4.h
fs/ext4/inode.c
fs/ext4/mballoc.c