On Wed, 2006-12-06 at 11:28 +0530, Amit K. Arora wrote: > @@ -1142,13 +1155,22 @@ > /* try to insert block into found extent and return */ > if (ex && ext4_can_extents_be_merged(inode, ex, newext)) { > ext_debug("append %d block to %d:%d (from %llu)\n", > - le16_to_cpu(newext->ee_len), > + ext4_ext_get_actual_len(newext), > le32_to_cpu(ex->ee_block), > - le16_to_cpu(ex->ee_len), ext_pblock(ex)); > + ext4_ext_get_actual_len(ex), ext_pblock(ex)); > if ((err = ext4_ext_get_access(handle, inode, path + depth))) > return err; > - ex->ee_len = cpu_to_le16(le16_to_cpu(ex->ee_len) > - + le16_to_cpu(newext->ee_len)); > + > + /* ext4_can_extents_be_merged should have checked that either > + * both extents are uninitialized, or both aren't. Thus we > + * need to check any 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) > + ext4_mark_uninitialized_ext(ex); > eh = path[depth].p_hdr; > nearex = ex; > goto merge; Hmm, I missed the point to re-mark an uninitialized extent here. If ex is an uninitialized extent, the mark(the first bit the ee_len) shall still there after the update, isn't? We already make sure that two large uninitialized extent can't get merged if the resulting length will take the first bit, which used as the mark of uninitialized extent. - To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html