<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/ext4/migrate.c, branch linux-3.18.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.18.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.18.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2015-08-04T18:14:59Z</updated>
<entry>
<title>ext4: correctly migrate a file with a hole at the beginning</title>
<updated>2015-08-04T18:14:59Z</updated>
<author>
<name>Eryu Guan</name>
</author>
<published>2015-07-04T04:03:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f164c7de2710059aae7b66f668f0a2ab5a7689c2'/>
<id>urn:sha1:f164c7de2710059aae7b66f668f0a2ab5a7689c2</id>
<content type='text'>
[ Upstream commit 8974fec7d72e3e02752fe0f27b4c3719c78d9a15 ]

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 &lt;guaneryu@gmail.com&gt;
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</content>
</entry>
<entry>
<title>ext4: be more strict when migrating to non-extent based file</title>
<updated>2015-08-04T18:14:41Z</updated>
<author>
<name>Eryu Guan</name>
</author>
<published>2015-07-04T03:56:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=694fd43fb701e0db5d3cdefc49725a1154a605a7'/>
<id>urn:sha1:694fd43fb701e0db5d3cdefc49725a1154a605a7</id>
<content type='text'>
[ Upstream commit d6f123a9297496ad0b6335fe881504c4b5b2a5e5 ]

Currently the check in ext4_ind_migrate() is not enough before doing the
real conversion:

a) delayed allocated extents could bypass the check on eh-&gt;eh_entries
   and eh-&gt;eh_depth

This can be demonstrated by this script

  xfs_io -fc "pwrite 0 4k" -c "pwrite 8k 4k" /mnt/ext4/testfile
  chattr -e /mnt/ext4/testfile

where testfile has two extents but still be converted to non-extent
based file format.

b) only extent length is checked but not the offset, which would result
   in data lose (delalloc) or fs corruption (nodelalloc), because
   non-extent based file only supports at most (12 + 2^10 + 2^20 + 2^30)
   blocks

This can be demostrated by

  xfs_io -fc "pwrite 5T 4k" /mnt/ext4/testfile
  chattr -e /mnt/ext4/testfile
  sync

If delalloc is enabled, dmesg prints
  EXT4-fs warning (device dm-4): ext4_block_to_path:105: block 1342177280 &gt; max in inode 53
  EXT4-fs (dm-4): Delayed block allocation failed for inode 53 at logical offset 1342177280 with max blocks 1 with error 5
  EXT4-fs (dm-4): This should not happen!! Data will be lost

If delalloc is disabled, e2fsck -nf shows corruption
  Inode 53, i_size is 5497558142976, should be 4096.  Fix? no

Fix the two issues by

a) forcing all delayed allocation blocks to be allocated before checking
   eh-&gt;eh_depth and eh-&gt;eh_entries
b) limiting the last logical block of the extent is within direct map

Signed-off-by: Eryu Guan &lt;guaneryu@gmail.com&gt;
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</content>
</entry>
<entry>
<title>ext4: rename ext4_ext_find_extent() to ext4_find_extent()</title>
<updated>2014-09-01T18:43:09Z</updated>
<author>
<name>Theodore Ts'o</name>
</author>
<published>2014-09-01T18:43:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ed8a1a766af7371bfbe41857a3a11496b4165143'/>
<id>urn:sha1:ed8a1a766af7371bfbe41857a3a11496b4165143</id>
<content type='text'>
Make the function name less redundant.

Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>ext4: allow a NULL argument to ext4_ext_drop_refs()</title>
<updated>2014-09-01T18:39:09Z</updated>
<author>
<name>Theodore Ts'o</name>
</author>
<published>2014-09-01T18:39:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b7ea89ad0a6b855172158a999d3f5008403f4011'/>
<id>urn:sha1:b7ea89ad0a6b855172158a999d3f5008403f4011</id>
<content type='text'>
Teach ext4_ext_drop_refs() to accept a NULL argument, much like
kfree().  This allows us to drop a lot of checks to make sure path is
non-NULL before calling ext4_ext_drop_refs().

Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>ext4: drop EXT4_EX_NOFREE_ON_ERR from rest of extents handling code</title>
<updated>2014-09-01T18:37:09Z</updated>
<author>
<name>Theodore Ts'o</name>
</author>
<published>2014-09-01T18:37:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=dfe5080939ea4686b3414b5d970a9b26733c57a4'/>
<id>urn:sha1:dfe5080939ea4686b3414b5d970a9b26733c57a4</id>
<content type='text'>
Drop EXT4_EX_NOFREE_ON_ERR from ext4_ext_create_new_leaf(),
ext4_split_extent(), ext4_convert_unwritten_extents_endio().

