From 148d9c40394b4c8438b3caa14d91fb37a386cff3 Mon Sep 17 00:00:00 2001 From: Tao Ma Date: Wed, 26 Oct 2011 11:08:39 -0400 Subject: [PATCH] --- yaml --- r: 273162 b: refs/heads/master c: b3ff05690845911cc40387176f0bc5a7af9ef3ff h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/ext4/extents.c | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index fc2bbe800979..f6b2777fe568 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 0a10da73e1fa6fb9b45f1166011ff3b04c27c010 +refs/heads/master: b3ff05690845911cc40387176f0bc5a7af9ef3ff diff --git a/trunk/fs/ext4/extents.c b/trunk/fs/ext4/extents.c index 797b63b59740..c2ac06cb2d46 100644 --- a/trunk/fs/ext4/extents.c +++ b/trunk/fs/ext4/extents.c @@ -3390,9 +3390,11 @@ ext4_ext_handle_uninitialized_extents(handle_t *handle, struct inode *inode, * that this IO needs to conversion to written when IO is * completed */ - if (io && !(io->flag & EXT4_IO_END_UNWRITTEN)) { - io->flag = EXT4_IO_END_UNWRITTEN; - atomic_inc(&EXT4_I(inode)->i_aiodio_unwritten); + if (io) { + if (!(io->flag & EXT4_IO_END_UNWRITTEN)) { + io->flag = EXT4_IO_END_UNWRITTEN; + atomic_inc(&EXT4_I(inode)->i_aiodio_unwritten); + } } else ext4_set_inode_state(inode, EXT4_STATE_DIO_UNWRITTEN); if (ext4_should_dioread_nolock(inode)) @@ -3946,9 +3948,11 @@ int ext4_ext_map_blocks(handle_t *handle, struct inode *inode, * that we need to perform conversion when IO is done. */ if ((flags & EXT4_GET_BLOCKS_PRE_IO)) { - if (io && !(io->flag & EXT4_IO_END_UNWRITTEN)) { - io->flag = EXT4_IO_END_UNWRITTEN; - atomic_inc(&EXT4_I(inode)->i_aiodio_unwritten); + if (io) { + if (!(io->flag & EXT4_IO_END_UNWRITTEN)) { + io->flag = EXT4_IO_END_UNWRITTEN; + atomic_inc(&EXT4_I(inode)->i_aiodio_unwritten); + } } else ext4_set_inode_state(inode, EXT4_STATE_DIO_UNWRITTEN);