> @@ -490,6 +491,31 @@ __read_extent_tree_block(const char *function, unsigned int line, > if (err) > goto errout; > set_buffer_verified(bh); > + /* > + * If this is a leaf block, cache all of its entries > + */ > + if (!(flags & EXT4_EX_NOCACHE) && depth == 0) { > + struct ext4_extent_header *eh = ext_block_hdr(bh); > + struct ext4_extent *ex = EXT_FIRST_EXTENT(eh); > + int i; > + > + for (i = eh->eh_entries; i > 0; i--, ex++) { > + unsigned int status = EXTENT_STATUS_WRITTEN; > + ext4_lblk_t prev = 0, lblk = le32_to_cpu(ex->ee_block); > + int len = ext4_ext_get_actual_len(ex); > + > + if (prev && (prev != lblk)) > + ext4_es_cache_extent(inode, prev, > + lblk - prev, ~0, > + EXTENT_STATUS_HOLE); > + > + if (ext4_ext_is_uninitialized(ex)) > + status = EXTENT_STATUS_UNWRITTEN; > + ext4_es_cache_extent(inode, lblk, len, > + ext4_ext_pblock(ex), status); > + prev = lblk + len; > + } > + } Isn't prev going to be reinitialized to 0 for every extent? - z -- 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