ext4: trace punch_hole correctly in ext4_ext_map_blocks
authorYongqiang Yang <xiaoqiangnk@gmail.com>
Sat, 29 Oct 2011 13:39:51 +0000 (09:39 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 29 Oct 2011 13:39:51 +0000 (09:39 -0400)
When ext4_ext_map_blocks() is called by punch_hole, trace should
trace blocks punched out.

Signed-off-by: Yongqiang Yang <xiaoqiangnk@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/ext4/extents.c

index 652b4dc5dfcb73441bc82087ebebc37935fa0a6a..36a0f177ecade96f361af19e7c304972f1283e61 100644 (file)
@@ -4171,12 +4171,12 @@ out2:
                ext4_ext_drop_refs(path);
                kfree(path);
        }
-       trace_ext4_ext_map_blocks_exit(inode, map->m_lblk,
-               newblock, map->m_len, err ? err : allocated);
-
        result = (flags & EXT4_GET_BLOCKS_PUNCH_OUT_EXT) ?
                        punched_out : allocated;
 
+       trace_ext4_ext_map_blocks_exit(inode, map->m_lblk,
+               newblock, map->m_len, err ? err : result);
+
        return err ? err : result;
 }