]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: fix wrong m_len value after unwritten extent conversion
authorZheng Liu <wenqing.lz@taobao.com>
Mon, 11 Mar 2013 01:08:52 +0000 (21:08 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 11 Mar 2013 01:08:52 +0000 (21:08 -0400)
commita6b2619c45ab07107201f95946e77d2587a49442
tree91ac86ddb480e0df9385917999645a8c0d35c68b
parent4708bce2a56acdb3dddf1b515e87b1ad2e1718fe
ext4: fix wrong m_len value after unwritten extent conversion

The ext4_ext_handle_uninitialized_extents() function was assuming the
return value of ext4_ext_map_blocks() is equal to map->m_len.  This
incorrect assumption was harmless until we started use status tree as
a extent cache because we need to update status tree according to
'm_len' value.

Meanwhile this commit marks EXT4_MAP_MAPPED flag after unwritten extent
conversion.  It shouldn't cause a bug because we update status tree
according to checking EXT4_MAP_UNWRITTEN flag.  But it should be fixed.

After applied this commit, the following error message from self-testing
infrastructure disappears.

    ...
    kernel: ES len assertation failed for inode: 230 retval 1 !=
    map->m_len 3 in ext4_map_blocks (allocation)
    ...

Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: Dmitry Monakhov <dmonakhov@openvz.org>
fs/ext4/extents.c