android_kernel_samsung_msm8976/fs/ext4
Eryu Guan 3cf4f7339b ext4: correctly migrate a file with a hole at the beginning
commit 8974fec7d72e3e02752fe0f27b4c3719c78d9a15 upstream.

Currently ext4_ind_migrate() doesn't correctly handle a file which
contains a hole at the beginning of the file.  This caused the migration
to be done incorrectly, and then if there is a subsequent following
delayed allocation write to the "hole", this would reclaim the same data
blocks again and results in fs corruption.

  # assmuing 4k block size ext4, with delalloc enabled
  # skip the first block and write to the second block
  xfs_io -fc "pwrite 4k 4k" -c "fsync" /mnt/ext4/testfile

  # converting to indirect-mapped file, which would move the data blocks
  # to the beginning of the file, but extent status cache still marks
  # that region as a hole
  chattr -e /mnt/ext4/testfile

  # delayed allocation writes to the "hole", reclaim the same data block
  # again, results in i_blocks corruption
  xfs_io -c "pwrite 0 4k" /mnt/ext4/testfile
  umount /mnt/ext4
  e2fsck -nf /dev/sda6
  ...
  Inode 53, i_blocks is 16, should be 8.  Fix? no
  ...

Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-03 09:29:43 -07:00
..
acl.c ext4: fix the number of credits needed for acl ops with inline data 2013-02-09 15:23:03 -05:00
acl.h fs: take the ACL checks to common code 2011-07-25 14:30:23 -04:00
balloc.c ext4: fix ext4_get_group_number() 2013-07-21 18:21:33 -07:00
bitmap.c ext4: Checksum the block bitmap properly with bigalloc enabled 2012-10-22 00:34:32 -04:00
block_validity.c ext2/3/4: delete unneeded includes of module.h 2012-01-09 13:52:10 +01:00
dir.c ext4: fix readdir error in the case of inline_data+dir_index 2013-04-19 17:53:09 -04:00
ext4.h ext4: fix warning in ext4_da_update_reserve_space() 2015-01-29 17:40:57 -08:00
ext4_extents.h ext4: mext_insert_extents should update extent block checksum 2013-04-19 14:04:12 -04:00
ext4_jbd2.c ext4: call ext4_error_inode() if jbd2_journal_dirty_metadata() fails 2014-01-09 12:24:21 -08:00
ext4_jbd2.h ext4: improve credit estimate for EXT4_SINGLEDATA_TRANS_BLOCKS 2013-04-09 12:39:26 -04:00
extents.c ext4: check for zero length extent explicitly 2015-06-05 23:19:58 -07:00
extents_status.c ext4: fix data corruption caused by unwritten and delayed extents 2015-05-13 05:15:42 -07:00
extents_status.h ext4: fix fio regression 2013-05-03 02:15:52 -04:00
file.c ext4: prevent bugon on race between write/fcntl 2015-02-11 14:48:17 +08:00
fsync.c ext4/jbd2: don't wait (forever) for stale tid caused by wraparound 2013-04-03 22:02:52 -04:00
hash.c ext4: reduce one "if" comparison in ext4_dirhash() 2013-02-01 22:33:21 -05:00
ialloc.c ext4: fix oops when loading block bitmap failed 2014-11-14 08:47:58 -08:00
indirect.c ext4: don't retry file block mapping on bigalloc fs with non-extent file 2015-08-03 09:29:43 -07:00
inline.c ext4: avoid clearing beyond i_blocks when truncating an inline data file 2014-02-06 11:08:16 -08:00
inode.c ext4: fix reservation release on invalidatepage for delalloc fs 2015-08-03 09:29:43 -07:00
ioctl.c ext4: grab missed write_count for EXT4_IOC_SWAP_BOOT 2014-11-14 08:47:57 -08:00
Kconfig ext4: fix Kconfig documentation for CONFIG_EXT4_DEBUG 2013-04-21 20:32:03 -04:00
Makefile ext4: Remove CONFIG_EXT4_FS_XATTR 2012-12-10 16:30:43 -05:00
mballoc.c ext4: fix warning in ext4_da_update_reserve_space() 2015-01-29 17:40:57 -08:00
mballoc.h ext4: use module parameters instead of debugfs for mballoc_debug 2013-02-09 16:28:20 -05:00
migrate.c ext4: correctly migrate a file with a hole at the beginning 2015-08-03 09:29:43 -07:00
mmp.c ext4: mark all metadata I/O with REQ_META 2013-04-20 15:46:17 -04:00
move_extent.c ext4: mext_insert_extents should update extent block checksum 2013-04-19 14:04:12 -04:00
namei.c ext4: make fsync to sync parent dir in no-journal for real this time 2015-05-06 21:56:25 +02:00
page-io.c ext4: fix zeroing of page during writeback 2014-06-30 20:09:42 -07:00
resize.c ext4: fix overflow when updating superblock backups after resize 2014-11-14 08:47:58 -08:00
super.c ext4: call sync_blockdev() before invalidate_bdev() in put_super() 2015-08-03 09:29:42 -07:00
symlink.c ext4: Remove CONFIG_EXT4_FS_XATTR 2012-12-10 16:30:43 -05:00
truncate.h ext4: move common truncate functions to header file 2011-06-27 19:16:04 -04:00
xattr.c ext4: check EA value offset when loading 2014-11-14 08:47:57 -08:00
xattr.h ext4: reserve xattr index for Rich ACL support 2013-04-18 14:53:15 -04:00
xattr_security.c Merge branch 'for_linus' into for_linus_merged 2012-01-10 11:54:07 -05:00
xattr_trusted.c ext2/3/4: delete unneeded includes of module.h 2012-01-09 13:52:10 +01:00
xattr_user.c ext2/3/4: delete unneeded includes of module.h 2012-01-09 13:52:10 +01:00