]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
ext4: Clear the unwritten buffer_head flag after the extent is initialized
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Tue, 2 Jun 2009 12:07:58 +0000 (08:07 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 15 Jun 2009 16:40:39 +0000 (09:40 -0700)
commit85d74145f2ad27963cb2ab6fcbafcc1a172c7a7a
tree2e5ff0eaf9bef0fa118021ce79b4dd5fabcee7bb
parent9cb18641b3fd86309735fc4e2df14aaf9c50469c
ext4: Clear the unwritten buffer_head flag after the extent is initialized

(cherry picked from commit 2a8964d63d50dd2d65d71d342bc7fb6ef4117614)

The BH_Unwritten flag indicates that the buffer is allocated on disk
but has not been written; that is, the disk was part of a persistent
preallocation area.  That flag should only be set when a get_blocks()
function is looking up a inode's logical to physical block mapping.

When ext4_get_blocks_wrap() is called with create=1, the uninitialized
extent is converted into an initialized one, so the BH_Unwritten flag
is no longer appropriate.  Hence, we need to make sure the
BH_Unwritten is not left set, since the combination of BH_Mapped and
BH_Unwritten is not allowed; among other things, it will result ext4's
get_block() to be called over and over again during the write_begin
phase of write(2).

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/ext4/inode.c