Alex Tomas wrote:

Amit K Arora (AKA) writes:


 AKA> @@ -1984,6 +2034,10 @@ int ext4_ext_get_blocks(handle_t *handle
 AKA>                 */
 AKA>                if (ee_len > EXT_MAX_LEN)
 AKA>                        goto out2;
 AKA> +
 AKA> +              if (iblock < ee_block && iblock + max_blocks >= ee_block)
 AKA> +                      allocated = ee_block - iblock;
 AKA> +
 AKA>                /* if found extent covers block, simply return it */
 AKA>                if (iblock >= ee_block && iblock < ee_block + ee_len) {
 AKA>                        newblock = iblock - ee_block + ee_start;

I thought existing code already does this:

        /* if found extent covers block, simply return it */
        if (iblock >= ee_block && iblock < ee_block + ee_len) {
                newblock = iblock - ee_block + ee_start;
                /* number of remaining blocks in the extent */
                allocated = ee_len - (iblock - ee_block);


thanks, Alex
That's different: the existing code address the case when the left part of the new extent overlaps with an exisitng extent, in that case I understand it just returns the allocated part of extent, and continue the block allocation in the next call of get_blocks().

Well Amit's new code here trying to address the case when the right part of the new extent overlap with an exisitng extent. He was trying to update the new extent length to prevent that. As I mentioned ealier we could put this code into ext4_ext_check_overlap,let it judge whether there is overlap, and if so, what's the right start block number and length

Thanks,
Mingming

-
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to