]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: delayed allocation ENOSPC handling
authorMingming Cao <cmm@us.ibm.com>
Mon, 14 Jul 2008 21:52:37 +0000 (17:52 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 14 Jul 2008 21:52:37 +0000 (17:52 -0400)
commitfbbb0d6541f320373e5379ab74abc404fd8b433c
tree75a701a89829ba7d728fdc19c30aa2794b9706b9
parent79f36b442a30622523d6b82ca8f65c9112d016d3
ext4: delayed allocation ENOSPC handling

This patch does block reservation for delayed
allocation, to avoid ENOSPC later at page flush time.

Blocks(data and metadata) are reserved at da_write_begin()
time, the freeblocks counter is updated by then, and the number of
reserved blocks is store in per inode counter.

At the writepage time, the unused reserved meta blocks are returned
back. At unlink/truncate time, reserved blocks are properly released.

Updated fix from  Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
to fix the oldallocator block reservation accounting with delalloc, added
lock to guard the counters and also fix the reservation for meta blocks.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Mingming Cao <cmm@us.ibm.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/balloc.c
fs/ext4/dir.c
fs/ext4/ext4.h
fs/ext4/ext4_extents.h
fs/ext4/ext4_i.h
fs/ext4/extents.c
fs/ext4/inode.c
fs/ext4/mballoc.c
fs/ext4/super.c