Skip to content

Commit

Permalink
ext4: mext_insert_extents should update extent block checksum
Browse files Browse the repository at this point in the history
Signed-off-by: Darrick J. Wong <[email protected]>
Signed-off-by: "Theodore Ts'o" <[email protected]>
  • Loading branch information
djwong authored and tytso committed Apr 19, 2013
1 parent eb9cc7e commit 2656497
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 17 deletions.
5 changes: 5 additions & 0 deletions fs/ext4/ext4_extents.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

7 changes: 2 additions & 5 deletions fs/ext4/extents.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
13 changes: 1 addition & 12 deletions fs/ext4/move_extent.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit 2656497

Please sign in to comment.