linux/fs/ext4
Mingming Cao 632eaeab1f ext4: fix delalloc i_disksize early update issue
Ext4_da_write_end() used walk_page_buffers() with a callback function of
ext4_bh_unmapped_or_delay() to check if it extended the file size
without allocating any blocks (since in this case i_disksize needs to be
updated).  However, this is didn't work proprely because the buffer head
has not been marked dirty yet --- this is done later in
block_commit_write() --- which caused ext4_bh_unmapped_or_delay() to
always return false.

In addition, walk_page_buffers() checks all of the buffer heads covering
the page, and the only buffer_head that should be checked is the one
covering the end of the write.  Otherwise, given a 1k blocksize
filesystem and a 4k page size, the buffer head covering the first 1k
stripe of the file could be unmapped (because it was a sparse file), and
the second or third buffer_head covering that page could be mapped, and
using walk_page_buffers() would fail in this case since it would stop at
the first unmapped buffer_head and return true.

The core problem is that walk_page_buffers() was intended to do work in
a callback function, and a non-zero return value indicated a failure,
which termined the walk of the buffer heads covering the page.  It was
not intended to be used with a boolean function, such as
ext4_bh_unmapped_or_delay().

Add addtional fix from Aneesh to protect i_disksize update rave with truncate.

Signed-off-by: Mingming Cao <cmm@us.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-07-11 19:27:31 -04:00
..
Makefile ext4: Add multi block allocator for ext4 2008-01-29 00:19:52 -05:00
acl.c ext4: fix wrong gfp type under transaction 2008-04-29 22:02:02 -04:00
acl.h [PATCH] ext4: rename ext4 symbols to avoid duplication of ext3 symbols 2006-10-11 11:14:15 -07:00
balloc.c ext4: delayed allocation ENOSPC handling 2008-07-14 17:52:37 -04:00
bitmap.c ext4: move headers out of include/linux 2008-04-29 18:13:32 -04:00
dir.c ext4: delayed allocation ENOSPC handling 2008-07-14 17:52:37 -04:00
ext4.h ext4: delayed allocation ENOSPC handling 2008-07-14 17:52:37 -04:00
ext4_extents.h ext4: delayed allocation ENOSPC handling 2008-07-14 17:52:37 -04:00
ext4_i.h ext4: delayed allocation ENOSPC handling 2008-07-14 17:52:37 -04:00
ext4_jbd2.c ext4: move headers out of include/linux 2008-04-29 18:13:32 -04:00
ext4_jbd2.h ext4: Use new framework for data=ordered mode in JBD2 2008-07-11 19:27:31 -04:00
ext4_sb.h ext4: New inode allocation for FLEX_BG meta-data groups. 2008-07-11 19:27:31 -04:00
extents.c ext4: Invert lock ordering of page_lock and transaction start in delalloc 2008-07-11 19:27:31 -04:00
file.c ext4: Use page_mkwrite vma_operations to get mmap write notification. 2008-07-11 19:27:31 -04:00
fsync.c ext4: call blkdev_issue_flush on fsync 2008-07-11 19:27:31 -04:00
group.h ext4: Rename read_block_bitmap() to ext4_read_block_bitmap() 2008-07-11 19:27:31 -04:00
hash.c ext4: move headers out of include/linux 2008-04-29 18:13:32 -04:00
ialloc.c ext4: New inode allocation for FLEX_BG meta-data groups. 2008-07-11 19:27:31 -04:00
inode.c ext4: fix delalloc i_disksize early update issue 2008-07-11 19:27:31 -04:00
ioctl.c ext4: move headers out of include/linux 2008-04-29 18:13:32 -04:00
mballoc.c ext4: delayed allocation ENOSPC handling 2008-07-14 17:52:37 -04:00
mballoc.h ext4: Move mballoc headers/structures to a seperate header file mballoc.h 2008-04-29 22:01:31 -04:00
migrate.c ext4: move headers out of include/linux 2008-04-29 18:13:32 -04:00
namei.c ext4: cleanup never-used magic numbers from htree code 2008-07-11 19:27:31 -04:00
namei.h [PATCH] ext4: rename ext4 symbols to avoid duplication of ext3 symbols 2006-10-11 11:14:15 -07:00
resize.c ext4: fix online resize with mballoc 2008-07-11 19:27:31 -04:00
super.c ext4: delayed allocation ENOSPC handling 2008-07-14 17:52:37 -04:00
symlink.c ext4: move headers out of include/linux 2008-04-29 18:13:32 -04:00
xattr.c ext4: Use inode preallocation with -o noextents 2008-07-11 19:27:31 -04:00
xattr.h ext4: make ext4_xattr_list() static 2008-04-17 10:38:59 -04:00
xattr_security.c ext4: move headers out of include/linux 2008-04-29 18:13:32 -04:00
xattr_trusted.c ext4: remove double definitions of xattr macros 2008-07-11 19:27:31 -04:00
xattr_user.c ext4: remove double definitions of xattr macros 2008-07-11 19:27:31 -04:00