From: Theodore Ts'o Date: Tue, 4 Nov 2014 16:46:55 +0000 (-0500) Subject: Merge branch 'maint' into next X-Git-Tag: v1.43-WIP-2015-05-18~145 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dfa667dab663b0fb24cbd20e8374023a923db1a6;p=thirdparty%2Fe2fsprogs.git Merge branch 'maint' into next Conflicts: lib/ext2fs/dir_iterate.c --- dfa667dab663b0fb24cbd20e8374023a923db1a6 diff --cc lib/ext2fs/dir_iterate.c index 67152cc7f,0744ee859..9063c173f --- a/lib/ext2fs/dir_iterate.c +++ b/lib/ext2fs/dir_iterate.c @@@ -205,24 -198,11 +205,24 @@@ int ext2fs_process_dir_block(ext2_filsy entry = blockcnt ? DIRENT_OTHER_FILE : DIRENT_DOT_FILE; - ctx->errcode = ext2fs_read_dir_block3(fs, *blocknr, ctx->buf, 0); - if (ctx->errcode) - return BLOCK_ABORT; + /* If a dir has inline data, we don't need to read block */ + inline_data = !!(ctx->flags & DIRENT_FLAG_INCLUDE_INLINE_DATA); + if (!inline_data) { + ctx->errcode = ext2fs_read_dir_block4(fs, *blocknr, ctx->buf, 0, + ctx->dir); + if (ctx->errcode) + return BLOCK_ABORT; + /* If we handle a normal dir, we traverse the entire block */ + buflen = fs->blocksize; + } else { + buflen = ctx->buflen; + } + + if (EXT2_HAS_RO_COMPAT_FEATURE(fs->super, + EXT4_FEATURE_RO_COMPAT_METADATA_CSUM)) + csum_size = sizeof(struct ext2_dir_entry_tail); - while (offset < buflen) { - while (offset < fs->blocksize - 8) { ++ while (offset < buflen - 8) { dirent = (struct ext2_dir_entry *) (ctx->buf + offset); if (ext2fs_get_rec_len(fs, dirent, &rec_len)) return BLOCK_ABORT;