@@ -1665,7 +1665,6 @@ int ext4_ext_insert_extent(handle_t *handle, struct inode *inode,
struct ext4_ext_path *npath = NULL;
int depth, len, err;
ext4_lblk_t next;
- unsigned uninitialized = 0;
int flags = 0;
if (unlikely(ext4_ext_get_actual_len(newext) == 0)) {
@@ -1698,11 +1697,9 @@ int ext4_ext_insert_extent(handle_t *handle, struct inode *inode,
* both extents are uninitialized, or both aren't. Thus we
* need to check only one of them here.
*/
- if (ext4_ext_is_uninitialized(ex))
- uninitialized = 1;
ex->ee_len = cpu_to_le16(ext4_ext_get_actual_len(ex)
+ ext4_ext_get_actual_len(newext));
- if (uninitialized)
+ if (ext4_ext_is_uninitialized(newext))
ext4_ext_mark_uninitialized(ex);
eh = path[depth].p_hdr;
nearex = ex;
Var(uninitialized) is not necessary. As the comment says, two extent are either initialized or uninitialized. So checking newext is ok. Signed-off-by: Yongqiang Yang <xiaoqiangnk@gmail.com> --- fs/ext4/extents.c | 5 +---- 1 files changed, 1 insertions(+), 4 deletions(-)