]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
Merge branch 'maint' into next
authorTheodore Ts'o <tytso@mit.edu>
Tue, 4 Nov 2014 16:46:55 +0000 (11:46 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 4 Nov 2014 16:46:55 +0000 (11:46 -0500)
Conflicts:
lib/ext2fs/dir_iterate.c

1  2 
lib/ext2fs/dir_iterate.c
lib/ext2fs/unix_io.c

index 67152cc7f6ea4a4777aeaa94b041abd37a0a4a05,0744ee859c47ccd4073b4f1ccd9b59f419681b24..9063c173f866d765a25ced1a0a08edfccb601562
@@@ -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;
Simple merge