This requires fixing all of their callers to potentially
ext4_ext_find_extent() to free the struct ext4_ext_path object in case
of an error, and there are interlocking dependencies all the way up to
ext4_ext_map_blocks(), ext4_swap_extents(), and
ext4_ext_remove_space().

Once this is done, we can drop the EXT4_EX_NOFREE_ON_ERR flag since it
is no longer necessary.

Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;

</content>
</entry>
<entry>
<title>ext4: add i_data_sem sanity check</title>
<updated>2014-07-28T02:28:15Z</updated>
<author>
<name>Dmitry Monakhov</name>
</author>
<published>2014-07-28T02:28:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4b1f1660710c2ddcefc08c289e66a32b6bc2a2e3'/>
<id>urn:sha1:4b1f1660710c2ddcefc08c289e66a32b6bc2a2e3</id>
<content type='text'>
Each caller of ext4_ext_dirty must hold i_data_sem,
The only exception is migration code, let's make it convenient.

Signed-off-by: Dmitry Monakhov &lt;dmonakhov@openvz.org&gt;
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
Reviewed-by: Jan Kara &lt;jack@suse.cz&gt;
</content>
</entry>
<entry>
<title>ext4: remove unnecessary double parentheses</title>
<updated>2014-05-12T16:55:07Z</updated>
<author>
<name>Lukas Czerner</name>
</author>
<published>2014-05-12T16:55:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c8b459f492cbe8be26d8eac0489ef627ed355947'/>
<id>urn:sha1:c8b459f492cbe8be26d8eac0489ef627ed355947</id>
<content type='text'>
Signed-off-by: Lukas Czerner &lt;lczerner@redhat.com&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>ext4: Fix misspellings using 'codespell' tool</title>
<updated>2013-08-28T18:40:12Z</updated>
<author>
<name>Anatol Pomozov</name>
</author>
<published>2013-08-28T18:40:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=70261f568f3c08552f034742e3d5cb78c3877766'/>
<id>urn:sha1:70261f568f3c08552f034742e3d5cb78c3877766</id>
<content type='text'>
Signed-off-by: Anatol Pomozov &lt;anatol.pomozov@gmail.com&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>ext4: cache all of an extent tree's leaf block upon reading</title>
<updated>2013-08-17T01:23:41Z</updated>
<author>
<name>Theodore Ts'o</name>
</author>
<published>2013-08-17T01:23:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=107a7bd31ac003e42c0f966aa8e5b26947de6024'/>
<id>urn:sha1:107a7bd31ac003e42c0f966aa8e5b26947de6024</id>
<content type='text'>
When we read in an extent tree leaf block from disk, arrange to have
all of its entries cached.  In nearly all cases the in-memory
representation will be more compact than the on-disk representation in
the buffer cache, and it allows us to get the information without
having to traverse the extent tree for successive extents.

Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Reviewed-by: Zheng Liu &lt;wenqing.lz@taobao.com&gt;
</content>
</entry>
<entry>
<title>ext4: do not convert to indirect with bigalloc enabled</title>
<updated>2013-04-11T14:54:46Z</updated>
<author>
<name>Lukas Czerner</name>
</author>
<published>2013-04-11T14:54:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=43e50f50866513144026f2ac1a1c5cc20c7a8428'/>
<id>urn:sha1:43e50f50866513144026f2ac1a1c5cc20c7a8428</id>
<content type='text'>
With bigalloc feature enabled we do not support indirect addressing at all
so we have to prevent extent addressing to indirect addressing
conversion in this case. The problem has been introduced with the commit
"ext4: support simple conversion of extent-mapped inodes to use i_blocks"

Signed-off-by: Lukas Czerner &lt;lczerner@redhat.com&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
</content>
</entry>
</feed>
