ext4: mext_insert_extents should update extent block checksum
authorDarrick J. Wong <darrick.wong@oracle.com>
Fri, 19 Apr 2013 18:04:12 +0000 (14:04 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 19 Apr 2013 18:04:12 +0000 (14:04 -0400)
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/ext4/ext4_extents.h
fs/ext4/extents.c
fs/ext4/move_extent.c

index 8643ff5bbeb7a9954af0026ce43601d02487856b..51bc821ade90e2eacf9e894f836dcb50f9617b00 100644 (file)
@@ -270,5 +270,10 @@ static inline void ext4_idx_store_pblock(struct ext4_extent_idx *ix,
                                     0xffff);
 }
 
+#define ext4_ext_dirty(handle, inode, path) \
+               __ext4_ext_dirty(__func__, __LINE__, (handle), (inode), (path))
+int __ext4_ext_dirty(const char *where, unsigned int line, handle_t *handle,
+                    struct inode *inode, struct ext4_ext_path *path);
+
 #endif /* _EXT4_EXTENTS */
 
index 6fcb375c8fde27c1542fb5e91a9becba7f872cb2..107936db244eddd5e7192b657ccef02841d3b617 100644 (file)
@@ -157,11 +157,8 @@ static int ext4_ext_get_access(handle_t *handle, struct inode *inode,
  *  - ENOMEM
  *  - EIO
  */
-#define ext4_ext_dirty(handle, inode, path) \
-               __ext4_ext_dirty(__func__, __LINE__, (handle), (inode), (path))
-static int __ext4_ext_dirty(const char *where, unsigned int line,
-                           handle_t *handle, struct inode *inode,
-                           struct ext4_ext_path *path)
+int __ext4_ext_dirty(const char *where, unsigned int line, handle_t *handle,
+                    struct inode *inode, struct ext4_ext_path *path)
 {
        int err;
        if (path->p_bh) {
index 309ca899a7310f9b92402eedce6609867b18cb7b..3dcbf364022fe286b1eb94afa16a50790e88bf29 100644 (file)
@@ -409,18 +409,7 @@ mext_insert_extents(handle_t *handle, struct inode *orig_inode,
                mext_insert_inside_block(o_start, o_end, start_ext, new_ext,
                                                end_ext, eh, range_to_move);
 
-       if (depth) {
-               ret = ext4_handle_dirty_metadata(handle, orig_inode,
-                                                orig_path->p_bh);
-               if (ret)
-                       return ret;
-       } else {
-               ret = ext4_mark_inode_dirty(handle, orig_inode);
-               if (ret < 0)
-                       return ret;
-       }
-
-       return 0;
+       return ext4_ext_dirty(handle, orig_inode, orig_path);
 }
 
 /**