From 3dc150e5359be1d3dc6ffc07283c848f87bcba45 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Tue, 28 Jul 2020 06:39:49 -0400 Subject: [PATCH] import e2fsprogs-1.45.6-1.el8 --- .e2fsprogs.metadata | 2 +- .gitignore | 2 +- ...ting-of-xattrs-with-ea_in_inode-valu.patch | 29 - ...inode_field-so-it-can-set-the-checks.patch | 244 --- ...gfs-remove-unused-variable-tmp_inode.patch | 28 - ...k-and-fix-tails-of-all-bitmap-blocks.patch | 568 ------- ...-potentially-ambiguous-dangling-else.patch | 35 - ...d-B-options-to-specify-where-to-find.patch | 187 --- ...xt2fs-add-ext2fs_-read-write-_inode2.patch | 162 -- ...2fs-remove-unused-variable-old_flags.patch | 28 - ...e-english-yes-character-to-the-proce.patch | 51 - ...s-1.45.6-Makefile.in-Disable-e2scrub.patch | 38 + ...nstall-fuse2fs-in-usr-bin-instead-of.patch | 45 + ...-hide-struct-ext2fs_hashmap-as-an-in.patch | 86 + ...-revamp-bitmap-types-to-fix-LTO-warn.patch | 1421 +++++++++++++++++ ...hange-in-the-struct_ext2_filsys-stru.patch | 51 + ...ut-RHEL8-supported-features-and-moun.patch | 133 ++ ...nf-Introduce-rhel6-and-rhel7-fs_type.patch | 34 + SPECS/e2fsprogs.spec | 37 +- 19 files changed, 1834 insertions(+), 1347 deletions(-) delete mode 100644 SOURCES/e2fsprogs-1.44.6-debugfs-fix-printing-of-xattrs-with-ea_in_inode-valu.patch delete mode 100644 SOURCES/e2fsprogs-1.44.6-debugfs-fix-set_inode_field-so-it-can-set-the-checks.patch delete mode 100644 SOURCES/e2fsprogs-1.44.6-debugfs-remove-unused-variable-tmp_inode.patch delete mode 100644 SOURCES/e2fsprogs-1.44.6-e2fsck-check-and-fix-tails-of-all-bitmap-blocks.patch delete mode 100644 SOURCES/e2fsprogs-1.44.6-e2fsck-remove-an-potentially-ambiguous-dangling-else.patch delete mode 100644 SOURCES/e2fsprogs-1.44.6-e2image-add-b-and-B-options-to-specify-where-to-find.patch delete mode 100644 SOURCES/e2fsprogs-1.44.6-libext2fs-add-ext2fs_-read-write-_inode2.patch delete mode 100644 SOURCES/e2fsprogs-1.44.6-libext2fs-remove-unused-variable-old_flags.patch delete mode 100644 SOURCES/e2fsprogs-1.44.6-mke2fs-accept-the-english-yes-character-to-the-proce.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-Makefile.in-Disable-e2scrub.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-Revert-fuse2fs-install-fuse2fs-in-usr-bin-instead-of.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-Revert-libext2fs-hide-struct-ext2fs_hashmap-as-an-in.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-Revert-libext2fs-revamp-bitmap-types-to-fix-LTO-warn.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-ext2fs-fix-ABI-change-in-the-struct_ext2_filsys-stru.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-man-Add-note-about-RHEL8-supported-features-and-moun.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-mke2fs.conf-Introduce-rhel6-and-rhel7-fs_type.patch diff --git a/.e2fsprogs.metadata b/.e2fsprogs.metadata index 1ed3849..9ef2a76 100644 --- a/.e2fsprogs.metadata +++ b/.e2fsprogs.metadata @@ -1 +1 @@ -132ecc3dd92b3ac9e488b7c8bbe2e769001856d1 SOURCES/e2fsprogs-1.44.6.tar.xz +41dd6234aa5c148bd06571e6be013a807b3af7a0 SOURCES/e2fsprogs-1.45.6.tar.xz diff --git a/.gitignore b/.gitignore index 5eda163..3a9f32e 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/e2fsprogs-1.44.6.tar.xz +SOURCES/e2fsprogs-1.45.6.tar.xz diff --git a/SOURCES/e2fsprogs-1.44.6-debugfs-fix-printing-of-xattrs-with-ea_in_inode-valu.patch b/SOURCES/e2fsprogs-1.44.6-debugfs-fix-printing-of-xattrs-with-ea_in_inode-valu.patch deleted file mode 100644 index ee2714b..0000000 --- a/SOURCES/e2fsprogs-1.44.6-debugfs-fix-printing-of-xattrs-with-ea_in_inode-valu.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 563d63dbf762c41f908b5e10deb1b115def93bcc Mon Sep 17 00:00:00 2001 -From: Theodore Ts'o -Date: Tue, 26 Mar 2019 09:36:53 -0400 -Subject: [PATCH 4/4] debugfs: fix printing of xattrs with ea_in_inode values - -Due to a missing "else" debugfs was printing (garbage) from the xattr -buffer which could potentially overrun the end of the buffer. - -Signed-off-by: Theodore Ts'o ---- - debugfs/xattrs.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/debugfs/xattrs.c b/debugfs/xattrs.c -index c29761ec..dde9af2f 100644 ---- a/debugfs/xattrs.c -+++ b/debugfs/xattrs.c -@@ -448,7 +448,7 @@ static void dump_xattr_raw_entries(FILE *f, unsigned char *buf, - else if (ent.e_value_offs >= len || - (vstart + ent.e_value_size) > len) - fprintf(f, ""); -- if (is_mostly_printable((char *)(buf + vstart), -+ else if (is_mostly_printable((char *)(buf + vstart), - ent.e_value_size)) - safe_print(f, (char *)(buf + vstart), - ent.e_value_size); --- -2.20.1 - diff --git a/SOURCES/e2fsprogs-1.44.6-debugfs-fix-set_inode_field-so-it-can-set-the-checks.patch b/SOURCES/e2fsprogs-1.44.6-debugfs-fix-set_inode_field-so-it-can-set-the-checks.patch deleted file mode 100644 index bf52317..0000000 --- a/SOURCES/e2fsprogs-1.44.6-debugfs-fix-set_inode_field-so-it-can-set-the-checks.patch +++ /dev/null @@ -1,244 +0,0 @@ -From 5862f45c314aaf97ce098add06c42b5d592dc984 Mon Sep 17 00:00:00 2001 -From: Theodore Ts'o -Date: Thu, 13 Dec 2018 00:53:16 -0500 -Subject: [PATCH 2/4] debugfs: fix set_inode_field so it can set the checksum - field - -Previously, setting the inode field was a no-op, since the library -function ext2fs_write_inode_full() would override whatever value was -set by debugfs. Use the new ext2fs_write_inode2() interface so we can -in fact set the checksum to a potentially wrong value. Also, ignore -the inode checksum failures if we are setting the checksum, and if the -checksum value is "calc", set the inode checksum to the correct value. - -Signed-off-by: Theodore Ts'o ---- - debugfs/debugfs.c | 12 +++---- - debugfs/debugfs.h | 8 ++--- - debugfs/set_fields.c | 84 +++++++++++++++++++++++++++++++++++++++----- - debugfs/util.c | 17 +++++---- - 4 files changed, 94 insertions(+), 27 deletions(-) - -diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c -index faae12da..06a93270 100644 ---- a/debugfs/debugfs.c -+++ b/debugfs/debugfs.c -@@ -985,8 +985,8 @@ void do_stat(int argc, char *argv[]) - return; - } - -- if (debugfs_read_inode_full(inode, inode_buf, argv[0], -- EXT2_INODE_SIZE(current_fs->super))) { -+ if (debugfs_read_inode2(inode, inode_buf, argv[0], -+ EXT2_INODE_SIZE(current_fs->super), 0)) { - free(inode_buf); - return; - } -@@ -1608,12 +1608,12 @@ void do_copy_inode(int argc, char *argv[]) - if (!dest_ino) - return; - -- if (debugfs_read_inode_full(src_ino, (struct ext2_inode *) buf, -- argv[0], sizeof(buf))) -+ if (debugfs_read_inode2(src_ino, (struct ext2_inode *) buf, -+ argv[0], sizeof(buf), 0)) - return; - -- if (debugfs_write_inode_full(dest_ino, (struct ext2_inode *) buf, -- argv[0], sizeof(buf))) -+ if (debugfs_write_inode2(dest_ino, (struct ext2_inode *) buf, -+ argv[0], sizeof(buf), 0)) - return; - } - -diff --git a/debugfs/debugfs.h b/debugfs/debugfs.h -index 93f036de..97fdde7e 100644 ---- a/debugfs/debugfs.h -+++ b/debugfs/debugfs.h -@@ -54,12 +54,12 @@ extern int common_block_args_process(int argc, char *argv[], - blk64_t *block, blk64_t *count); - extern int debugfs_read_inode(ext2_ino_t ino, struct ext2_inode * inode, - const char *cmd); --extern int debugfs_read_inode_full(ext2_ino_t ino, struct ext2_inode * inode, -- const char *cmd, int bufsize); -+extern int debugfs_read_inode2(ext2_ino_t ino, struct ext2_inode * inode, -+ const char *cmd, int bufsize, int flags); - extern int debugfs_write_inode(ext2_ino_t ino, struct ext2_inode * inode, - const char *cmd); --extern int debugfs_write_inode_full(ext2_ino_t ino, struct ext2_inode * inode, -- const char *cmd, int bufsize); -+extern int debugfs_write_inode2(ext2_ino_t ino, struct ext2_inode * inode, -+ const char *cmd, int bufsize, int flags); - extern int debugfs_write_new_inode(ext2_ino_t ino, struct ext2_inode * inode, - const char *cmd); - extern int ext2_file_type(unsigned int mode); -diff --git a/debugfs/set_fields.c b/debugfs/set_fields.c -index 3cdf617c..4f033249 100644 ---- a/debugfs/set_fields.c -+++ b/debugfs/set_fields.c -@@ -53,6 +53,7 @@ static int array_idx; - - #define FLAG_ARRAY 0x0001 - #define FLAG_ALIAS 0x0002 /* Data intersects with other field */ -+#define FLAG_CSUM 0x0004 - - struct field_set_info { - const char *name; -@@ -72,6 +73,8 @@ static errcode_t parse_hashalg(struct field_set_info *info, char *field, char *a - static errcode_t parse_time(struct field_set_info *info, char *field, char *arg); - static errcode_t parse_bmap(struct field_set_info *info, char *field, char *arg); - static errcode_t parse_gd_csum(struct field_set_info *info, char *field, char *arg); -+static errcode_t parse_inode_csum(struct field_set_info *info, char *field, -+ char *arg); - static errcode_t parse_mmp_clear(struct field_set_info *info, char *field, - char *arg); - -@@ -218,7 +221,7 @@ static struct field_set_info inode_fields[] = { - { "frag", &set_inode.osd2.hurd2.h_i_frag, NULL, 1, parse_uint, FLAG_ALIAS }, - { "fsize", &set_inode.osd2.hurd2.h_i_fsize, NULL, 1, parse_uint }, - { "checksum", &set_inode.osd2.linux2.l_i_checksum_lo, -- &set_inode.i_checksum_hi, 2, parse_uint }, -+ &set_inode.i_checksum_hi, 2, parse_inode_csum, FLAG_CSUM }, - { "author", &set_inode.osd2.hurd2.h_i_author, NULL, - 4, parse_uint, FLAG_ALIAS }, - { "extra_isize", &set_inode.i_extra_isize, NULL, -@@ -665,6 +668,68 @@ static errcode_t parse_gd_csum(struct field_set_info *info, char *field, - return parse_uint(info, field, arg); - } - -+static errcode_t parse_inode_csum(struct field_set_info *info, char *field, -+ char *arg) -+{ -+ errcode_t retval = 0; -+ __u32 crc; -+ int is_large_inode = 0; -+ struct ext2_inode_large *tmp_inode; -+ -+ if (strcmp(arg, "calc") == 0) { -+ size_t sz = EXT2_INODE_SIZE(current_fs->super); -+ struct ext2_inode_large *tmp_inode = NULL; -+ -+ retval = ext2fs_get_mem(sz, &tmp_inode); -+ if (retval) -+ goto out; -+ -+ retval = ext2fs_read_inode_full(current_fs, set_ino, -+ (struct ext2_inode *) tmp_inode, -+ sz); -+ if (retval) -+ goto out; -+ -+#ifdef WORDS_BIGENDIAN -+ ext2fs_swap_inode_full(current_fs, tmp_inode, -+ tmp_inode, 1, sz); -+#endif -+ -+ if (sz > EXT2_GOOD_OLD_INODE_SIZE) -+ is_large_inode = 1; -+ -+ retval = ext2fs_inode_csum_set(current_fs, set_ino, -+ tmp_inode); -+ if (retval) -+ goto out; -+#ifdef WORDS_BIGENDIAN -+ crc = set_inode.i_checksum_lo = -+ ext2fs_swab16(tmp_inode->i_checksum_lo); -+ -+#else -+ crc = set_inode.i_checksum_lo = tmp_inode->i_checksum_lo; -+#endif -+ if (is_large_inode && -+ set_inode.i_extra_isize >= -+ (offsetof(struct ext2_inode_large, -+ i_checksum_hi) - -+ EXT2_GOOD_OLD_INODE_SIZE)) { -+#ifdef WORDS_BIGENDIAN -+ set_inode.i_checksum_lo = -+ ext2fs_swab16(tmp_inode->i_checksum_lo); -+#else -+ set_inode.i_checksum_hi = tmp_inode->i_checksum_hi; -+#endif -+ crc |= ((__u32)set_inode.i_checksum_hi) << 16; -+ } -+ printf("Checksum set to 0x%08x\n", crc); -+ out: -+ ext2fs_free_mem(&tmp_inode); -+ return retval; -+ } -+ return parse_uint(info, field, arg); -+} -+ - static void print_possible_fields(struct field_set_info *fields) - { - struct field_set_info *ss; -@@ -775,16 +840,19 @@ void do_set_inode(int argc, char *argv[]) - if (!set_ino) - return; - -- if (debugfs_read_inode_full(set_ino, -- (struct ext2_inode *) &set_inode, argv[1], -- sizeof(set_inode))) -+ if (debugfs_read_inode2(set_ino, -+ (struct ext2_inode *) &set_inode, argv[1], -+ sizeof(set_inode), -+ (ss->flags & FLAG_CSUM) ? -+ READ_INODE_NOCSUM : 0)) - return; - - if (ss->func(ss, argv[2], argv[3]) == 0) { -- if (debugfs_write_inode_full(set_ino, -- (struct ext2_inode *) &set_inode, -- argv[1], sizeof(set_inode))) -- return; -+ debugfs_write_inode2(set_ino, -+ (struct ext2_inode *) &set_inode, -+ argv[1], sizeof(set_inode), -+ (ss->flags & FLAG_CSUM) ? -+ WRITE_INODE_NOCSUM : 0); - } - } - -diff --git a/debugfs/util.c b/debugfs/util.c -index 452de749..759bb392 100644 ---- a/debugfs/util.c -+++ b/debugfs/util.c -@@ -420,12 +420,12 @@ int common_block_args_process(int argc, char *argv[], - return 0; - } - --int debugfs_read_inode_full(ext2_ino_t ino, struct ext2_inode * inode, -- const char *cmd, int bufsize) -+int debugfs_read_inode2(ext2_ino_t ino, struct ext2_inode * inode, -+ const char *cmd, int bufsize, int flags) - { - int retval; - -- retval = ext2fs_read_inode_full(current_fs, ino, inode, bufsize); -+ retval = ext2fs_read_inode2(current_fs, ino, inode, bufsize, flags); - if (retval) { - com_err(cmd, retval, "while reading inode %u", ino); - return 1; -@@ -446,15 +446,14 @@ int debugfs_read_inode(ext2_ino_t ino, struct ext2_inode * inode, - return 0; - } - --int debugfs_write_inode_full(ext2_ino_t ino, -- struct ext2_inode *inode, -- const char *cmd, -- int bufsize) -+int debugfs_write_inode2(ext2_ino_t ino, -+ struct ext2_inode *inode, -+ const char *cmd, -+ int bufsize, int flags) - { - int retval; - -- retval = ext2fs_write_inode_full(current_fs, ino, -- inode, bufsize); -+ retval = ext2fs_write_inode2(current_fs, ino, inode, bufsize, flags); - if (retval) { - com_err(cmd, retval, "while writing inode %u", ino); - return 1; --- -2.20.1 - diff --git a/SOURCES/e2fsprogs-1.44.6-debugfs-remove-unused-variable-tmp_inode.patch b/SOURCES/e2fsprogs-1.44.6-debugfs-remove-unused-variable-tmp_inode.patch deleted file mode 100644 index 5fec653..0000000 --- a/SOURCES/e2fsprogs-1.44.6-debugfs-remove-unused-variable-tmp_inode.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 68c586c2b58cfb1677a1b37f6e55025d905228ed Mon Sep 17 00:00:00 2001 -From: Eric Biggers -Date: Sun, 28 Apr 2019 20:37:21 -0400 -Subject: [PATCH 1/4] debugfs: remove unused variable 'tmp_inode' - -In parse_inode_csum(), the outer 'tmp_inode' variable is never used. - -Signed-off-by: Eric Biggers -Signed-off-by: Theodore Ts'o ---- - debugfs/set_fields.c | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/debugfs/set_fields.c b/debugfs/set_fields.c -index 4f033249..9cf8c735 100644 ---- a/debugfs/set_fields.c -+++ b/debugfs/set_fields.c -@@ -674,7 +674,6 @@ static errcode_t parse_inode_csum(struct field_set_info *info, char *field, - errcode_t retval = 0; - __u32 crc; - int is_large_inode = 0; -- struct ext2_inode_large *tmp_inode; - - if (strcmp(arg, "calc") == 0) { - size_t sz = EXT2_INODE_SIZE(current_fs->super); --- -2.20.1 - diff --git a/SOURCES/e2fsprogs-1.44.6-e2fsck-check-and-fix-tails-of-all-bitmap-blocks.patch b/SOURCES/e2fsprogs-1.44.6-e2fsck-check-and-fix-tails-of-all-bitmap-blocks.patch deleted file mode 100644 index 3b3064f..0000000 --- a/SOURCES/e2fsprogs-1.44.6-e2fsck-check-and-fix-tails-of-all-bitmap-blocks.patch +++ /dev/null @@ -1,568 +0,0 @@ -From 6e44ff6678a96b2bc5ddc42c5bf2cbad09b71af2 Mon Sep 17 00:00:00 2001 -From: Theodore Ts'o -Date: Sun, 5 May 2019 16:43:33 -0400 -Subject: [PATCH 3/4] e2fsck: check and fix tails of all bitmap blocks - -Currently, e2fsck effectively checks only tail of the last inode and -block bitmap in the filesystem. Thus if some previous bitmap has unset -bits it goes unnoticed. Mostly these tail bits in the bitmap are -ignored; however, if blocks_per_group are smaller than 8*blocksize, -the multi-block allocator in the kernel can get confused when the tail -bits are unset and return bogus free extent. - -Add support to libext2fs to check these bitmap tails when loading -bitmaps (as that's about the only place which has access to the bitmap -tail bits) and make e2fsck use this functionality to detect buggy bitmap -tails and fix them (by rewriting the bitmaps). - -Reported-by: Jan Kara -Signed-off-by: Theodore Ts'o -Reviewed-by: Jan Kara ---- - e2fsck/pass5.c | 40 ++++++++++++++++--- - lib/ext2fs/ext2fs.h | 2 + - lib/ext2fs/rw_bitmaps.c | 26 +++++++++++- - tests/f_bitmaps/expect.1 | 2 + - tests/f_dup/expect.1 | 2 + - tests/f_dup2/expect.1 | 2 + - tests/f_dup3/expect.1 | 2 + - tests/f_end-bitmap/expect.1 | 2 + - tests/f_illbbitmap/expect.1 | 2 + - tests/f_illibitmap/expect.1 | 2 + - tests/f_illitable_flexbg/expect.1 | 2 + - tests/f_lpf/expect.1 | 2 + - tests/f_overfsblks/expect.1 | 2 + - tests/f_super_bad_csum/expect.1 | 4 +- - tests/j_corrupt_ext_jnl_sb_csum/expect | 2 + - tests/j_ext_long_trans/expect | 2 + - tests/j_long_trans/expect | 2 + - tests/j_long_trans_mcsum_32bit/expect | 2 + - tests/j_long_trans_mcsum_64bit/expect | 2 + - tests/j_recover_csum2_32bit/expect.1 | 2 + - tests/j_recover_csum2_64bit/expect.1 | 2 + - tests/j_short_trans/expect | 2 + - tests/j_short_trans_64bit/expect | 2 + - tests/j_short_trans_mcsum_64bit/expect | 2 + - tests/j_short_trans_old_csum/expect | 2 + - tests/j_short_trans_open_recover/expect | 2 + - tests/j_short_trans_recover/expect | 2 + - .../j_short_trans_recover_mcsum_64bit/expect | 2 + - tests/t_replay_and_set/expect | 2 + - 29 files changed, 113 insertions(+), 9 deletions(-) - -diff --git a/e2fsck/pass5.c b/e2fsck/pass5.c -index 7803e8b8..81009097 100644 ---- a/e2fsck/pass5.c -+++ b/e2fsck/pass5.c -@@ -838,6 +838,7 @@ static void check_inode_end(e2fsck_t ctx) - ext2_filsys fs = ctx->fs; - ext2_ino_t end, save_inodes_count, i; - struct problem_context pctx; -+ int asked = 0; - - clear_problem_context(&pctx); - -@@ -851,11 +852,12 @@ static void check_inode_end(e2fsck_t ctx) - return; - } - if (save_inodes_count == end) -- return; -+ goto check_intra_bg_tail; - - /* protect loop from wrap-around if end is maxed */ - for (i = save_inodes_count + 1; i <= end && i > save_inodes_count; i++) { - if (!ext2fs_test_inode_bitmap(fs->inode_map, i)) { -+ asked = 1; - if (fix_problem(ctx, PR_5_INODE_BMAP_PADDING, &pctx)) { - for (; i <= end; i++) - ext2fs_mark_inode_bitmap(fs->inode_map, -@@ -875,6 +877,20 @@ static void check_inode_end(e2fsck_t ctx) - ctx->flags |= E2F_FLAG_ABORT; /* fatal */ - return; - } -+ /* -+ * If the number of inodes per block group != blocksize, we -+ * can also have a potential problem with the tail bits in -+ * each individual inode bitmap block. If there is a problem, -+ * it would have been noticed when the bitmap was loaded. And -+ * fixing this is easy; all we need to do force the bitmap to -+ * be written back to disk. -+ */ -+check_intra_bg_tail: -+ if (!asked && fs->flags & EXT2_FLAG_IBITMAP_TAIL_PROBLEM) -+ if (fix_problem(ctx, PR_5_INODE_BMAP_PADDING, &pctx)) -+ ext2fs_mark_ib_dirty(fs); -+ else -+ ext2fs_unmark_valid(fs); - } - - static void check_block_end(e2fsck_t ctx) -@@ -882,6 +898,7 @@ static void check_block_end(e2fsck_t ctx) - ext2_filsys fs = ctx->fs; - blk64_t end, save_blocks_count, i; - struct problem_context pctx; -+ int asked = 0; - - clear_problem_context(&pctx); - -@@ -896,12 +913,13 @@ static void check_block_end(e2fsck_t ctx) - return; - } - if (save_blocks_count == end) -- return; -+ goto check_intra_bg_tail; - - /* Protect loop from wrap-around if end is maxed */ - for (i = save_blocks_count + 1; i <= end && i > save_blocks_count; i++) { - if (!ext2fs_test_block_bitmap2(fs->block_map, - EXT2FS_C2B(fs, i))) { -+ asked = 1; - if (fix_problem(ctx, PR_5_BLOCK_BMAP_PADDING, &pctx)) { - for (; i <= end; i++) - ext2fs_mark_block_bitmap2(fs->block_map, -@@ -921,7 +939,19 @@ static void check_block_end(e2fsck_t ctx) - ctx->flags |= E2F_FLAG_ABORT; /* fatal */ - return; - } -+ /* -+ * If the number of blocks per block group != blocksize, we -+ * can also have a potential problem with the tail bits in -+ * each individual block bitmap block. If there is a problem, -+ * it would have been noticed when the bitmap was loaded. And -+ * fixing this is easy; all we need to do force the bitmap to -+ * be written back to disk. -+ */ -+check_intra_bg_tail: -+ if (!asked && fs->flags & EXT2_FLAG_BBITMAP_TAIL_PROBLEM) { -+ if (fix_problem(ctx, PR_5_BLOCK_BMAP_PADDING, &pctx)) -+ ext2fs_mark_bb_dirty(fs); -+ else -+ ext2fs_unmark_valid(fs); -+ } - } -- -- -- -diff --git a/lib/ext2fs/ext2fs.h b/lib/ext2fs/ext2fs.h -index 96735c8e..285eb5e1 100644 ---- a/lib/ext2fs/ext2fs.h -+++ b/lib/ext2fs/ext2fs.h -@@ -199,6 +199,8 @@ typedef struct ext2_file *ext2_file_t; - #define EXT2_FLAG_IGNORE_CSUM_ERRORS 0x200000 - #define EXT2_FLAG_SHARE_DUP 0x400000 - #define EXT2_FLAG_IGNORE_SB_ERRORS 0x800000 -+#define EXT2_FLAG_BBITMAP_TAIL_PROBLEM 0x1000000 -+#define EXT2_FLAG_IBITMAP_TAIL_PROBLEM 0x2000000 - - /* - * Special flag in the ext2 inode i_flag field that means that this is -diff --git a/lib/ext2fs/rw_bitmaps.c b/lib/ext2fs/rw_bitmaps.c -index e86bacd5..f1c4188b 100644 ---- a/lib/ext2fs/rw_bitmaps.c -+++ b/lib/ext2fs/rw_bitmaps.c -@@ -195,6 +195,16 @@ static errcode_t mark_uninit_bg_group_blocks(ext2_filsys fs) - return 0; - } - -+static int bitmap_tail_verify(unsigned char *bitmap, int first, int last) -+{ -+ int i; -+ -+ for (i = first; i <= last; i++) -+ if (bitmap[i] != 0xff) -+ return 0; -+ return 1; -+} -+ - static errcode_t read_bitmaps(ext2_filsys fs, int do_inode, int do_block) - { - dgrp_t i; -@@ -203,6 +213,7 @@ static errcode_t read_bitmaps(ext2_filsys fs, int do_inode, int do_block) - errcode_t retval; - int block_nbytes = EXT2_CLUSTERS_PER_GROUP(fs->super) / 8; - int inode_nbytes = EXT2_INODES_PER_GROUP(fs->super) / 8; -+ int tail_flags = 0; - int csum_flag; - unsigned int cnt; - blk64_t blk; -@@ -315,6 +326,9 @@ static errcode_t read_bitmaps(ext2_filsys fs, int do_inode, int do_block) - EXT2_ET_BLOCK_BITMAP_CSUM_INVALID; - goto cleanup; - } -+ if (!bitmap_tail_verify((unsigned char *) block_bitmap, -+ block_nbytes, fs->blocksize - 1)) -+ tail_flags |= EXT2_FLAG_BBITMAP_TAIL_PROBLEM; - } else - memset(block_bitmap, 0, block_nbytes); - cnt = block_nbytes << 3; -@@ -347,6 +361,9 @@ static errcode_t read_bitmaps(ext2_filsys fs, int do_inode, int do_block) - EXT2_ET_INODE_BITMAP_CSUM_INVALID; - goto cleanup; - } -+ if (!bitmap_tail_verify((unsigned char *) inode_bitmap, -+ inode_nbytes, fs->blocksize - 1)) -+ tail_flags |= EXT2_FLAG_IBITMAP_TAIL_PROBLEM; - } else - memset(inode_bitmap, 0, inode_nbytes); - cnt = inode_nbytes << 3; -@@ -366,10 +383,15 @@ static errcode_t read_bitmaps(ext2_filsys fs, int do_inode, int do_block) - } - - success_cleanup: -- if (inode_bitmap) -+ if (inode_bitmap) { - ext2fs_free_mem(&inode_bitmap); -- if (block_bitmap) -+ fs->flags &= ~EXT2_FLAG_IBITMAP_TAIL_PROBLEM; -+ } -+ if (block_bitmap) { - ext2fs_free_mem(&block_bitmap); -+ fs->flags &= ~EXT2_FLAG_BBITMAP_TAIL_PROBLEM; -+ } -+ fs->flags |= tail_flags; - return 0; - - cleanup: -diff --git a/tests/f_bitmaps/expect.1 b/tests/f_bitmaps/expect.1 -index 715984d4..2e91113d 100644 ---- a/tests/f_bitmaps/expect.1 -+++ b/tests/f_bitmaps/expect.1 -@@ -11,6 +11,8 @@ Fix? yes - Inode bitmap differences: +11 -15 - Fix? yes - -+Padding at end of inode bitmap is not set. Fix? yes -+ - - test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** - test_filesys: 11/32 files (9.1% non-contiguous), 22/100 blocks -diff --git a/tests/f_dup/expect.1 b/tests/f_dup/expect.1 -index 075e62c1..635a0dfc 100644 ---- a/tests/f_dup/expect.1 -+++ b/tests/f_dup/expect.1 -@@ -30,6 +30,8 @@ Fix? yes - Free blocks count wrong (62, counted=60). - Fix? yes - -+Padding at end of inode bitmap is not set. Fix? yes -+ - Padding at end of block bitmap is not set. Fix? yes - - -diff --git a/tests/f_dup2/expect.1 b/tests/f_dup2/expect.1 -index 69aa21b4..04d7304b 100644 ---- a/tests/f_dup2/expect.1 -+++ b/tests/f_dup2/expect.1 -@@ -37,6 +37,8 @@ Fix? yes - Free blocks count wrong (26, counted=22). - Fix? yes - -+Padding at end of inode bitmap is not set. Fix? yes -+ - Padding at end of block bitmap is not set. Fix? yes - - -diff --git a/tests/f_dup3/expect.1 b/tests/f_dup3/expect.1 -index eab75a8d..5f79cb89 100644 ---- a/tests/f_dup3/expect.1 -+++ b/tests/f_dup3/expect.1 -@@ -39,6 +39,8 @@ Fix? yes - Free blocks count wrong (20, counted=19). - Fix? yes - -+Padding at end of inode bitmap is not set. Fix? yes -+ - - test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** - test_filesys: 16/16 files (25.0% non-contiguous), 81/100 blocks -diff --git a/tests/f_end-bitmap/expect.1 b/tests/f_end-bitmap/expect.1 -index 87e2fd64..85c7e67f 100644 ---- a/tests/f_end-bitmap/expect.1 -+++ b/tests/f_end-bitmap/expect.1 -@@ -8,6 +8,8 @@ Pass 5: Checking group summary information - Free blocks count wrong for group #0 (44, counted=63). - Fix? yes - -+Padding at end of inode bitmap is not set. Fix? yes -+ - Padding at end of block bitmap is not set. Fix? yes - - -diff --git a/tests/f_illbbitmap/expect.1 b/tests/f_illbbitmap/expect.1 -index 8746d23a..40996cd6 100644 ---- a/tests/f_illbbitmap/expect.1 -+++ b/tests/f_illbbitmap/expect.1 -@@ -22,6 +22,8 @@ Fix? yes - Inode bitmap differences: -(12--21) - Fix? yes - -+Padding at end of inode bitmap is not set. Fix? yes -+ - - test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** - test_filesys: 11/32 files (0.0% non-contiguous), 22/100 blocks -diff --git a/tests/f_illibitmap/expect.1 b/tests/f_illibitmap/expect.1 -index 5bae25d1..bf21df7a 100644 ---- a/tests/f_illibitmap/expect.1 -+++ b/tests/f_illibitmap/expect.1 -@@ -19,6 +19,8 @@ Pass 5: Checking group summary information - Inode bitmap differences: +(1--11) - Fix? yes - -+Padding at end of inode bitmap is not set. Fix? yes -+ - - test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** - test_filesys: 11/32 files (0.0% non-contiguous), 22/100 blocks -diff --git a/tests/f_illitable_flexbg/expect.1 b/tests/f_illitable_flexbg/expect.1 -index fa42a0f8..4ac12463 100644 ---- a/tests/f_illitable_flexbg/expect.1 -+++ b/tests/f_illitable_flexbg/expect.1 -@@ -18,6 +18,8 @@ Pass 5: Checking group summary information - Inode bitmap differences: -(65--128) - Fix? yes - -+Padding at end of inode bitmap is not set. Fix? yes -+ - - test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** - test_filesys: 12/256 files (0.0% non-contiguous), 31163/32768 blocks -diff --git a/tests/f_lpf/expect.1 b/tests/f_lpf/expect.1 -index 4f2853c5..6ef996bb 100644 ---- a/tests/f_lpf/expect.1 -+++ b/tests/f_lpf/expect.1 -@@ -42,6 +42,8 @@ Fix? yes - Free inodes count wrong (1, counted=0). - Fix? yes - -+Padding at end of inode bitmap is not set. Fix? yes -+ - - test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** - test_filesys: 16/16 files (12.5% non-contiguous), 67/100 blocks -diff --git a/tests/f_overfsblks/expect.1 b/tests/f_overfsblks/expect.1 -index e5b93f0d..bc8f2a87 100644 ---- a/tests/f_overfsblks/expect.1 -+++ b/tests/f_overfsblks/expect.1 -@@ -13,6 +13,8 @@ Pass 5: Checking group summary information - Inode bitmap differences: -(12--21) - Fix? yes - -+Padding at end of inode bitmap is not set. Fix? yes -+ - - test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** - test_filesys: 11/32 files (0.0% non-contiguous), 22/100 blocks -diff --git a/tests/f_super_bad_csum/expect.1 b/tests/f_super_bad_csum/expect.1 -index 25ced5c8..12adee97 100644 ---- a/tests/f_super_bad_csum/expect.1 -+++ b/tests/f_super_bad_csum/expect.1 -@@ -5,8 +5,8 @@ Pass 2: Checking directory structure - Pass 3: Checking directory connectivity - Pass 4: Checking reference counts - Pass 5: Checking group summary information --Inode bitmap differences: Group 1 inode bitmap does not match checksum. --FIXED. -+Padding at end of inode bitmap is not set. Fix? yes -+ - - test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** - test_filesys: 11/1024 files (0.0% non-contiguous), 1557/16384 blocks -diff --git a/tests/j_corrupt_ext_jnl_sb_csum/expect b/tests/j_corrupt_ext_jnl_sb_csum/expect -index 70a4fe72..4212a000 100644 ---- a/tests/j_corrupt_ext_jnl_sb_csum/expect -+++ b/tests/j_corrupt_ext_jnl_sb_csum/expect -@@ -12,6 +12,8 @@ Fix? yes - Inode bitmap differences: +(1--11) - Fix? yes - -+Padding at end of inode bitmap is not set. Fix? yes -+ - - test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** - test_filesys: 11/128 files (0.0% non-contiguous), 66/2048 blocks -diff --git a/tests/j_ext_long_trans/expect b/tests/j_ext_long_trans/expect -index d379610e..ea3c87fc 100644 ---- a/tests/j_ext_long_trans/expect -+++ b/tests/j_ext_long_trans/expect -@@ -98,6 +98,8 @@ Fix? yes - Free inodes count wrong (16372, counted=16373). - Fix? yes - -+Padding at end of inode bitmap is not set. Fix? yes -+ - - test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** - test_filesys: 11/16384 files (0.0% non-contiguous), 6228/262144 blocks -diff --git a/tests/j_long_trans/expect b/tests/j_long_trans/expect -index 7a175414..82b3caf1 100644 ---- a/tests/j_long_trans/expect -+++ b/tests/j_long_trans/expect -@@ -96,6 +96,8 @@ Fix? yes - Free inodes count wrong (16372, counted=16373). - Fix? yes - -+Padding at end of inode bitmap is not set. Fix? yes -+ - Recreate journal? yes - - Creating journal (8192 blocks): Done. -diff --git a/tests/j_long_trans_mcsum_32bit/expect b/tests/j_long_trans_mcsum_32bit/expect -index a808d9f4..ffae07a6 100644 ---- a/tests/j_long_trans_mcsum_32bit/expect -+++ b/tests/j_long_trans_mcsum_32bit/expect -@@ -135,6 +135,8 @@ Fix? yes - Free inodes count wrong (32756, counted=32757). - Fix? yes - -+Padding at end of inode bitmap is not set. Fix? yes -+ - Recreate journal? yes - - Creating journal (16384 blocks): Done. -diff --git a/tests/j_long_trans_mcsum_64bit/expect b/tests/j_long_trans_mcsum_64bit/expect -index 76e109a4..e891def1 100644 ---- a/tests/j_long_trans_mcsum_64bit/expect -+++ b/tests/j_long_trans_mcsum_64bit/expect -@@ -134,6 +134,8 @@ Fix? yes - Free inodes count wrong (32756, counted=32757). - Fix? yes - -+Padding at end of inode bitmap is not set. Fix? yes -+ - Recreate journal? yes - - Creating journal (16384 blocks): Done. -diff --git a/tests/j_recover_csum2_32bit/expect.1 b/tests/j_recover_csum2_32bit/expect.1 -index 491784a2..fdbda36e 100644 ---- a/tests/j_recover_csum2_32bit/expect.1 -+++ b/tests/j_recover_csum2_32bit/expect.1 -@@ -10,6 +10,8 @@ Fix? yes - Inode bitmap differences: +(1--11) - Fix? yes - -+Padding at end of inode bitmap is not set. Fix? yes -+ - - test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** - test_filesys: 11/8192 files (0.0% non-contiguous), 7739/131072 blocks -diff --git a/tests/j_recover_csum2_64bit/expect.1 b/tests/j_recover_csum2_64bit/expect.1 -index 491784a2..fdbda36e 100644 ---- a/tests/j_recover_csum2_64bit/expect.1 -+++ b/tests/j_recover_csum2_64bit/expect.1 -@@ -10,6 +10,8 @@ Fix? yes - Inode bitmap differences: +(1--11) - Fix? yes - -+Padding at end of inode bitmap is not set. Fix? yes -+ - - test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** - test_filesys: 11/8192 files (0.0% non-contiguous), 7739/131072 blocks -diff --git a/tests/j_short_trans/expect b/tests/j_short_trans/expect -index bcc8fe82..2bd0e506 100644 ---- a/tests/j_short_trans/expect -+++ b/tests/j_short_trans/expect -@@ -32,6 +32,8 @@ Fix? yes - Inode bitmap differences: +(1--11) - Fix? yes - -+Padding at end of inode bitmap is not set. Fix? yes -+ - - test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** - test_filesys: 11/16384 files (0.0% non-contiguous), 5164/65536 blocks -diff --git a/tests/j_short_trans_64bit/expect b/tests/j_short_trans_64bit/expect -index f9971eba..808dc61d 100644 ---- a/tests/j_short_trans_64bit/expect -+++ b/tests/j_short_trans_64bit/expect -@@ -34,6 +34,8 @@ Fix? yes - Inode bitmap differences: +(1--11) - Fix? yes - -+Padding at end of inode bitmap is not set. Fix? yes -+ - - test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** - test_filesys: 11/16384 files (0.0% non-contiguous), 5196/65536 blocks -diff --git a/tests/j_short_trans_mcsum_64bit/expect b/tests/j_short_trans_mcsum_64bit/expect -index d876ff09..d73e2829 100644 ---- a/tests/j_short_trans_mcsum_64bit/expect -+++ b/tests/j_short_trans_mcsum_64bit/expect -@@ -34,6 +34,8 @@ Fix? yes - Inode bitmap differences: +(1--11) - Fix? yes - -+Padding at end of inode bitmap is not set. Fix? yes -+ - - test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** - test_filesys: 11/32768 files (0.0% non-contiguous), 6353/131072 blocks -diff --git a/tests/j_short_trans_old_csum/expect b/tests/j_short_trans_old_csum/expect -index 29ac27fb..6cf06d4a 100644 ---- a/tests/j_short_trans_old_csum/expect -+++ b/tests/j_short_trans_old_csum/expect -@@ -34,6 +34,8 @@ Fix? yes - Inode bitmap differences: +(1--11) - Fix? yes - -+Padding at end of inode bitmap is not set. Fix? yes -+ - - test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** - test_filesys: 11/16384 files (0.0% non-contiguous), 5164/65536 blocks -diff --git a/tests/j_short_trans_open_recover/expect b/tests/j_short_trans_open_recover/expect -index be6e363d..3e868197 100644 ---- a/tests/j_short_trans_open_recover/expect -+++ b/tests/j_short_trans_open_recover/expect -@@ -37,6 +37,8 @@ Fix? yes - Inode bitmap differences: +(1--11) - Fix? yes - -+Padding at end of inode bitmap is not set. Fix? yes -+ - - test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** - test_filesys: 11/16384 files (0.0% non-contiguous), 5164/65536 blocks -diff --git a/tests/j_short_trans_recover/expect b/tests/j_short_trans_recover/expect -index 75867337..508858c9 100644 ---- a/tests/j_short_trans_recover/expect -+++ b/tests/j_short_trans_recover/expect -@@ -34,6 +34,8 @@ Fix? yes - Inode bitmap differences: +(1--11) - Fix? yes - -+Padding at end of inode bitmap is not set. Fix? yes -+ - - test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** - test_filesys: 11/16384 files (0.0% non-contiguous), 5164/65536 blocks -diff --git a/tests/j_short_trans_recover_mcsum_64bit/expect b/tests/j_short_trans_recover_mcsum_64bit/expect -index 9cc33097..8c637f12 100644 ---- a/tests/j_short_trans_recover_mcsum_64bit/expect -+++ b/tests/j_short_trans_recover_mcsum_64bit/expect -@@ -36,6 +36,8 @@ Fix? yes - Inode bitmap differences: +(1--11) - Fix? yes - -+Padding at end of inode bitmap is not set. Fix? yes -+ - - test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** - test_filesys: 11/32768 files (0.0% non-contiguous), 6353/131072 blocks -diff --git a/tests/t_replay_and_set/expect b/tests/t_replay_and_set/expect -index f63a73af..3e19d92e 100644 ---- a/tests/t_replay_and_set/expect -+++ b/tests/t_replay_and_set/expect -@@ -30,6 +30,8 @@ Fix? yes - Inode bitmap differences: +(1--11) - Fix? yes - -+Padding at end of inode bitmap is not set. Fix? yes -+ - - test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** - test_filesys: 11/16384 files (0.0% non-contiguous), 5164/65536 blocks --- -2.20.1 - diff --git a/SOURCES/e2fsprogs-1.44.6-e2fsck-remove-an-potentially-ambiguous-dangling-else.patch b/SOURCES/e2fsprogs-1.44.6-e2fsck-remove-an-potentially-ambiguous-dangling-else.patch deleted file mode 100644 index 1879307..0000000 --- a/SOURCES/e2fsprogs-1.44.6-e2fsck-remove-an-potentially-ambiguous-dangling-else.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 90557d26c6282e8171b422966860eb5594b82eb5 Mon Sep 17 00:00:00 2001 -From: Theodore Ts'o -Date: Fri, 10 May 2019 19:21:03 -0400 -Subject: [PATCH 4/4] e2fsck: remove an potentially ambiguous dangling else - clause - -This doesn't actually fix a bug or change behavior, but it removes a -clang warning. - -Signed-off-by: Theodore Ts'o ---- - e2fsck/pass5.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/e2fsck/pass5.c b/e2fsck/pass5.c -index 81009097..3a5c88da 100644 ---- a/e2fsck/pass5.c -+++ b/e2fsck/pass5.c -@@ -886,11 +886,12 @@ static void check_inode_end(e2fsck_t ctx) - * be written back to disk. - */ - check_intra_bg_tail: -- if (!asked && fs->flags & EXT2_FLAG_IBITMAP_TAIL_PROBLEM) -+ if (!asked && fs->flags & EXT2_FLAG_IBITMAP_TAIL_PROBLEM) { - if (fix_problem(ctx, PR_5_INODE_BMAP_PADDING, &pctx)) - ext2fs_mark_ib_dirty(fs); - else - ext2fs_unmark_valid(fs); -+ } - } - - static void check_block_end(e2fsck_t ctx) --- -2.20.1 - diff --git a/SOURCES/e2fsprogs-1.44.6-e2image-add-b-and-B-options-to-specify-where-to-find.patch b/SOURCES/e2fsprogs-1.44.6-e2image-add-b-and-B-options-to-specify-where-to-find.patch deleted file mode 100644 index 6d08490..0000000 --- a/SOURCES/e2fsprogs-1.44.6-e2image-add-b-and-B-options-to-specify-where-to-find.patch +++ /dev/null @@ -1,187 +0,0 @@ -From c86892cb20129e3925fb16c228fb7433332371ce Mon Sep 17 00:00:00 2001 -From: Artem Blagodarenko -Date: Wed, 6 Mar 2019 11:52:13 -0500 -Subject: [PATCH 3/4] e2image: add -b and -B options to specify where to find - the superblock - -e2image has no ability to use superblock backup to copy metadata. -This feature can be useful if someone wants to make partition -image and fix it using e2fsck utility. - -New -b option allows to pass superblock number, like e2fsck utility does. -e2image doesn't change primary superblock and store it as is, so -it can be fixed using e2fsck latter. Option -B allows setting -superblock size. - -Signed-off-by: Artem Blagodarenko -Signed-off-by: Theodore Ts'o ---- - misc/e2image.8.in | 33 +++++++++++++++++++++++++++++++++ - misc/e2image.c | 43 +++++++++++++++++++++++++++++++++++++------ - 2 files changed, 70 insertions(+), 6 deletions(-) - -diff --git a/misc/e2image.8.in b/misc/e2image.8.in -index a7bfdf24..bbbb57ae 100644 ---- a/misc/e2image.8.in -+++ b/misc/e2image.8.in -@@ -12,6 +12,15 @@ e2image \- Save critical ext2/ext3/ext4 filesystem metadata to a file - ] - [ - .B \-f -+.B \-b -+.I superblock -+] -+[ -+.B \-B -+.I blocksize -+] -+[ -+.B \-fr - ] - .I device - .I image-file -@@ -167,6 +176,22 @@ the - option will prevent analysis of problems related to hash-tree indexed - directories. - .PP -+Option -+.B \-b -+.I superblock -+can be used to get image from partition with broken primary superblock. -+The partition is copied as-is including broken primary superblock. -+.PP -+Option -+.B \-B -+.I blocksize -+can be used to set superblock block size. Normally, e2fsck will search -+for the superblock at various different block sizes in an attempt to find -+the appropriate blocksize. This search can be fooled in some cases. This -+option forces e2fsck to only try locating the superblock at a particular -+blocksize. If the superblock is not found, e2fsck will terminate with a -+fatal error. -+.PP - Note that this will work even if you substitute "/dev/hda1" for another raw - disk image, or QCOW2 image previously created by - .BR e2image . -@@ -217,6 +242,14 @@ This can be useful to write a qcow2 image containing all data to a - sparse image file where it can be loop mounted, or to a disk partition. - Note that this may not work with qcow2 images not generated by e2image. - .PP -+Options -+.B \-b -+.I superblock -+and -+.B \-B -+.I blocksize -+can be used same way as for raw images. -+.PP - .SH INCLUDING DATA - Normally - .B e2image -diff --git a/misc/e2image.c b/misc/e2image.c -index 9e21d0db..3c881fee 100644 ---- a/misc/e2image.c -+++ b/misc/e2image.c -@@ -104,7 +104,8 @@ static int get_bits_from_size(size_t size) - - static void usage(void) - { -- fprintf(stderr, _("Usage: %s [ -r|Q ] [ -f ] device image-file\n"), -+ fprintf(stderr, _("Usage: %s [ -r|Q ] [ -f ] [ -b superblock ] [ -B blocksize]" -+ "[ -fr ] device image-file\n"), - program_name); - fprintf(stderr, _(" %s -I device image-file\n"), program_name); - fprintf(stderr, _(" %s -ra [ -cfnp ] [ -o src_offset ] " -@@ -1267,7 +1268,8 @@ static void output_qcow2_meta_data_blocks(ext2_filsys fs, int fd) - free_qcow2_image(img); - } - --static void write_raw_image_file(ext2_filsys fs, int fd, int type, int flags) -+static void write_raw_image_file(ext2_filsys fs, int fd, int type, int flags, -+ blk64_t superblock) - { - struct process_block_struct pb; - struct ext2_inode inode; -@@ -1295,6 +1297,22 @@ static void write_raw_image_file(ext2_filsys fs, int fd, int type, int flags) - } - } - -+ if (superblock) { -+ int j; -+ -+ ext2fs_mark_block_bitmap2(meta_block_map, superblock); -+ meta_blocks_count++; -+ -+ /* -+ * Mark the backup superblock descriptors -+ */ -+ for (j = 0; j < fs->desc_blocks; j++) { -+ ext2fs_mark_block_bitmap2(meta_block_map, -+ ext2fs_descriptor_block_loc2(fs, superblock, j)); -+ } -+ meta_blocks_count += fs->desc_blocks; -+ } -+ - mark_table_blocks(fs); - if (show_progress) - fprintf(stderr, "%s", _("Scanning inodes...\n")); -@@ -1474,6 +1492,8 @@ int main (int argc, char ** argv) - int ignore_rw_mount = 0; - int check = 0; - struct stat st; -+ blk64_t superblock = 0; -+ int blocksize = 0; - - #ifdef ENABLE_NLS - setlocale(LC_MESSAGES, ""); -@@ -1487,8 +1507,14 @@ int main (int argc, char ** argv) - if (argc && *argv) - program_name = *argv; - add_error_table(&et_ext2_error_table); -- while ((c = getopt(argc, argv, "nrsIQafo:O:pc")) != EOF) -+ while ((c = getopt(argc, argv, "b:B:nrsIQafo:O:pc")) != EOF) - switch (c) { -+ case 'b': -+ superblock = strtoull(optarg, NULL, 0); -+ break; -+ case 'B': -+ blocksize = strtoul(optarg, NULL, 0); -+ break; - case 'I': - flags |= E2IMAGE_INSTALL_FLAG; - break; -@@ -1540,6 +1566,11 @@ int main (int argc, char ** argv) - "with raw or QCOW2 images.")); - exit(1); - } -+ if (superblock && !img_type) { -+ com_err(program_name, 0, "%s", _("-b option can only be used " -+ "with raw or QCOW2 images.")); -+ exit(1); -+ } - if ((source_offset || dest_offset) && img_type != E2IMAGE_RAW) { - com_err(program_name, 0, "%s", - _("Offsets are only allowed with raw images.")); -@@ -1590,8 +1621,8 @@ int main (int argc, char ** argv) - } - } - sprintf(offset_opt, "offset=%llu", source_offset); -- retval = ext2fs_open2(device_name, offset_opt, open_flag, 0, 0, -- unix_io_manager, &fs); -+ retval = ext2fs_open2(device_name, offset_opt, open_flag, -+ superblock, blocksize, unix_io_manager, &fs); - if (retval) { - com_err (program_name, retval, _("while trying to open %s"), - device_name); -@@ -1681,7 +1712,7 @@ skip_device: - exit(1); - } - if (img_type) -- write_raw_image_file(fs, fd, img_type, flags); -+ write_raw_image_file(fs, fd, img_type, flags, superblock); - else - write_image_file(fs, fd); - --- -2.20.1 - diff --git a/SOURCES/e2fsprogs-1.44.6-libext2fs-add-ext2fs_-read-write-_inode2.patch b/SOURCES/e2fsprogs-1.44.6-libext2fs-add-ext2fs_-read-write-_inode2.patch deleted file mode 100644 index f3b5dfd..0000000 --- a/SOURCES/e2fsprogs-1.44.6-libext2fs-add-ext2fs_-read-write-_inode2.patch +++ /dev/null @@ -1,162 +0,0 @@ -From 5fef457767fa876e29a5277e6c7428aa36c9ac61 Mon Sep 17 00:00:00 2001 -From: Theodore Ts'o -Date: Thu, 13 Dec 2018 00:51:51 -0500 -Subject: [PATCH 1/4] libext2fs: add ext2fs_{read,write}_inode2() - -Add new library interface which allows the caller to control whether -the inode checksum should be checked on inode read, or set on inode -write. - -Signed-off-by: Theodore Ts'o ---- - lib/ext2fs/ext2fs.h | 18 +++++++++++++++- - lib/ext2fs/inode.c | 50 +++++++++++++++++++++++++++++---------------- - 2 files changed, 49 insertions(+), 19 deletions(-) - -diff --git a/lib/ext2fs/ext2fs.h b/lib/ext2fs/ext2fs.h -index c86596a6..96735c8e 100644 ---- a/lib/ext2fs/ext2fs.h -+++ b/lib/ext2fs/ext2fs.h -@@ -570,6 +570,16 @@ typedef struct ext2_icount *ext2_icount_t; - */ - #define BMAP_RET_UNINIT 0x0001 - -+/* -+ * Flags for ext2fs_read_inode2 -+ */ -+#define READ_INODE_NOCSUM 0x0001 -+ -+/* -+ * Flags for ext2fs_write_inode2 -+ */ -+#define WRITE_INODE_NOCSUM 0x0001 -+ - /* - * Flags for imager.c functions - */ -@@ -1514,13 +1524,19 @@ extern int ext2fs_inode_scan_flags(ext2_inode_scan scan, int set_flags, - extern errcode_t ext2fs_read_inode_full(ext2_filsys fs, ext2_ino_t ino, - struct ext2_inode * inode, - int bufsize); --extern errcode_t ext2fs_read_inode (ext2_filsys fs, ext2_ino_t ino, -+extern errcode_t ext2fs_read_inode(ext2_filsys fs, ext2_ino_t ino, - struct ext2_inode * inode); -+extern errcode_t ext2fs_read_inode2(ext2_filsys fs, ext2_ino_t ino, -+ struct ext2_inode * inode, -+ int bufsize, int flags); - extern errcode_t ext2fs_write_inode_full(ext2_filsys fs, ext2_ino_t ino, - struct ext2_inode * inode, - int bufsize); - extern errcode_t ext2fs_write_inode(ext2_filsys fs, ext2_ino_t ino, - struct ext2_inode * inode); -+extern errcode_t ext2fs_write_inode2(ext2_filsys fs, ext2_ino_t ino, -+ struct ext2_inode * inode, -+ int bufsize, int flags); - extern errcode_t ext2fs_write_new_inode(ext2_filsys fs, ext2_ino_t ino, - struct ext2_inode * inode); - extern errcode_t ext2fs_get_blocks(ext2_filsys fs, ext2_ino_t ino, blk_t *blocks); -diff --git a/lib/ext2fs/inode.c b/lib/ext2fs/inode.c -index 013c658e..2a4be739 100644 ---- a/lib/ext2fs/inode.c -+++ b/lib/ext2fs/inode.c -@@ -740,8 +740,9 @@ errcode_t ext2fs_get_next_inode(ext2_inode_scan scan, ext2_ino_t *ino, - /* - * Functions to read and write a single inode. - */ --errcode_t ext2fs_read_inode_full(ext2_filsys fs, ext2_ino_t ino, -- struct ext2_inode * inode, int bufsize) -+errcode_t ext2fs_read_inode2(ext2_filsys fs, ext2_ino_t ino, -+ struct ext2_inode * inode, int bufsize, -+ int flags) - { - blk64_t block_nr; - dgrp_t group; -@@ -850,21 +851,29 @@ errcode_t ext2fs_read_inode_full(ext2_filsys fs, ext2_ino_t ino, - } - memcpy(inode, iptr, (bufsize > length) ? length : bufsize); - -- if (!(fs->flags & EXT2_FLAG_IGNORE_CSUM_ERRORS) && fail_csum) -+ if (!(fs->flags & EXT2_FLAG_IGNORE_CSUM_ERRORS) && -+ !(flags & READ_INODE_NOCSUM) && fail_csum) - return EXT2_ET_INODE_CSUM_INVALID; - - return 0; - } - -+errcode_t ext2fs_read_inode_full(ext2_filsys fs, ext2_ino_t ino, -+ struct ext2_inode * inode, int bufsize) -+{ -+ return ext2fs_read_inode2(fs, ino, inode, bufsize, 0); -+} -+ - errcode_t ext2fs_read_inode(ext2_filsys fs, ext2_ino_t ino, - struct ext2_inode * inode) - { -- return ext2fs_read_inode_full(fs, ino, inode, -- sizeof(struct ext2_inode)); -+ return ext2fs_read_inode2(fs, ino, inode, -+ sizeof(struct ext2_inode), 0); - } - --errcode_t ext2fs_write_inode_full(ext2_filsys fs, ext2_ino_t ino, -- struct ext2_inode * inode, int bufsize) -+errcode_t ext2fs_write_inode2(ext2_filsys fs, ext2_ino_t ino, -+ struct ext2_inode * inode, int bufsize, -+ int flags) - { - blk64_t block_nr; - dgrp_t group; -@@ -895,12 +904,9 @@ errcode_t ext2fs_write_inode_full(ext2_filsys fs, ext2_ino_t ino, - - if (bufsize < length) { - int old_flags = fs->flags; -- fs->flags |= EXT2_FLAG_IGNORE_CSUM_ERRORS; -- retval = ext2fs_read_inode_full(fs, ino, -- (struct ext2_inode *)w_inode, -- length); -- fs->flags = (old_flags & EXT2_FLAG_IGNORE_CSUM_ERRORS) | -- (fs->flags & ~EXT2_FLAG_IGNORE_CSUM_ERRORS); -+ retval = ext2fs_read_inode2(fs, ino, -+ (struct ext2_inode *)w_inode, -+ length, READ_INODE_NOCSUM); - if (retval) - goto errout; - } -@@ -930,9 +936,11 @@ errcode_t ext2fs_write_inode_full(ext2_filsys fs, ext2_ino_t ino, - ext2fs_swap_inode_full(fs, w_inode, w_inode, 1, length); - #endif - -- retval = ext2fs_inode_csum_set(fs, ino, w_inode); -- if (retval) -- goto errout; -+ if ((flags & WRITE_INODE_NOCSUM) == 0) { -+ retval = ext2fs_inode_csum_set(fs, ino, w_inode); -+ if (retval) -+ goto errout; -+ } - - group = (ino - 1) / EXT2_INODES_PER_GROUP(fs->super); - offset = ((ino - 1) % EXT2_INODES_PER_GROUP(fs->super)) * -@@ -989,11 +997,17 @@ errout: - return retval; - } - -+errcode_t ext2fs_write_inode_full(ext2_filsys fs, ext2_ino_t ino, -+ struct ext2_inode * inode, int bufsize) -+{ -+ return ext2fs_write_inode2(fs, ino, inode, bufsize, 0); -+} -+ - errcode_t ext2fs_write_inode(ext2_filsys fs, ext2_ino_t ino, - struct ext2_inode *inode) - { -- return ext2fs_write_inode_full(fs, ino, inode, -- sizeof(struct ext2_inode)); -+ return ext2fs_write_inode2(fs, ino, inode, -+ sizeof(struct ext2_inode), 0); - } - - /* --- -2.20.1 - diff --git a/SOURCES/e2fsprogs-1.44.6-libext2fs-remove-unused-variable-old_flags.patch b/SOURCES/e2fsprogs-1.44.6-libext2fs-remove-unused-variable-old_flags.patch deleted file mode 100644 index d405da4..0000000 --- a/SOURCES/e2fsprogs-1.44.6-libext2fs-remove-unused-variable-old_flags.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 75fceeee449a3a2ee158fee2a084d383f7360d1e Mon Sep 17 00:00:00 2001 -From: Eric Biggers -Date: Sun, 28 Apr 2019 20:37:45 -0400 -Subject: [PATCH 2/4] libext2fs: remove unused variable 'old_flags' - -In ext2fs_write_inode2(), the 'old_flags' variable is never used. - -Signed-off-by: Eric Biggers -Signed-off-by: Theodore Ts'o ---- - lib/ext2fs/inode.c | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/lib/ext2fs/inode.c b/lib/ext2fs/inode.c -index 2a4be739..75df418d 100644 ---- a/lib/ext2fs/inode.c -+++ b/lib/ext2fs/inode.c -@@ -903,7 +903,6 @@ errcode_t ext2fs_write_inode2(ext2_filsys fs, ext2_ino_t ino, - return retval; - - if (bufsize < length) { -- int old_flags = fs->flags; - retval = ext2fs_read_inode2(fs, ino, - (struct ext2_inode *)w_inode, - length, READ_INODE_NOCSUM); --- -2.20.1 - diff --git a/SOURCES/e2fsprogs-1.44.6-mke2fs-accept-the-english-yes-character-to-the-proce.patch b/SOURCES/e2fsprogs-1.44.6-mke2fs-accept-the-english-yes-character-to-the-proce.patch deleted file mode 100644 index 68c83c5..0000000 --- a/SOURCES/e2fsprogs-1.44.6-mke2fs-accept-the-english-yes-character-to-the-proce.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 0e1bff5983c675544e79ee9e449e597f397c15b0 Mon Sep 17 00:00:00 2001 -From: Theodore Ts'o -Date: Mon, 27 May 2019 19:36:15 -0400 -Subject: [PATCH] mke2fs: accept the english yes character to the proceed - question - -In some cases if the translation file is missing some translations, -mke2fs can end up printing an English message, e.g.: - -% LANG=it_IT.UTF-8 ./mke2fs /tmp/foo.img 8M -mke2fs 1.45.1 (12-May-2019) -/tmp/foo.img contiene un file system ext4 - created on Mon May 27 19:35:48 2019 -Proceed anyway? (y,N) - -However, if there is a translation for string to match with "yY" -(e.g., to "sS" for Italian), then 'y' won't work. Fix this by falling -back to the english 'yY' characters. - -Addresses-Debian-Bug: #907034 -Signed-off-by: Theodore Ts'o ---- - misc/util.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/misc/util.c b/misc/util.c -index 1d33883d..77991589 100644 ---- a/misc/util.c -+++ b/misc/util.c -@@ -91,6 +91,7 @@ void proceed_question(int delay) - { - char buf[256]; - const char *short_yes = _("yY"); -+ const char *english_yes = "yY"; - - fflush(stdout); - fflush(stderr); -@@ -108,7 +109,9 @@ void proceed_question(int delay) - fputs(_("Proceed anyway? (y,N) "), stdout); - buf[0] = 0; - if (!fgets(buf, sizeof(buf), stdin) || -- strchr(short_yes, buf[0]) == 0) { -+ strchr(_("nN"), buf[0]) || -+ !(strchr(short_yes, buf[0]) || -+ strchr(english_yes, buf[0]))) { - putc('\n', stdout); - exit(1); - } --- -2.20.1 - diff --git a/SOURCES/e2fsprogs-1.45.6-Makefile.in-Disable-e2scrub.patch b/SOURCES/e2fsprogs-1.45.6-Makefile.in-Disable-e2scrub.patch new file mode 100644 index 0000000..0d31242 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-Makefile.in-Disable-e2scrub.patch @@ -0,0 +1,38 @@ +From 06116f6d053e398d13634df911bcb105d0fb2416 Mon Sep 17 00:00:00 2001 +From: Lukas Czerner +Date: Sun, 15 Dec 2019 12:42:28 +0100 +Subject: [PATCH 1/7] Makefile.in: Disable e2scrub + +e2scrub system is still new and we're not ready to support it yet, so +just disbale it and not even build it. + +Signed-off-by: Lukas Czerner +--- + Makefile.in | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/Makefile.in b/Makefile.in +index b951c017..34e2048d 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -13,7 +13,6 @@ INSTALL = @INSTALL@ + @DEBUGFS_CMT@DEBUGFS_DIR= debugfs + @UUID_CMT@UUID_LIB_SUBDIR= lib/uuid + @BLKID_CMT@BLKID_LIB_SUBDIR= lib/blkid +-@E2SCRUB_CMT@E2SCRUB_DIR= scrub + @ALL_CMT@SUPPORT_LIB_SUBDIR= lib/support + @ALL_CMT@E2P_LIB_SUBDIR= lib/e2p + @ALL_CMT@EXT2FS_LIB_SUBDIR= lib/ext2fs +@@ -21,8 +20,7 @@ INSTALL = @INSTALL@ + LIB_SUBDIRS=lib/et lib/ss $(E2P_LIB_SUBDIR) $(UUID_LIB_SUBDIR) \ + $(BLKID_LIB_SUBDIR) $(SUPPORT_LIB_SUBDIR) $(EXT2FS_LIB_SUBDIR) intl + +-PROG_SUBDIRS=e2fsck $(DEBUGFS_DIR) misc $(RESIZE_DIR) tests/progs po \ +- $(E2SCRUB_DIR) ++PROG_SUBDIRS=e2fsck $(DEBUGFS_DIR) misc $(RESIZE_DIR) tests/progs po + + SUBDIRS=util $(LIB_SUBDIRS) $(PROG_SUBDIRS) tests + +-- +2.21.3 + diff --git a/SOURCES/e2fsprogs-1.45.6-Revert-fuse2fs-install-fuse2fs-in-usr-bin-instead-of.patch b/SOURCES/e2fsprogs-1.45.6-Revert-fuse2fs-install-fuse2fs-in-usr-bin-instead-of.patch new file mode 100644 index 0000000..8da372e --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-Revert-fuse2fs-install-fuse2fs-in-usr-bin-instead-of.patch @@ -0,0 +1,45 @@ +From f2bb71bdbedf33f4fae4e1402ec23fe58eece1a7 Mon Sep 17 00:00:00 2001 +From: Lukas Czerner +Date: Sun, 15 Dec 2019 14:39:46 +0100 +Subject: [PATCH 2/7] Revert "fuse2fs: install fuse2fs in /usr/bin instead of + /usr/sbin" + +This reverts commit b71150355dca5409cf8e82a7e715e459a795bbf8. +--- + debian/fuse2fs.install | 2 +- + misc/Makefile.in | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/debian/fuse2fs.install b/debian/fuse2fs.install +index 2ed4c3c0..cd37a70e 100644 +--- a/debian/fuse2fs.install ++++ b/debian/fuse2fs.install +@@ -1,2 +1,2 @@ +-/usr/bin/fuse2fs ++/usr/sbin/fuse2fs + /usr/share/man/man1/fuse2fs.1 +diff --git a/misc/Makefile.in b/misc/Makefile.in +index 9f2a8939..216fc771 100644 +--- a/misc/Makefile.in ++++ b/misc/Makefile.in +@@ -35,7 +35,7 @@ INSTALL = @INSTALL@ + SPROGS= mke2fs badblocks tune2fs dumpe2fs $(BLKID_PROG) logsave \ + $(E2IMAGE_PROG) @FSCK_PROG@ e2undo + USPROGS= mklost+found filefrag e2freefrag $(UUIDD_PROG) \ +- $(E4DEFRAG_PROG) $(E4CRYPT_PROG) ++ $(E4DEFRAG_PROG) $(E4CRYPT_PROG) $(FUSE_PROG) + SMANPAGES= tune2fs.8 mklost+found.8 mke2fs.8 dumpe2fs.8 badblocks.8 \ + e2label.8 $(FINDFS_MAN) $(BLKID_MAN) $(E2IMAGE_MAN) \ + logsave.8 filefrag.8 e2freefrag.8 e2undo.8 \ +@@ -43,7 +43,7 @@ SMANPAGES= tune2fs.8 mklost+found.8 mke2fs.8 dumpe2fs.8 badblocks.8 \ + e2mmpstatus.8 + FMANPAGES= mke2fs.conf.5 ext4.5 + +-UPROGS= chattr lsattr $(FUSE_PROG) @UUID_CMT@ uuidgen ++UPROGS= chattr lsattr @UUID_CMT@ uuidgen + UMANPAGES= chattr.1 lsattr.1 @UUID_CMT@ uuidgen.1 + UMANPAGES+= @FUSE_CMT@ fuse2fs.1 + +-- +2.21.3 + diff --git a/SOURCES/e2fsprogs-1.45.6-Revert-libext2fs-hide-struct-ext2fs_hashmap-as-an-in.patch b/SOURCES/e2fsprogs-1.45.6-Revert-libext2fs-hide-struct-ext2fs_hashmap-as-an-in.patch new file mode 100644 index 0000000..17c210d --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-Revert-libext2fs-hide-struct-ext2fs_hashmap-as-an-in.patch @@ -0,0 +1,86 @@ +From cdbe6f07c929b0c9a80b7fbeb61b3a9f66015085 Mon Sep 17 00:00:00 2001 +From: Lukas Czerner +Date: Tue, 14 Jan 2020 09:49:31 +0100 +Subject: [PATCH 6/7] Revert "libext2fs: hide struct ext2fs_hashmap as an + internal implementation detail" + +This reverts commit ef54444e6d1da4b464c11e749c9643ed945a770b +because it breaks ABI. + +Signed-off-by: Lukas Czerner +--- + lib/ext2fs/hashmap.c | 16 ---------------- + lib/ext2fs/hashmap.h | 30 +++++++++++++++++++++--------- + 2 files changed, 21 insertions(+), 25 deletions(-) + +diff --git a/lib/ext2fs/hashmap.c b/lib/ext2fs/hashmap.c +index ffe61ce9..3d8ee814 100644 +--- a/lib/ext2fs/hashmap.c ++++ b/lib/ext2fs/hashmap.c +@@ -1,22 +1,6 @@ + #include "hashmap.h" + #include + +-struct ext2fs_hashmap { +- uint32_t size; +- uint32_t(*hash)(const void *key, size_t len); +- void(*free)(void*); +- struct ext2fs_hashmap_entry *first; +- struct ext2fs_hashmap_entry *last; +-#if __GNUC_PREREQ (4, 8) +-#pragma GCC diagnostic push +-#pragma GCC diagnostic ignored "-Wpedantic" +-#endif +- struct ext2fs_hashmap_entry *entries[0]; +-#if __GNUC_PREREQ (4, 8) +-#pragma GCC diagnostic pop +-#endif +-}; +- + uint32_t ext2fs_djb2_hash(const void *str, size_t size) + { + int c; +diff --git a/lib/ext2fs/hashmap.h b/lib/ext2fs/hashmap.h +index dcfa7455..656d3d90 100644 +--- a/lib/ext2fs/hashmap.h ++++ b/lib/ext2fs/hashmap.h +@@ -13,15 +13,27 @@ + #endif + #endif + +-struct ext2fs_hashmap; +- +-struct ext2fs_hashmap_entry { +- void *data; +- const void *key; +- size_t key_len; +- struct ext2fs_hashmap_entry *next; +- struct ext2fs_hashmap_entry *list_next; +- struct ext2fs_hashmap_entry *list_prev; ++struct ext2fs_hashmap { ++ uint32_t size; ++ uint32_t(*hash)(const void *key, size_t len); ++ void(*free)(void*); ++ struct ext2fs_hashmap_entry *first; ++ struct ext2fs_hashmap_entry *last; ++ struct ext2fs_hashmap_entry { ++ void *data; ++ const void *key; ++ size_t key_len; ++ struct ext2fs_hashmap_entry *next; ++ struct ext2fs_hashmap_entry *list_next; ++ struct ext2fs_hashmap_entry *list_prev; ++#if __GNUC_PREREQ (4, 8) ++#pragma GCC diagnostic push ++#pragma GCC diagnostic ignored "-Wpedantic" ++#endif ++ } *entries[0]; ++#if __GNUC_PREREQ (4, 8) ++#pragma GCC diagnostic pop ++#endif + }; + + struct ext2fs_hashmap *ext2fs_hashmap_create( +-- +2.21.3 + diff --git a/SOURCES/e2fsprogs-1.45.6-Revert-libext2fs-revamp-bitmap-types-to-fix-LTO-warn.patch b/SOURCES/e2fsprogs-1.45.6-Revert-libext2fs-revamp-bitmap-types-to-fix-LTO-warn.patch new file mode 100644 index 0000000..b473248 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-Revert-libext2fs-revamp-bitmap-types-to-fix-LTO-warn.patch @@ -0,0 +1,1421 @@ +From 1c25e64066e861f273b785b06ef3bc7636552eab Mon Sep 17 00:00:00 2001 +From: Lukas Czerner +Date: Tue, 14 Jan 2020 09:49:19 +0100 +Subject: [PATCH 5/7] Revert "libext2fs: revamp bitmap types to fix LTO + warnings" + +This reverts commit 83d9ffccf3ee6ad4e165eeb6912acf1f6149be28 because it +breaks ABI. + +Signed-off-by: Lukas Czerner +--- + lib/ext2fs/bitmaps.c | 6 +- + lib/ext2fs/blkmap64_ba.c | 38 ++++---- + lib/ext2fs/blkmap64_rb.c | 38 ++++---- + lib/ext2fs/bmap64.h | 38 ++++---- + lib/ext2fs/ext2fs.h | 11 +-- + lib/ext2fs/gen_bitmap.c | 113 ++++++++--------------- + lib/ext2fs/gen_bitmap64.c | 185 ++++++++++++++++---------------------- + 7 files changed, 173 insertions(+), 256 deletions(-) + +diff --git a/lib/ext2fs/bitmaps.c b/lib/ext2fs/bitmaps.c +index 834a3962..e0b1f7cd 100644 +--- a/lib/ext2fs/bitmaps.c ++++ b/lib/ext2fs/bitmaps.c +@@ -126,7 +126,6 @@ errcode_t ext2fs_allocate_subcluster_bitmap(ext2_filsys fs, + { + __u64 start, end, real_end; + ext2fs_generic_bitmap bmap; +- ext2fs_generic_bitmap_64 bmap64; + errcode_t retval; + + EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS); +@@ -149,15 +148,14 @@ errcode_t ext2fs_allocate_subcluster_bitmap(ext2_filsys fs, + end, real_end, descr, &bmap); + if (retval) + return retval; +- bmap64 = (ext2fs_generic_bitmap_64) bmap; +- bmap64->cluster_bits = 0; ++ bmap->cluster_bits = 0; + *ret = bmap; + return 0; + } + + int ext2fs_get_bitmap_granularity(ext2fs_block_bitmap bitmap) + { +- ext2fs_generic_bitmap_64 bmap = (ext2fs_generic_bitmap_64) bitmap; ++ ext2fs_generic_bitmap bmap = bitmap; + + if (!EXT2FS_IS_64_BITMAP(bmap)) + return 0; +diff --git a/lib/ext2fs/blkmap64_ba.c b/lib/ext2fs/blkmap64_ba.c +index 85cb38d2..3707a61e 100644 +--- a/lib/ext2fs/blkmap64_ba.c ++++ b/lib/ext2fs/blkmap64_ba.c +@@ -40,7 +40,7 @@ struct ext2fs_ba_private_struct { + + typedef struct ext2fs_ba_private_struct *ext2fs_ba_private; + +-static errcode_t ba_alloc_private_data (ext2fs_generic_bitmap_64 bitmap) ++static errcode_t ba_alloc_private_data (ext2fs_generic_bitmap bitmap) + { + ext2fs_ba_private bp; + errcode_t retval; +@@ -69,7 +69,7 @@ static errcode_t ba_alloc_private_data (ext2fs_generic_bitmap_64 bitmap) + } + + static errcode_t ba_new_bmap(ext2_filsys fs EXT2FS_ATTR((unused)), +- ext2fs_generic_bitmap_64 bitmap) ++ ext2fs_generic_bitmap bitmap) + { + ext2fs_ba_private bp; + errcode_t retval; +@@ -86,7 +86,7 @@ static errcode_t ba_new_bmap(ext2_filsys fs EXT2FS_ATTR((unused)), + return 0; + } + +-static void ba_free_bmap(ext2fs_generic_bitmap_64 bitmap) ++static void ba_free_bmap(ext2fs_generic_bitmap bitmap) + { + ext2fs_ba_private bp = (ext2fs_ba_private) bitmap->private; + +@@ -101,8 +101,8 @@ static void ba_free_bmap(ext2fs_generic_bitmap_64 bitmap) + bp = 0; + } + +-static errcode_t ba_copy_bmap(ext2fs_generic_bitmap_64 src, +- ext2fs_generic_bitmap_64 dest) ++static errcode_t ba_copy_bmap(ext2fs_generic_bitmap src, ++ ext2fs_generic_bitmap dest) + { + ext2fs_ba_private src_bp = (ext2fs_ba_private) src->private; + ext2fs_ba_private dest_bp; +@@ -121,7 +121,7 @@ static errcode_t ba_copy_bmap(ext2fs_generic_bitmap_64 src, + return 0; + } + +-static errcode_t ba_resize_bmap(ext2fs_generic_bitmap_64 bmap, ++static errcode_t ba_resize_bmap(ext2fs_generic_bitmap bmap, + __u64 new_end, __u64 new_real_end) + { + ext2fs_ba_private bp = (ext2fs_ba_private) bmap->private; +@@ -162,7 +162,7 @@ static errcode_t ba_resize_bmap(ext2fs_generic_bitmap_64 bmap, + + } + +-static int ba_mark_bmap(ext2fs_generic_bitmap_64 bitmap, __u64 arg) ++static int ba_mark_bmap(ext2fs_generic_bitmap bitmap, __u64 arg) + { + ext2fs_ba_private bp = (ext2fs_ba_private) bitmap->private; + blk64_t bitno = (blk64_t) arg; +@@ -170,7 +170,7 @@ static int ba_mark_bmap(ext2fs_generic_bitmap_64 bitmap, __u64 arg) + return ext2fs_set_bit64(bitno - bitmap->start, bp->bitarray); + } + +-static int ba_unmark_bmap(ext2fs_generic_bitmap_64 bitmap, __u64 arg) ++static int ba_unmark_bmap(ext2fs_generic_bitmap bitmap, __u64 arg) + { + ext2fs_ba_private bp = (ext2fs_ba_private) bitmap->private; + blk64_t bitno = (blk64_t) arg; +@@ -178,7 +178,7 @@ static int ba_unmark_bmap(ext2fs_generic_bitmap_64 bitmap, __u64 arg) + return ext2fs_clear_bit64(bitno - bitmap->start, bp->bitarray); + } + +-static int ba_test_bmap(ext2fs_generic_bitmap_64 bitmap, __u64 arg) ++static int ba_test_bmap(ext2fs_generic_bitmap bitmap, __u64 arg) + { + ext2fs_ba_private bp = (ext2fs_ba_private) bitmap->private; + blk64_t bitno = (blk64_t) arg; +@@ -186,7 +186,7 @@ static int ba_test_bmap(ext2fs_generic_bitmap_64 bitmap, __u64 arg) + return ext2fs_test_bit64(bitno - bitmap->start, bp->bitarray); + } + +-static void ba_mark_bmap_extent(ext2fs_generic_bitmap_64 bitmap, __u64 arg, ++static void ba_mark_bmap_extent(ext2fs_generic_bitmap bitmap, __u64 arg, + unsigned int num) + { + ext2fs_ba_private bp = (ext2fs_ba_private) bitmap->private; +@@ -197,7 +197,7 @@ static void ba_mark_bmap_extent(ext2fs_generic_bitmap_64 bitmap, __u64 arg, + ext2fs_fast_set_bit64(bitno + i - bitmap->start, bp->bitarray); + } + +-static void ba_unmark_bmap_extent(ext2fs_generic_bitmap_64 bitmap, __u64 arg, ++static void ba_unmark_bmap_extent(ext2fs_generic_bitmap bitmap, __u64 arg, + unsigned int num) + { + ext2fs_ba_private bp = (ext2fs_ba_private) bitmap->private; +@@ -208,7 +208,7 @@ static void ba_unmark_bmap_extent(ext2fs_generic_bitmap_64 bitmap, __u64 arg, + ext2fs_fast_clear_bit64(bitno + i - bitmap->start, bp->bitarray); + } + +-static int ba_test_clear_bmap_extent(ext2fs_generic_bitmap_64 bitmap, ++static int ba_test_clear_bmap_extent(ext2fs_generic_bitmap bitmap, + __u64 start, unsigned int len) + { + ext2fs_ba_private bp = (ext2fs_ba_private) bitmap->private; +@@ -282,7 +282,7 @@ static int ba_test_clear_bmap_extent(ext2fs_generic_bitmap_64 bitmap, + } + + +-static errcode_t ba_set_bmap_range(ext2fs_generic_bitmap_64 bitmap, ++static errcode_t ba_set_bmap_range(ext2fs_generic_bitmap bitmap, + __u64 start, size_t num, void *in) + { + ext2fs_ba_private bp = (ext2fs_ba_private) bitmap->private; +@@ -292,7 +292,7 @@ static errcode_t ba_set_bmap_range(ext2fs_generic_bitmap_64 bitmap, + return 0; + } + +-static errcode_t ba_get_bmap_range(ext2fs_generic_bitmap_64 bitmap, ++static errcode_t ba_get_bmap_range(ext2fs_generic_bitmap bitmap, + __u64 start, size_t num, void *out) + { + ext2fs_ba_private bp = (ext2fs_ba_private) bitmap->private; +@@ -302,7 +302,7 @@ static errcode_t ba_get_bmap_range(ext2fs_generic_bitmap_64 bitmap, + return 0; + } + +-static void ba_clear_bmap(ext2fs_generic_bitmap_64 bitmap) ++static void ba_clear_bmap(ext2fs_generic_bitmap bitmap) + { + ext2fs_ba_private bp = (ext2fs_ba_private) bitmap->private; + +@@ -311,20 +311,20 @@ static void ba_clear_bmap(ext2fs_generic_bitmap_64 bitmap) + } + + #ifdef ENABLE_BMAP_STATS +-static void ba_print_stats(ext2fs_generic_bitmap_64 bitmap) ++static void ba_print_stats(ext2fs_generic_bitmap bitmap) + { + fprintf(stderr, "%16llu Bytes used by bitarray\n", + ((bitmap->real_end - bitmap->start) >> 3) + 1 + + sizeof(struct ext2fs_ba_private_struct)); + } + #else +-static void ba_print_stats(ext2fs_generic_bitmap_64 bitmap EXT2FS_ATTR((unused))) ++static void ba_print_stats(ext2fs_generic_bitmap bitmap EXT2FS_ATTR((unused))) + { + } + #endif + + /* Find the first zero bit between start and end, inclusive. */ +-static errcode_t ba_find_first_zero(ext2fs_generic_bitmap_64 bitmap, ++static errcode_t ba_find_first_zero(ext2fs_generic_bitmap bitmap, + __u64 start, __u64 end, __u64 *out) + { + ext2fs_ba_private bp = (ext2fs_ba_private)bitmap->private; +@@ -398,7 +398,7 @@ static errcode_t ba_find_first_zero(ext2fs_generic_bitmap_64 bitmap, + } + + /* Find the first one bit between start and end, inclusive. */ +-static errcode_t ba_find_first_set(ext2fs_generic_bitmap_64 bitmap, ++static errcode_t ba_find_first_set(ext2fs_generic_bitmap bitmap, + __u64 start, __u64 end, __u64 *out) + { + ext2fs_ba_private bp = (ext2fs_ba_private)bitmap->private; +diff --git a/lib/ext2fs/blkmap64_rb.c b/lib/ext2fs/blkmap64_rb.c +index 1fd55274..4cbfb1ed 100644 +--- a/lib/ext2fs/blkmap64_rb.c ++++ b/lib/ext2fs/blkmap64_rb.c +@@ -177,7 +177,7 @@ static void rb_free_extent(struct ext2fs_rb_private *bp, + ext2fs_free_mem(&ext); + } + +-static errcode_t rb_alloc_private_data (ext2fs_generic_bitmap_64 bitmap) ++static errcode_t rb_alloc_private_data (ext2fs_generic_bitmap bitmap) + { + struct ext2fs_rb_private *bp; + errcode_t retval; +@@ -201,7 +201,7 @@ static errcode_t rb_alloc_private_data (ext2fs_generic_bitmap_64 bitmap) + } + + static errcode_t rb_new_bmap(ext2_filsys fs EXT2FS_ATTR((unused)), +- ext2fs_generic_bitmap_64 bitmap) ++ ext2fs_generic_bitmap bitmap) + { + errcode_t retval; + +@@ -225,7 +225,7 @@ static void rb_free_tree(struct rb_root *root) + } + } + +-static void rb_free_bmap(ext2fs_generic_bitmap_64 bitmap) ++static void rb_free_bmap(ext2fs_generic_bitmap bitmap) + { + struct ext2fs_rb_private *bp; + +@@ -236,8 +236,8 @@ static void rb_free_bmap(ext2fs_generic_bitmap_64 bitmap) + bp = 0; + } + +-static errcode_t rb_copy_bmap(ext2fs_generic_bitmap_64 src, +- ext2fs_generic_bitmap_64 dest) ++static errcode_t rb_copy_bmap(ext2fs_generic_bitmap src, ++ ext2fs_generic_bitmap dest) + { + struct ext2fs_rb_private *src_bp, *dest_bp; + struct bmap_rb_extent *src_ext, *dest_ext; +@@ -302,7 +302,7 @@ static void rb_truncate(__u64 new_max, struct rb_root *root) + } + } + +-static errcode_t rb_resize_bmap(ext2fs_generic_bitmap_64 bmap, ++static errcode_t rb_resize_bmap(ext2fs_generic_bitmap bmap, + __u64 new_end, __u64 new_real_end) + { + struct ext2fs_rb_private *bp; +@@ -575,7 +575,7 @@ static int rb_remove_extent(__u64 start, __u64 count, + return retval; + } + +-static int rb_mark_bmap(ext2fs_generic_bitmap_64 bitmap, __u64 arg) ++static int rb_mark_bmap(ext2fs_generic_bitmap bitmap, __u64 arg) + { + struct ext2fs_rb_private *bp; + int retval; +@@ -588,7 +588,7 @@ static int rb_mark_bmap(ext2fs_generic_bitmap_64 bitmap, __u64 arg) + return retval; + } + +-static int rb_unmark_bmap(ext2fs_generic_bitmap_64 bitmap, __u64 arg) ++static int rb_unmark_bmap(ext2fs_generic_bitmap bitmap, __u64 arg) + { + struct ext2fs_rb_private *bp; + int retval; +@@ -603,7 +603,7 @@ static int rb_unmark_bmap(ext2fs_generic_bitmap_64 bitmap, __u64 arg) + } + + inline +-static int rb_test_bmap(ext2fs_generic_bitmap_64 bitmap, __u64 arg) ++static int rb_test_bmap(ext2fs_generic_bitmap bitmap, __u64 arg) + { + struct ext2fs_rb_private *bp; + +@@ -613,7 +613,7 @@ static int rb_test_bmap(ext2fs_generic_bitmap_64 bitmap, __u64 arg) + return rb_test_bit(bp, arg); + } + +-static void rb_mark_bmap_extent(ext2fs_generic_bitmap_64 bitmap, __u64 arg, ++static void rb_mark_bmap_extent(ext2fs_generic_bitmap bitmap, __u64 arg, + unsigned int num) + { + struct ext2fs_rb_private *bp; +@@ -625,7 +625,7 @@ static void rb_mark_bmap_extent(ext2fs_generic_bitmap_64 bitmap, __u64 arg, + check_tree(&bp->root, __func__); + } + +-static void rb_unmark_bmap_extent(ext2fs_generic_bitmap_64 bitmap, __u64 arg, ++static void rb_unmark_bmap_extent(ext2fs_generic_bitmap bitmap, __u64 arg, + unsigned int num) + { + struct ext2fs_rb_private *bp; +@@ -637,7 +637,7 @@ static void rb_unmark_bmap_extent(ext2fs_generic_bitmap_64 bitmap, __u64 arg, + check_tree(&bp->root, __func__); + } + +-static int rb_test_clear_bmap_extent(ext2fs_generic_bitmap_64 bitmap, ++static int rb_test_clear_bmap_extent(ext2fs_generic_bitmap bitmap, + __u64 start, unsigned int len) + { + struct rb_node *parent = NULL, **n; +@@ -693,7 +693,7 @@ static int rb_test_clear_bmap_extent(ext2fs_generic_bitmap_64 bitmap, + return retval; + } + +-static errcode_t rb_set_bmap_range(ext2fs_generic_bitmap_64 bitmap, ++static errcode_t rb_set_bmap_range(ext2fs_generic_bitmap bitmap, + __u64 start, size_t num, void *in) + { + struct ext2fs_rb_private *bp; +@@ -739,7 +739,7 @@ static errcode_t rb_set_bmap_range(ext2fs_generic_bitmap_64 bitmap, + return 0; + } + +-static errcode_t rb_get_bmap_range(ext2fs_generic_bitmap_64 bitmap, ++static errcode_t rb_get_bmap_range(ext2fs_generic_bitmap bitmap, + __u64 start, size_t num, void *out) + { + +@@ -804,7 +804,7 @@ static errcode_t rb_get_bmap_range(ext2fs_generic_bitmap_64 bitmap, + return 0; + } + +-static void rb_clear_bmap(ext2fs_generic_bitmap_64 bitmap) ++static void rb_clear_bmap(ext2fs_generic_bitmap bitmap) + { + struct ext2fs_rb_private *bp; + +@@ -817,7 +817,7 @@ static void rb_clear_bmap(ext2fs_generic_bitmap_64 bitmap) + check_tree(&bp->root, __func__); + } + +-static errcode_t rb_find_first_zero(ext2fs_generic_bitmap_64 bitmap, ++static errcode_t rb_find_first_zero(ext2fs_generic_bitmap bitmap, + __u64 start, __u64 end, __u64 *out) + { + struct rb_node *parent = NULL, **n; +@@ -853,7 +853,7 @@ static errcode_t rb_find_first_zero(ext2fs_generic_bitmap_64 bitmap, + return 0; + } + +-static errcode_t rb_find_first_set(ext2fs_generic_bitmap_64 bitmap, ++static errcode_t rb_find_first_set(ext2fs_generic_bitmap bitmap, + __u64 start, __u64 end, __u64 *out) + { + struct rb_node *parent = NULL, **n; +@@ -902,7 +902,7 @@ static errcode_t rb_find_first_set(ext2fs_generic_bitmap_64 bitmap, + } + + #ifdef ENABLE_BMAP_STATS +-static void rb_print_stats(ext2fs_generic_bitmap_64 bitmap) ++static void rb_print_stats(ext2fs_generic_bitmap bitmap) + { + struct ext2fs_rb_private *bp; + struct rb_node *node = NULL; +@@ -963,7 +963,7 @@ static void rb_print_stats(ext2fs_generic_bitmap_64 bitmap) + eff); + } + #else +-static void rb_print_stats(ext2fs_generic_bitmap_64 bitmap EXT2FS_ATTR((unused))) ++static void rb_print_stats(ext2fs_generic_bitmap bitmap EXT2FS_ATTR((unused))) + { + } + #endif +diff --git a/lib/ext2fs/bmap64.h b/lib/ext2fs/bmap64.h +index de334548..d8c7a3c3 100644 +--- a/lib/ext2fs/bmap64.h ++++ b/lib/ext2fs/bmap64.h +@@ -37,7 +37,7 @@ struct ext2_bmap_statistics { + }; + + +-struct ext2fs_struct_generic_bitmap_64 { ++struct ext2fs_struct_generic_bitmap { + errcode_t magic; + ext2_filsys fs; + struct ext2_bitmap_ops *bitmap_ops; +@@ -53,8 +53,6 @@ struct ext2fs_struct_generic_bitmap_64 { + #endif + }; + +-typedef struct ext2fs_struct_generic_bitmap_64 *ext2fs_generic_bitmap_64; +- + #define EXT2FS_IS_32_BITMAP(bmap) \ + (((bmap)->magic == EXT2_ET_MAGIC_GENERIC_BITMAP) || \ + ((bmap)->magic == EXT2_ET_MAGIC_BLOCK_BITMAP) || \ +@@ -68,37 +66,37 @@ typedef struct ext2fs_struct_generic_bitmap_64 *ext2fs_generic_bitmap_64; + struct ext2_bitmap_ops { + int type; + /* Generic bmap operators */ +- errcode_t (*new_bmap)(ext2_filsys fs, ext2fs_generic_bitmap_64 bmap); +- void (*free_bmap)(ext2fs_generic_bitmap_64 bitmap); +- errcode_t (*copy_bmap)(ext2fs_generic_bitmap_64 src, +- ext2fs_generic_bitmap_64 dest); +- errcode_t (*resize_bmap)(ext2fs_generic_bitmap_64 bitmap, ++ errcode_t (*new_bmap)(ext2_filsys fs, ext2fs_generic_bitmap bmap); ++ void (*free_bmap)(ext2fs_generic_bitmap bitmap); ++ errcode_t (*copy_bmap)(ext2fs_generic_bitmap src, ++ ext2fs_generic_bitmap dest); ++ errcode_t (*resize_bmap)(ext2fs_generic_bitmap bitmap, + __u64 new_end, + __u64 new_real_end); + /* bit set/test operators */ +- int (*mark_bmap)(ext2fs_generic_bitmap_64 bitmap, __u64 arg); +- int (*unmark_bmap)(ext2fs_generic_bitmap_64 bitmap, __u64 arg); +- int (*test_bmap)(ext2fs_generic_bitmap_64 bitmap, __u64 arg); +- void (*mark_bmap_extent)(ext2fs_generic_bitmap_64 bitmap, __u64 arg, ++ int (*mark_bmap)(ext2fs_generic_bitmap bitmap, __u64 arg); ++ int (*unmark_bmap)(ext2fs_generic_bitmap bitmap, __u64 arg); ++ int (*test_bmap)(ext2fs_generic_bitmap bitmap, __u64 arg); ++ void (*mark_bmap_extent)(ext2fs_generic_bitmap bitmap, __u64 arg, + unsigned int num); +- void (*unmark_bmap_extent)(ext2fs_generic_bitmap_64 bitmap, __u64 arg, ++ void (*unmark_bmap_extent)(ext2fs_generic_bitmap bitmap, __u64 arg, + unsigned int num); +- int (*test_clear_bmap_extent)(ext2fs_generic_bitmap_64 bitmap, ++ int (*test_clear_bmap_extent)(ext2fs_generic_bitmap bitmap, + __u64 arg, unsigned int num); +- errcode_t (*set_bmap_range)(ext2fs_generic_bitmap_64 bitmap, ++ errcode_t (*set_bmap_range)(ext2fs_generic_bitmap bitmap, + __u64 start, size_t num, void *in); +- errcode_t (*get_bmap_range)(ext2fs_generic_bitmap_64 bitmap, ++ errcode_t (*get_bmap_range)(ext2fs_generic_bitmap bitmap, + __u64 start, size_t num, void *out); +- void (*clear_bmap)(ext2fs_generic_bitmap_64 bitmap); +- void (*print_stats)(ext2fs_generic_bitmap_64); ++ void (*clear_bmap)(ext2fs_generic_bitmap bitmap); ++ void (*print_stats)(ext2fs_generic_bitmap); + + /* Find the first zero bit between start and end, inclusive. + * May be NULL, in which case a generic function is used. */ +- errcode_t (*find_first_zero)(ext2fs_generic_bitmap_64 bitmap, ++ errcode_t (*find_first_zero)(ext2fs_generic_bitmap bitmap, + __u64 start, __u64 end, __u64 *out); + /* Find the first set bit between start and end, inclusive. + * May be NULL, in which case a generic function is used. */ +- errcode_t (*find_first_set)(ext2fs_generic_bitmap_64 bitmap, ++ errcode_t (*find_first_set)(ext2fs_generic_bitmap bitmap, + __u64 start, __u64 end, __u64 *out); + }; + +diff --git a/lib/ext2fs/ext2fs.h b/lib/ext2fs/ext2fs.h +index 4b7c836a..ba83534c 100644 +--- a/lib/ext2fs/ext2fs.h ++++ b/lib/ext2fs/ext2fs.h +@@ -111,14 +111,9 @@ typedef struct struct_ext2_filsys *ext2_filsys; + #define EXT2FS_UNMARK_ERROR 1 + #define EXT2FS_TEST_ERROR 2 + +-struct ext2fs_struct_generic_bitmap_base { +- errcode_t magic; +- ext2_filsys fs; +-}; +- +-typedef struct ext2fs_struct_generic_bitmap_base *ext2fs_generic_bitmap; +-typedef struct ext2fs_struct_generic_bitmap_base *ext2fs_inode_bitmap; +-typedef struct ext2fs_struct_generic_bitmap_base *ext2fs_block_bitmap; ++typedef struct ext2fs_struct_generic_bitmap *ext2fs_generic_bitmap; ++typedef struct ext2fs_struct_generic_bitmap *ext2fs_inode_bitmap; ++typedef struct ext2fs_struct_generic_bitmap *ext2fs_block_bitmap; + + #define EXT2_FIRST_INODE(s) EXT2_FIRST_INO(s) + +diff --git a/lib/ext2fs/gen_bitmap.c b/lib/ext2fs/gen_bitmap.c +index 1536d4b3..b545ed7f 100644 +--- a/lib/ext2fs/gen_bitmap.c ++++ b/lib/ext2fs/gen_bitmap.c +@@ -28,7 +28,7 @@ + #include "ext2_fs.h" + #include "ext2fsP.h" + +-struct ext2fs_struct_generic_bitmap_32 { ++struct ext2fs_struct_generic_bitmap { + errcode_t magic; + ext2_filsys fs; + __u32 start, end; +@@ -39,8 +39,6 @@ struct ext2fs_struct_generic_bitmap_32 { + __u32 reserved[7]; + }; + +-typedef struct ext2fs_struct_generic_bitmap_32 *ext2fs_generic_bitmap_32; +- + #define EXT2FS_IS_32_BITMAP(bmap) \ + (((bmap)->magic == EXT2_ET_MAGIC_GENERIC_BITMAP) || \ + ((bmap)->magic == EXT2_ET_MAGIC_BLOCK_BITMAP) || \ +@@ -55,11 +53,9 @@ typedef struct ext2fs_struct_generic_bitmap_32 *ext2fs_generic_bitmap_32; + * Used by previously inlined function, so we have to export this and + * not change the function signature + */ +-void ext2fs_warn_bitmap2(ext2fs_generic_bitmap gen_bitmap, ++void ext2fs_warn_bitmap2(ext2fs_generic_bitmap bitmap, + int code, unsigned long arg) + { +- ext2fs_generic_bitmap_32 bitmap = (ext2fs_generic_bitmap_32) gen_bitmap; +- + #ifndef OMIT_COM_ERR + if (bitmap->description) + com_err(0, bitmap->base_error_code+code, +@@ -83,11 +79,11 @@ errcode_t ext2fs_make_generic_bitmap(errcode_t magic, ext2_filsys fs, + const char *descr, char *init_map, + ext2fs_generic_bitmap *ret) + { +- ext2fs_generic_bitmap_32 bitmap; ++ ext2fs_generic_bitmap bitmap; + errcode_t retval; + size_t size; + +- retval = ext2fs_get_mem(sizeof(struct ext2fs_struct_generic_bitmap_32), ++ retval = ext2fs_get_mem(sizeof(struct ext2fs_struct_generic_bitmap), + &bitmap); + if (retval) + return retval; +@@ -131,7 +127,7 @@ errcode_t ext2fs_make_generic_bitmap(errcode_t magic, ext2_filsys fs, + memcpy(bitmap->bitmap, init_map, size); + else + memset(bitmap->bitmap, 0, size); +- *ret = (ext2fs_generic_bitmap) bitmap; ++ *ret = bitmap; + return 0; + } + +@@ -145,11 +141,9 @@ errcode_t ext2fs_allocate_generic_bitmap(__u32 start, + start, end, real_end, descr, 0, ret); + } + +-errcode_t ext2fs_copy_generic_bitmap(ext2fs_generic_bitmap gen_src, ++errcode_t ext2fs_copy_generic_bitmap(ext2fs_generic_bitmap src, + ext2fs_generic_bitmap *dest) + { +- ext2fs_generic_bitmap_32 src = (ext2fs_generic_bitmap_32) gen_src; +- + return (ext2fs_make_generic_bitmap(src->magic, src->fs, + src->start, src->end, + src->real_end, +@@ -157,11 +151,9 @@ errcode_t ext2fs_copy_generic_bitmap(ext2fs_generic_bitmap gen_src, + dest)); + } + +-void ext2fs_free_generic_bitmap(ext2fs_inode_bitmap gen_bitmap) ++void ext2fs_free_generic_bitmap(ext2fs_inode_bitmap bitmap) + { +- ext2fs_generic_bitmap_32 bitmap = (ext2fs_generic_bitmap_32) gen_bitmap; +- +- if (check_magic(gen_bitmap)) ++ if (check_magic(bitmap)) + return; + + bitmap->magic = 0; +@@ -179,8 +171,6 @@ void ext2fs_free_generic_bitmap(ext2fs_inode_bitmap gen_bitmap) + int ext2fs_test_generic_bitmap(ext2fs_generic_bitmap bitmap, + blk_t bitno) + { +- ext2fs_generic_bitmap_32 bitmap32 = (ext2fs_generic_bitmap_32) bitmap; +- + if (!EXT2FS_IS_32_BITMAP(bitmap)) { + if (EXT2FS_IS_64_BITMAP(bitmap)) { + ext2fs_warn_bitmap32(bitmap, __func__); +@@ -193,18 +183,16 @@ int ext2fs_test_generic_bitmap(ext2fs_generic_bitmap bitmap, + return 0; + } + +- if ((bitno < bitmap32->start) || (bitno > bitmap32->end)) { ++ if ((bitno < bitmap->start) || (bitno > bitmap->end)) { + ext2fs_warn_bitmap2(bitmap, EXT2FS_TEST_ERROR, bitno); + return 0; + } +- return ext2fs_test_bit(bitno - bitmap32->start, bitmap32->bitmap); ++ return ext2fs_test_bit(bitno - bitmap->start, bitmap->bitmap); + } + + int ext2fs_mark_generic_bitmap(ext2fs_generic_bitmap bitmap, + __u32 bitno) + { +- ext2fs_generic_bitmap_32 bitmap32 = (ext2fs_generic_bitmap_32) bitmap; +- + if (!EXT2FS_IS_32_BITMAP(bitmap)) { + if (EXT2FS_IS_64_BITMAP(bitmap)) { + ext2fs_warn_bitmap32(bitmap, __func__); +@@ -217,18 +205,16 @@ int ext2fs_mark_generic_bitmap(ext2fs_generic_bitmap bitmap, + return 0; + } + +- if ((bitno < bitmap32->start) || (bitno > bitmap32->end)) { ++ if ((bitno < bitmap->start) || (bitno > bitmap->end)) { + ext2fs_warn_bitmap2(bitmap, EXT2FS_MARK_ERROR, bitno); + return 0; + } +- return ext2fs_set_bit(bitno - bitmap32->start, bitmap32->bitmap); ++ return ext2fs_set_bit(bitno - bitmap->start, bitmap->bitmap); + } + + int ext2fs_unmark_generic_bitmap(ext2fs_generic_bitmap bitmap, + blk_t bitno) + { +- ext2fs_generic_bitmap_32 bitmap32 = (ext2fs_generic_bitmap_32) bitmap; +- + if (!EXT2FS_IS_32_BITMAP(bitmap)) { + if (EXT2FS_IS_64_BITMAP(bitmap)) { + ext2fs_warn_bitmap32(bitmap, __func__); +@@ -241,17 +227,15 @@ int ext2fs_unmark_generic_bitmap(ext2fs_generic_bitmap bitmap, + return 0; + } + +- if ((bitno < bitmap32->start) || (bitno > bitmap32->end)) { ++ if ((bitno < bitmap->start) || (bitno > bitmap->end)) { + ext2fs_warn_bitmap2(bitmap, EXT2FS_UNMARK_ERROR, bitno); + return 0; + } +- return ext2fs_clear_bit(bitno - bitmap32->start, bitmap32->bitmap); ++ return ext2fs_clear_bit(bitno - bitmap->start, bitmap->bitmap); + } + + __u32 ext2fs_get_generic_bitmap_start(ext2fs_generic_bitmap bitmap) + { +- ext2fs_generic_bitmap_32 bitmap32 = (ext2fs_generic_bitmap_32) bitmap; +- + if (!EXT2FS_IS_32_BITMAP(bitmap)) { + if (EXT2FS_IS_64_BITMAP(bitmap)) { + ext2fs_warn_bitmap32(bitmap, __func__); +@@ -264,13 +248,11 @@ __u32 ext2fs_get_generic_bitmap_start(ext2fs_generic_bitmap bitmap) + return 0; + } + +- return bitmap32->start; ++ return bitmap->start; + } + + __u32 ext2fs_get_generic_bitmap_end(ext2fs_generic_bitmap bitmap) + { +- ext2fs_generic_bitmap_32 bitmap32 = (ext2fs_generic_bitmap_32) bitmap; +- + if (!EXT2FS_IS_32_BITMAP(bitmap)) { + if (EXT2FS_IS_64_BITMAP(bitmap)) { + ext2fs_warn_bitmap32(bitmap, __func__); +@@ -282,13 +264,11 @@ __u32 ext2fs_get_generic_bitmap_end(ext2fs_generic_bitmap bitmap) + #endif + return 0; + } +- return bitmap32->end; ++ return bitmap->end; + } + + void ext2fs_clear_generic_bitmap(ext2fs_generic_bitmap bitmap) + { +- ext2fs_generic_bitmap_32 bitmap32 = (ext2fs_generic_bitmap_32) bitmap; +- + if (!EXT2FS_IS_32_BITMAP(bitmap)) { + if (EXT2FS_IS_64_BITMAP(bitmap)) { + ext2fs_warn_bitmap32(bitmap, __func__); +@@ -302,16 +282,14 @@ void ext2fs_clear_generic_bitmap(ext2fs_generic_bitmap bitmap) + return; + } + +- memset(bitmap32->bitmap, 0, +- (size_t) (((bitmap32->real_end - bitmap32->start) / 8) + 1)); ++ memset(bitmap->bitmap, 0, ++ (size_t) (((bitmap->real_end - bitmap->start) / 8) + 1)); + } + +-errcode_t ext2fs_fudge_generic_bitmap_end(ext2fs_inode_bitmap gen_bitmap, ++errcode_t ext2fs_fudge_generic_bitmap_end(ext2fs_inode_bitmap bitmap, + errcode_t magic, errcode_t neq, + ext2_ino_t end, ext2_ino_t *oend) + { +- ext2fs_generic_bitmap_32 bitmap = (ext2fs_generic_bitmap_32) gen_bitmap; +- + EXT2_CHECK_MAGIC(bitmap, magic); + + if (end > bitmap->real_end) +@@ -324,9 +302,8 @@ errcode_t ext2fs_fudge_generic_bitmap_end(ext2fs_inode_bitmap gen_bitmap, + + errcode_t ext2fs_resize_generic_bitmap(errcode_t magic, + __u32 new_end, __u32 new_real_end, +- ext2fs_generic_bitmap gen_bmap) ++ ext2fs_generic_bitmap bmap) + { +- ext2fs_generic_bitmap_32 bmap = (ext2fs_generic_bitmap_32) gen_bmap; + errcode_t retval; + size_t size, new_size; + __u32 bitno; +@@ -367,11 +344,9 @@ errcode_t ext2fs_resize_generic_bitmap(errcode_t magic, + } + + errcode_t ext2fs_compare_generic_bitmap(errcode_t magic, errcode_t neq, +- ext2fs_generic_bitmap gen_bm1, +- ext2fs_generic_bitmap gen_bm2) ++ ext2fs_generic_bitmap bm1, ++ ext2fs_generic_bitmap bm2) + { +- ext2fs_generic_bitmap_32 bm1 = (ext2fs_generic_bitmap_32) gen_bm1; +- ext2fs_generic_bitmap_32 bm2 = (ext2fs_generic_bitmap_32) gen_bm2; + blk_t i; + + if (!bm1 || bm1->magic != magic) +@@ -386,16 +361,15 @@ errcode_t ext2fs_compare_generic_bitmap(errcode_t magic, errcode_t neq, + return neq; + + for (i = bm1->end - ((bm1->end - bm1->start) % 8); i <= bm1->end; i++) +- if (ext2fs_fast_test_block_bitmap(gen_bm1, i) != +- ext2fs_fast_test_block_bitmap(gen_bm2, i)) ++ if (ext2fs_fast_test_block_bitmap(bm1, i) != ++ ext2fs_fast_test_block_bitmap(bm2, i)) + return neq; + + return 0; + } + +-void ext2fs_set_generic_bitmap_padding(ext2fs_generic_bitmap gen_map) ++void ext2fs_set_generic_bitmap_padding(ext2fs_generic_bitmap map) + { +- ext2fs_generic_bitmap_32 map = (ext2fs_generic_bitmap_32) gen_map; + __u32 i, j; + + /* Protect loop from wrap-around if map->real_end is maxed */ +@@ -405,13 +379,11 @@ void ext2fs_set_generic_bitmap_padding(ext2fs_generic_bitmap gen_map) + ext2fs_set_bit(j, map->bitmap); + } + +-errcode_t ext2fs_get_generic_bitmap_range(ext2fs_generic_bitmap gen_bmap, ++errcode_t ext2fs_get_generic_bitmap_range(ext2fs_generic_bitmap bmap, + errcode_t magic, + __u32 start, __u32 num, + void *out) + { +- ext2fs_generic_bitmap_32 bmap = (ext2fs_generic_bitmap_32) gen_bmap; +- + if (!bmap || (bmap->magic != magic)) + return magic; + +@@ -422,13 +394,11 @@ errcode_t ext2fs_get_generic_bitmap_range(ext2fs_generic_bitmap gen_bmap, + return 0; + } + +-errcode_t ext2fs_set_generic_bitmap_range(ext2fs_generic_bitmap gen_bmap, ++errcode_t ext2fs_set_generic_bitmap_range(ext2fs_generic_bitmap bmap, + errcode_t magic, + __u32 start, __u32 num, + void *in) + { +- ext2fs_generic_bitmap_32 bmap = (ext2fs_generic_bitmap_32) gen_bmap; +- + if (!bmap || (bmap->magic != magic)) + return magic; + +@@ -462,11 +432,10 @@ int ext2fs_mem_is_zero(const char *mem, size_t len) + /* + * Return true if all of the bits in a specified range are clear + */ +-static int ext2fs_test_clear_generic_bitmap_range(ext2fs_generic_bitmap gen_bitmap, ++static int ext2fs_test_clear_generic_bitmap_range(ext2fs_generic_bitmap bitmap, + unsigned int start, + unsigned int len) + { +- ext2fs_generic_bitmap_32 bitmap = (ext2fs_generic_bitmap_32) gen_bitmap; + size_t start_byte, len_byte = len >> 3; + unsigned int start_bit, len_bit = len % 8; + int first_bit = 0; +@@ -535,15 +504,14 @@ static int ext2fs_test_clear_generic_bitmap_range(ext2fs_generic_bitmap gen_bitm + return ext2fs_mem_is_zero(ADDR + start_byte, len_byte); + } + +-errcode_t ext2fs_find_first_zero_generic_bitmap(ext2fs_generic_bitmap gen_bitmap, ++errcode_t ext2fs_find_first_zero_generic_bitmap(ext2fs_generic_bitmap bitmap, + __u32 start, __u32 end, + __u32 *out) + { +- ext2fs_generic_bitmap_32 bitmap = (ext2fs_generic_bitmap_32) gen_bitmap; + blk_t b; + + if (start < bitmap->start || end > bitmap->end || start > end) { +- ext2fs_warn_bitmap2(gen_bitmap, EXT2FS_TEST_ERROR, start); ++ ext2fs_warn_bitmap2(bitmap, EXT2FS_TEST_ERROR, start); + return EINVAL; + } + +@@ -559,15 +527,14 @@ errcode_t ext2fs_find_first_zero_generic_bitmap(ext2fs_generic_bitmap gen_bitmap + return ENOENT; + } + +-errcode_t ext2fs_find_first_set_generic_bitmap(ext2fs_generic_bitmap gen_bitmap, ++errcode_t ext2fs_find_first_set_generic_bitmap(ext2fs_generic_bitmap bitmap, + __u32 start, __u32 end, + __u32 *out) + { +- ext2fs_generic_bitmap_32 bitmap = (ext2fs_generic_bitmap_32) gen_bitmap; + blk_t b; + + if (start < bitmap->start || end > bitmap->end || start > end) { +- ext2fs_warn_bitmap2(gen_bitmap, EXT2FS_TEST_ERROR, start); ++ ext2fs_warn_bitmap2(bitmap, EXT2FS_TEST_ERROR, start); + return EINVAL; + } + +@@ -583,11 +550,9 @@ errcode_t ext2fs_find_first_set_generic_bitmap(ext2fs_generic_bitmap gen_bitmap, + return ENOENT; + } + +-int ext2fs_test_block_bitmap_range(ext2fs_block_bitmap gen_bitmap, ++int ext2fs_test_block_bitmap_range(ext2fs_block_bitmap bitmap, + blk_t block, int num) + { +- ext2fs_generic_bitmap_32 bitmap = (ext2fs_generic_bitmap_32) gen_bitmap; +- + EXT2_CHECK_MAGIC(bitmap, EXT2_ET_MAGIC_BLOCK_BITMAP); + if ((block < bitmap->start) || (block > bitmap->real_end) || + (block+num-1 > bitmap->real_end)) { +@@ -599,11 +564,9 @@ int ext2fs_test_block_bitmap_range(ext2fs_block_bitmap gen_bitmap, + bitmap, block, num); + } + +-int ext2fs_test_inode_bitmap_range(ext2fs_inode_bitmap gen_bitmap, ++int ext2fs_test_inode_bitmap_range(ext2fs_inode_bitmap bitmap, + ext2_ino_t inode, int num) + { +- ext2fs_generic_bitmap_32 bitmap = (ext2fs_generic_bitmap_32) gen_bitmap; +- + EXT2_CHECK_MAGIC(bitmap, EXT2_ET_MAGIC_INODE_BITMAP); + if ((inode < bitmap->start) || (inode > bitmap->real_end) || + (inode+num-1 > bitmap->real_end)) { +@@ -615,10 +578,9 @@ int ext2fs_test_inode_bitmap_range(ext2fs_inode_bitmap gen_bitmap, + bitmap, inode, num); + } + +-void ext2fs_mark_block_bitmap_range(ext2fs_block_bitmap gen_bitmap, ++void ext2fs_mark_block_bitmap_range(ext2fs_block_bitmap bitmap, + blk_t block, int num) + { +- ext2fs_generic_bitmap_32 bitmap = (ext2fs_generic_bitmap_32) gen_bitmap; + int i; + + if ((block < bitmap->start) || (block > bitmap->end) || +@@ -631,10 +593,9 @@ void ext2fs_mark_block_bitmap_range(ext2fs_block_bitmap gen_bitmap, + ext2fs_fast_set_bit(block + i - bitmap->start, bitmap->bitmap); + } + +-void ext2fs_unmark_block_bitmap_range(ext2fs_block_bitmap gen_bitmap, +- blk_t block, int num) ++void ext2fs_unmark_block_bitmap_range(ext2fs_block_bitmap bitmap, ++ blk_t block, int num) + { +- ext2fs_generic_bitmap_32 bitmap = (ext2fs_generic_bitmap_32) gen_bitmap; + int i; + + if ((block < bitmap->start) || (block > bitmap->end) || +diff --git a/lib/ext2fs/gen_bitmap64.c b/lib/ext2fs/gen_bitmap64.c +index 6e4d8b71..47ba2baf 100644 +--- a/lib/ext2fs/gen_bitmap64.c ++++ b/lib/ext2fs/gen_bitmap64.c +@@ -68,7 +68,7 @@ + * e2fsck can request an encoding which is optimized for that. + */ + +-static void warn_bitmap(ext2fs_generic_bitmap_64 bitmap, ++static void warn_bitmap(ext2fs_generic_bitmap bitmap, + int code, __u64 arg) + { + #ifndef OMIT_COM_ERR +@@ -93,7 +93,7 @@ errcode_t ext2fs_alloc_generic_bmap(ext2_filsys fs, errcode_t magic, + const char *descr, + ext2fs_generic_bitmap *ret) + { +- ext2fs_generic_bitmap_64 bitmap; ++ ext2fs_generic_bitmap bitmap; + struct ext2_bitmap_ops *ops; + ext2_ino_t num_dirs; + errcode_t retval; +@@ -119,7 +119,7 @@ errcode_t ext2fs_alloc_generic_bmap(ext2_filsys fs, errcode_t magic, + return EINVAL; + } + +- retval = ext2fs_get_memzero(sizeof(struct ext2fs_struct_generic_bitmap_64), ++ retval = ext2fs_get_memzero(sizeof(struct ext2fs_struct_generic_bitmap), + &bitmap); + if (retval) + return retval; +@@ -170,12 +170,12 @@ errcode_t ext2fs_alloc_generic_bmap(ext2_filsys fs, errcode_t magic, + return retval; + } + +- *ret = (ext2fs_generic_bitmap) bitmap; ++ *ret = bitmap; + return 0; + } + + #ifdef ENABLE_BMAP_STATS +-static void ext2fs_print_bmap_statistics(ext2fs_generic_bitmap_64 bitmap) ++static void ext2fs_print_bmap_statistics(ext2fs_generic_bitmap bitmap) + { + struct ext2_bmap_statistics *stats = &bitmap->stats; + #ifdef ENABLE_BMAP_STATS_OPS +@@ -241,15 +241,13 @@ static void ext2fs_print_bmap_statistics(ext2fs_generic_bitmap_64 bitmap) + } + #endif + +-void ext2fs_free_generic_bmap(ext2fs_generic_bitmap gen_bmap) ++void ext2fs_free_generic_bmap(ext2fs_generic_bitmap bmap) + { +- ext2fs_generic_bitmap_64 bmap = (ext2fs_generic_bitmap_64) gen_bmap; +- + if (!bmap) + return; + + if (EXT2FS_IS_32_BITMAP(bmap)) { +- ext2fs_free_generic_bitmap(gen_bmap); ++ ext2fs_free_generic_bitmap(bmap); + return; + } + +@@ -273,25 +271,24 @@ void ext2fs_free_generic_bmap(ext2fs_generic_bitmap gen_bmap) + ext2fs_free_mem(&bmap); + } + +-errcode_t ext2fs_copy_generic_bmap(ext2fs_generic_bitmap gen_src, ++errcode_t ext2fs_copy_generic_bmap(ext2fs_generic_bitmap src, + ext2fs_generic_bitmap *dest) + { +- ext2fs_generic_bitmap_64 src = (ext2fs_generic_bitmap_64) gen_src; + char *descr, *new_descr; +- ext2fs_generic_bitmap_64 new_bmap; ++ ext2fs_generic_bitmap new_bmap; + errcode_t retval; + + if (!src) + return EINVAL; + + if (EXT2FS_IS_32_BITMAP(src)) +- return ext2fs_copy_generic_bitmap(gen_src, dest); ++ return ext2fs_copy_generic_bitmap(src, dest); + + if (!EXT2FS_IS_64_BITMAP(src)) + return EINVAL; + + /* Allocate a new bitmap struct */ +- retval = ext2fs_get_memzero(sizeof(struct ext2fs_struct_generic_bitmap_64), ++ retval = ext2fs_get_memzero(sizeof(struct ext2fs_struct_generic_bitmap), + &new_bmap); + if (retval) + return retval; +@@ -339,23 +336,21 @@ errcode_t ext2fs_copy_generic_bmap(ext2fs_generic_bitmap gen_src, + return retval; + } + +- *dest = (ext2fs_generic_bitmap) new_bmap; ++ *dest = new_bmap; + + return 0; + } + +-errcode_t ext2fs_resize_generic_bmap(ext2fs_generic_bitmap gen_bmap, ++errcode_t ext2fs_resize_generic_bmap(ext2fs_generic_bitmap bmap, + __u64 new_end, + __u64 new_real_end) + { +- ext2fs_generic_bitmap_64 bmap = (ext2fs_generic_bitmap_64) gen_bmap; +- + if (!bmap) + return EINVAL; + + if (EXT2FS_IS_32_BITMAP(bmap)) +- return ext2fs_resize_generic_bitmap(gen_bmap->magic, new_end, +- new_real_end, gen_bmap); ++ return ext2fs_resize_generic_bitmap(bmap->magic, new_end, ++ new_real_end, bmap); + + if (!EXT2FS_IS_64_BITMAP(bmap)) + return EINVAL; +@@ -365,12 +360,10 @@ errcode_t ext2fs_resize_generic_bmap(ext2fs_generic_bitmap gen_bmap, + return bmap->bitmap_ops->resize_bmap(bmap, new_end, new_real_end); + } + +-errcode_t ext2fs_fudge_generic_bmap_end(ext2fs_generic_bitmap gen_bitmap, ++errcode_t ext2fs_fudge_generic_bmap_end(ext2fs_generic_bitmap bitmap, + errcode_t neq, + __u64 end, __u64 *oend) + { +- ext2fs_generic_bitmap_64 bitmap = (ext2fs_generic_bitmap_64) gen_bitmap; +- + if (!bitmap) + return EINVAL; + +@@ -378,8 +371,7 @@ errcode_t ext2fs_fudge_generic_bmap_end(ext2fs_generic_bitmap gen_bitmap, + ext2_ino_t tmp_oend; + int retval; + +- retval = ext2fs_fudge_generic_bitmap_end(gen_bitmap, +- bitmap->magic, ++ retval = ext2fs_fudge_generic_bitmap_end(bitmap, bitmap->magic, + neq, end, &tmp_oend); + if (oend) + *oend = tmp_oend; +@@ -397,15 +389,13 @@ errcode_t ext2fs_fudge_generic_bmap_end(ext2fs_generic_bitmap gen_bitmap, + return 0; + } + +-__u64 ext2fs_get_generic_bmap_start(ext2fs_generic_bitmap gen_bitmap) ++__u64 ext2fs_get_generic_bmap_start(ext2fs_generic_bitmap bitmap) + { +- ext2fs_generic_bitmap_64 bitmap = (ext2fs_generic_bitmap_64) gen_bitmap; +- + if (!bitmap) + return EINVAL; + + if (EXT2FS_IS_32_BITMAP(bitmap)) +- return ext2fs_get_generic_bitmap_start(gen_bitmap); ++ return ext2fs_get_generic_bitmap_start(bitmap); + + if (!EXT2FS_IS_64_BITMAP(bitmap)) + return EINVAL; +@@ -413,15 +403,13 @@ __u64 ext2fs_get_generic_bmap_start(ext2fs_generic_bitmap gen_bitmap) + return bitmap->start; + } + +-__u64 ext2fs_get_generic_bmap_end(ext2fs_generic_bitmap gen_bitmap) ++__u64 ext2fs_get_generic_bmap_end(ext2fs_generic_bitmap bitmap) + { +- ext2fs_generic_bitmap_64 bitmap = (ext2fs_generic_bitmap_64) gen_bitmap; +- + if (!bitmap) + return EINVAL; + + if (EXT2FS_IS_32_BITMAP(bitmap)) +- return ext2fs_get_generic_bitmap_end(gen_bitmap); ++ return ext2fs_get_generic_bitmap_end(bitmap); + + if (!EXT2FS_IS_64_BITMAP(bitmap)) + return EINVAL; +@@ -429,31 +417,27 @@ __u64 ext2fs_get_generic_bmap_end(ext2fs_generic_bitmap gen_bitmap) + return bitmap->end; + } + +-void ext2fs_clear_generic_bmap(ext2fs_generic_bitmap gen_bitmap) ++void ext2fs_clear_generic_bmap(ext2fs_generic_bitmap bitmap) + { +- ext2fs_generic_bitmap_64 bitmap = (ext2fs_generic_bitmap_64) gen_bitmap; +- + if (EXT2FS_IS_32_BITMAP(bitmap)) +- ext2fs_clear_generic_bitmap(gen_bitmap); ++ ext2fs_clear_generic_bitmap(bitmap); + else +- bitmap->bitmap_ops->clear_bmap(bitmap); ++ bitmap->bitmap_ops->clear_bmap (bitmap); + } + +-int ext2fs_mark_generic_bmap(ext2fs_generic_bitmap gen_bitmap, ++int ext2fs_mark_generic_bmap(ext2fs_generic_bitmap bitmap, + __u64 arg) + { +- ext2fs_generic_bitmap_64 bitmap = (ext2fs_generic_bitmap_64) gen_bitmap; +- + if (!bitmap) + return 0; + + if (EXT2FS_IS_32_BITMAP(bitmap)) { + if (arg & ~0xffffffffULL) { +- ext2fs_warn_bitmap2(gen_bitmap, ++ ext2fs_warn_bitmap2(bitmap, + EXT2FS_MARK_ERROR, 0xffffffff); + return 0; + } +- return ext2fs_mark_generic_bitmap(gen_bitmap, arg); ++ return ext2fs_mark_generic_bitmap(bitmap, arg); + } + + if (!EXT2FS_IS_64_BITMAP(bitmap)) +@@ -478,21 +462,19 @@ int ext2fs_mark_generic_bmap(ext2fs_generic_bitmap gen_bitmap, + return bitmap->bitmap_ops->mark_bmap(bitmap, arg); + } + +-int ext2fs_unmark_generic_bmap(ext2fs_generic_bitmap gen_bitmap, ++int ext2fs_unmark_generic_bmap(ext2fs_generic_bitmap bitmap, + __u64 arg) + { +- ext2fs_generic_bitmap_64 bitmap = (ext2fs_generic_bitmap_64) gen_bitmap; +- + if (!bitmap) + return 0; + + if (EXT2FS_IS_32_BITMAP(bitmap)) { + if (arg & ~0xffffffffULL) { +- ext2fs_warn_bitmap2(gen_bitmap, EXT2FS_UNMARK_ERROR, ++ ext2fs_warn_bitmap2(bitmap, EXT2FS_UNMARK_ERROR, + 0xffffffff); + return 0; + } +- return ext2fs_unmark_generic_bitmap(gen_bitmap, arg); ++ return ext2fs_unmark_generic_bitmap(bitmap, arg); + } + + if (!EXT2FS_IS_64_BITMAP(bitmap)) +@@ -510,20 +492,19 @@ int ext2fs_unmark_generic_bmap(ext2fs_generic_bitmap gen_bitmap, + return bitmap->bitmap_ops->unmark_bmap(bitmap, arg); + } + +-int ext2fs_test_generic_bmap(ext2fs_generic_bitmap gen_bitmap, ++int ext2fs_test_generic_bmap(ext2fs_generic_bitmap bitmap, + __u64 arg) + { +- ext2fs_generic_bitmap_64 bitmap = (ext2fs_generic_bitmap_64) gen_bitmap; + if (!bitmap) + return 0; + + if (EXT2FS_IS_32_BITMAP(bitmap)) { + if (arg & ~0xffffffffULL) { +- ext2fs_warn_bitmap2(gen_bitmap, EXT2FS_TEST_ERROR, ++ ext2fs_warn_bitmap2(bitmap, EXT2FS_TEST_ERROR, + 0xffffffff); + return 0; + } +- return ext2fs_test_generic_bitmap(gen_bitmap, arg); ++ return ext2fs_test_generic_bitmap(bitmap, arg); + } + + if (!EXT2FS_IS_64_BITMAP(bitmap)) +@@ -548,22 +529,20 @@ int ext2fs_test_generic_bmap(ext2fs_generic_bitmap gen_bitmap, + return bitmap->bitmap_ops->test_bmap(bitmap, arg); + } + +-errcode_t ext2fs_set_generic_bmap_range(ext2fs_generic_bitmap gen_bmap, ++errcode_t ext2fs_set_generic_bmap_range(ext2fs_generic_bitmap bmap, + __u64 start, unsigned int num, + void *in) + { +- ext2fs_generic_bitmap_64 bmap = (ext2fs_generic_bitmap_64) gen_bmap; +- + if (!bmap) + return EINVAL; + + if (EXT2FS_IS_32_BITMAP(bmap)) { + if ((start+num-1) & ~0xffffffffULL) { +- ext2fs_warn_bitmap2(gen_bmap, EXT2FS_UNMARK_ERROR, ++ ext2fs_warn_bitmap2(bmap, EXT2FS_UNMARK_ERROR, + 0xffffffff); + return EINVAL; + } +- return ext2fs_set_generic_bitmap_range(gen_bmap, bmap->magic, ++ return ext2fs_set_generic_bitmap_range(bmap, bmap->magic, + start, num, in); + } + +@@ -575,22 +554,20 @@ errcode_t ext2fs_set_generic_bmap_range(ext2fs_generic_bitmap gen_bmap, + return bmap->bitmap_ops->set_bmap_range(bmap, start, num, in); + } + +-errcode_t ext2fs_get_generic_bmap_range(ext2fs_generic_bitmap gen_bmap, ++errcode_t ext2fs_get_generic_bmap_range(ext2fs_generic_bitmap bmap, + __u64 start, unsigned int num, + void *out) + { +- ext2fs_generic_bitmap_64 bmap = (ext2fs_generic_bitmap_64) gen_bmap; +- + if (!bmap) + return EINVAL; + + if (EXT2FS_IS_32_BITMAP(bmap)) { + if ((start+num-1) & ~0xffffffffULL) { +- ext2fs_warn_bitmap2(gen_bmap, ++ ext2fs_warn_bitmap2(bmap, + EXT2FS_UNMARK_ERROR, 0xffffffff); + return EINVAL; + } +- return ext2fs_get_generic_bitmap_range(gen_bmap, bmap->magic, ++ return ext2fs_get_generic_bitmap_range(bmap, bmap->magic, + start, num, out); + } + +@@ -603,11 +580,9 @@ errcode_t ext2fs_get_generic_bmap_range(ext2fs_generic_bitmap gen_bmap, + } + + errcode_t ext2fs_compare_generic_bmap(errcode_t neq, +- ext2fs_generic_bitmap gen_bm1, +- ext2fs_generic_bitmap gen_bm2) ++ ext2fs_generic_bitmap bm1, ++ ext2fs_generic_bitmap bm2) + { +- ext2fs_generic_bitmap_64 bm1 = (ext2fs_generic_bitmap_64) gen_bm1; +- ext2fs_generic_bitmap_64 bm2 = (ext2fs_generic_bitmap_64) gen_bm2; + blk64_t i; + + if (!bm1 || !bm2) +@@ -617,8 +592,7 @@ errcode_t ext2fs_compare_generic_bmap(errcode_t neq, + + /* Now we know both bitmaps have the same magic */ + if (EXT2FS_IS_32_BITMAP(bm1)) +- return ext2fs_compare_generic_bitmap(bm1->magic, neq, +- gen_bm1, gen_bm2); ++ return ext2fs_compare_generic_bitmap(bm1->magic, neq, bm1, bm2); + + if (!EXT2FS_IS_64_BITMAP(bm1)) + return EINVAL; +@@ -628,20 +602,19 @@ errcode_t ext2fs_compare_generic_bmap(errcode_t neq, + return neq; + + for (i = bm1->end - ((bm1->end - bm1->start) % 8); i <= bm1->end; i++) +- if (ext2fs_test_generic_bmap(gen_bm1, i) != +- ext2fs_test_generic_bmap(gen_bm2, i)) ++ if (ext2fs_test_generic_bmap(bm1, i) != ++ ext2fs_test_generic_bmap(bm2, i)) + return neq; + + return 0; + } + +-void ext2fs_set_generic_bmap_padding(ext2fs_generic_bitmap gen_bmap) ++void ext2fs_set_generic_bmap_padding(ext2fs_generic_bitmap bmap) + { +- ext2fs_generic_bitmap_64 bmap = (ext2fs_generic_bitmap_64) gen_bmap; + __u64 start, num; + + if (EXT2FS_IS_32_BITMAP(bmap)) { +- ext2fs_set_generic_bitmap_padding(gen_bmap); ++ ext2fs_set_generic_bitmap_padding(bmap); + return; + } + +@@ -651,10 +624,9 @@ void ext2fs_set_generic_bmap_padding(ext2fs_generic_bitmap gen_bmap) + /* XXX ought to warn on error */ + } + +-int ext2fs_test_block_bitmap_range2(ext2fs_block_bitmap gen_bmap, ++int ext2fs_test_block_bitmap_range2(ext2fs_block_bitmap bmap, + blk64_t block, unsigned int num) + { +- ext2fs_generic_bitmap_64 bmap = (ext2fs_generic_bitmap_64) gen_bmap; + __u64 end = block + num; + + if (!bmap) +@@ -696,10 +668,9 @@ int ext2fs_test_block_bitmap_range2(ext2fs_block_bitmap gen_bmap, + return bmap->bitmap_ops->test_clear_bmap_extent(bmap, block, num); + } + +-void ext2fs_mark_block_bitmap_range2(ext2fs_block_bitmap gen_bmap, ++void ext2fs_mark_block_bitmap_range2(ext2fs_block_bitmap bmap, + blk64_t block, unsigned int num) + { +- ext2fs_generic_bitmap_64 bmap = (ext2fs_generic_bitmap_64) gen_bmap; + __u64 end = block + num; + + if (!bmap) +@@ -737,10 +708,9 @@ void ext2fs_mark_block_bitmap_range2(ext2fs_block_bitmap gen_bmap, + bmap->bitmap_ops->mark_bmap_extent(bmap, block, num); + } + +-void ext2fs_unmark_block_bitmap_range2(ext2fs_block_bitmap gen_bmap, ++void ext2fs_unmark_block_bitmap_range2(ext2fs_block_bitmap bmap, + blk64_t block, unsigned int num) + { +- ext2fs_generic_bitmap_64 bmap = (ext2fs_generic_bitmap_64) gen_bmap; + __u64 end = block + num; + + if (!bmap) +@@ -778,10 +748,8 @@ void ext2fs_unmark_block_bitmap_range2(ext2fs_block_bitmap gen_bmap, + bmap->bitmap_ops->unmark_bmap_extent(bmap, block, num); + } + +-void ext2fs_warn_bitmap32(ext2fs_generic_bitmap gen_bitmap, const char *func) ++void ext2fs_warn_bitmap32(ext2fs_generic_bitmap bitmap, const char *func) + { +- ext2fs_generic_bitmap_64 bitmap = (ext2fs_generic_bitmap_64) gen_bitmap; +- + #ifndef OMIT_COM_ERR + if (bitmap && bitmap->description) + com_err(0, EXT2_ET_MAGIC_GENERIC_BITMAP, +@@ -796,22 +764,21 @@ void ext2fs_warn_bitmap32(ext2fs_generic_bitmap gen_bitmap, const char *func) + errcode_t ext2fs_convert_subcluster_bitmap(ext2_filsys fs, + ext2fs_block_bitmap *bitmap) + { +- ext2fs_generic_bitmap_64 bmap, cmap; +- ext2fs_block_bitmap gen_bmap = *bitmap, gen_cmap; ++ ext2fs_block_bitmap cmap, bmap; + errcode_t retval; + blk64_t i, b_end, c_end; + int n, ratio; + +- bmap = (ext2fs_generic_bitmap_64) gen_bmap; +- if (fs->cluster_ratio_bits == ext2fs_get_bitmap_granularity(gen_bmap)) ++ bmap = *bitmap; ++ ++ if (fs->cluster_ratio_bits == ext2fs_get_bitmap_granularity(bmap)) + return 0; /* Nothing to do */ + + retval = ext2fs_allocate_block_bitmap(fs, "converted cluster bitmap", +- &gen_cmap); ++ &cmap); + if (retval) + return retval; + +- cmap = (ext2fs_generic_bitmap_64) gen_cmap; + i = bmap->start; + b_end = bmap->end; + bmap->end = bmap->real_end; +@@ -820,8 +787,8 @@ errcode_t ext2fs_convert_subcluster_bitmap(ext2_filsys fs, + n = 0; + ratio = 1 << fs->cluster_ratio_bits; + while (i < bmap->real_end) { +- if (ext2fs_test_block_bitmap2(gen_bmap, i)) { +- ext2fs_mark_block_bitmap2(gen_cmap, i); ++ if (ext2fs_test_block_bitmap2(bmap, i)) { ++ ext2fs_mark_block_bitmap2(cmap, i); + i += ratio - n; + n = 0; + continue; +@@ -832,15 +799,14 @@ errcode_t ext2fs_convert_subcluster_bitmap(ext2_filsys fs, + } + bmap->end = b_end; + cmap->end = c_end; +- ext2fs_free_block_bitmap(gen_bmap); +- *bitmap = (ext2fs_block_bitmap) cmap; ++ ext2fs_free_block_bitmap(bmap); ++ *bitmap = cmap; + return 0; + } + + errcode_t ext2fs_find_first_zero_generic_bmap(ext2fs_generic_bitmap bitmap, + __u64 start, __u64 end, __u64 *out) + { +- ext2fs_generic_bitmap_64 bmap64 = (ext2fs_generic_bitmap_64) bitmap; + __u64 cstart, cend, cout; + errcode_t retval; + +@@ -866,27 +832,27 @@ errcode_t ext2fs_find_first_zero_generic_bmap(ext2fs_generic_bitmap bitmap, + if (!EXT2FS_IS_64_BITMAP(bitmap)) + return EINVAL; + +- cstart = start >> bmap64->cluster_bits; +- cend = end >> bmap64->cluster_bits; ++ cstart = start >> bitmap->cluster_bits; ++ cend = end >> bitmap->cluster_bits; + +- if (cstart < bmap64->start || cend > bmap64->end || start > end) { +- warn_bitmap(bmap64, EXT2FS_TEST_ERROR, start); ++ if (cstart < bitmap->start || cend > bitmap->end || start > end) { ++ warn_bitmap(bitmap, EXT2FS_TEST_ERROR, start); + return EINVAL; + } + +- if (bmap64->bitmap_ops->find_first_zero) { +- retval = bmap64->bitmap_ops->find_first_zero(bmap64, cstart, ++ if (bitmap->bitmap_ops->find_first_zero) { ++ retval = bitmap->bitmap_ops->find_first_zero(bitmap, cstart, + cend, &cout); + if (retval) + return retval; + found: +- cout <<= bmap64->cluster_bits; ++ cout <<= bitmap->cluster_bits; + *out = (cout >= start) ? cout : start; + return 0; + } + + for (cout = cstart; cout <= cend; cout++) +- if (!bmap64->bitmap_ops->test_bmap(bmap64, cout)) ++ if (!bitmap->bitmap_ops->test_bmap(bitmap, cout)) + goto found; + + return ENOENT; +@@ -895,7 +861,6 @@ errcode_t ext2fs_find_first_zero_generic_bmap(ext2fs_generic_bitmap bitmap, + errcode_t ext2fs_find_first_set_generic_bmap(ext2fs_generic_bitmap bitmap, + __u64 start, __u64 end, __u64 *out) + { +- ext2fs_generic_bitmap_64 bmap64 = (ext2fs_generic_bitmap_64) bitmap; + __u64 cstart, cend, cout; + errcode_t retval; + +@@ -921,27 +886,27 @@ errcode_t ext2fs_find_first_set_generic_bmap(ext2fs_generic_bitmap bitmap, + if (!EXT2FS_IS_64_BITMAP(bitmap)) + return EINVAL; + +- cstart = start >> bmap64->cluster_bits; +- cend = end >> bmap64->cluster_bits; ++ cstart = start >> bitmap->cluster_bits; ++ cend = end >> bitmap->cluster_bits; + +- if (cstart < bmap64->start || cend > bmap64->end || start > end) { +- warn_bitmap(bmap64, EXT2FS_TEST_ERROR, start); ++ if (cstart < bitmap->start || cend > bitmap->end || start > end) { ++ warn_bitmap(bitmap, EXT2FS_TEST_ERROR, start); + return EINVAL; + } + +- if (bmap64->bitmap_ops->find_first_set) { +- retval = bmap64->bitmap_ops->find_first_set(bmap64, cstart, ++ if (bitmap->bitmap_ops->find_first_set) { ++ retval = bitmap->bitmap_ops->find_first_set(bitmap, cstart, + cend, &cout); + if (retval) + return retval; + found: +- cout <<= bmap64->cluster_bits; ++ cout <<= bitmap->cluster_bits; + *out = (cout >= start) ? cout : start; + return 0; + } + + for (cout = cstart; cout <= cend; cout++) +- if (bmap64->bitmap_ops->test_bmap(bmap64, cout)) ++ if (bitmap->bitmap_ops->test_bmap(bitmap, cout)) + goto found; + + return ENOENT; +-- +2.21.3 + diff --git a/SOURCES/e2fsprogs-1.45.6-ext2fs-fix-ABI-change-in-the-struct_ext2_filsys-stru.patch b/SOURCES/e2fsprogs-1.45.6-ext2fs-fix-ABI-change-in-the-struct_ext2_filsys-stru.patch new file mode 100644 index 0000000..82363c5 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-ext2fs-fix-ABI-change-in-the-struct_ext2_filsys-stru.patch @@ -0,0 +1,51 @@ +From 9039cf5c5da439f6c65435c0a2b9ae16989940e1 Mon Sep 17 00:00:00 2001 +From: Lukas Czerner +Date: Tue, 14 Jan 2020 20:56:41 +0100 +Subject: [PATCH 7/7] ext2fs: fix ABI change in the struct_ext2_filsys + structure + +Upstream increased size of the struct_ext2_filsys structure by adding +new encoding member. However this represents ABI breakage within a major +RHEL release. To avoid it use some of the reserved space in the +struct_ext2_filsys structure. + +Signed-off-by: Lukas Czerner +--- + lib/ext2fs/ext2fs.h | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +diff --git a/lib/ext2fs/ext2fs.h b/lib/ext2fs/ext2fs.h +index ba83534c..32c75171 100644 +--- a/lib/ext2fs/ext2fs.h ++++ b/lib/ext2fs/ext2fs.h +@@ -250,10 +250,17 @@ struct struct_ext2_filsys { + int cluster_ratio_bits; + __u16 default_bitmap_type; + __u16 pad; ++ ++ /* ++ * RedHat specific change to prevent ABI change by using 8 ++ * reserved bytes ++ */ ++ const struct ext2fs_nls_table *encoding; ++ + /* + * Reserved for future expansion + */ +- __u32 reserved[5]; ++ __u32 reserved[5 - (sizeof(long int)/4)]; + + /* + * Reserved for the use of the calling application. +@@ -304,8 +311,6 @@ struct struct_ext2_filsys { + + /* hashmap for SHA of data blocks */ + struct ext2fs_hashmap* block_sha_map; +- +- const struct ext2fs_nls_table *encoding; + }; + + #if EXT2_FLAT_INCLUDES +-- +2.21.3 + diff --git a/SOURCES/e2fsprogs-1.45.6-man-Add-note-about-RHEL8-supported-features-and-moun.patch b/SOURCES/e2fsprogs-1.45.6-man-Add-note-about-RHEL8-supported-features-and-moun.patch new file mode 100644 index 0000000..f08d1fa --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-man-Add-note-about-RHEL8-supported-features-and-moun.patch @@ -0,0 +1,133 @@ +From b46e1de31f31b9564445a094e1c9cb592062868c Mon Sep 17 00:00:00 2001 +From: Lukas Czerner +Date: Wed, 18 Dec 2019 11:03:37 +0100 +Subject: [PATCH 4/7] man: Add note about RHEL8 supported features and mount + options + +Signed-off-by: Lukas Czerner +--- + misc/ext4.5.in | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ + misc/mke2fs.8.in | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 96 insertions(+) + +diff --git a/misc/ext4.5.in b/misc/ext4.5.in +index 1db61a5f..39b1412e 100644 +--- a/misc/ext4.5.in ++++ b/misc/ext4.5.in +@@ -19,6 +19,54 @@ previously intended for use with the ext2 and ext3 file systems can be + mounted using the ext4 file system driver, and indeed in many modern + Linux distributions, the ext4 file system driver has been configured + to handle mount requests for ext2 and ext3 file systems. ++.SH RED HAT ENTERPRISE LINUX 8 ++The Ext4 file system is fully supported by Red Hat when using default ++mke2fs and mount options. In addition, the following non-default mke2fs ++features and mount options are also fully supported. ++.SH "Non-default features:" ++project ++.br ++quota ++.br ++mmp ++.br ++.SH "Non-default mount options:" ++bsddf|minixdf ++.br ++grpid|bsdgroups and nogrpid|sysvgroups ++.br ++resgid=n and resuid=n ++.br ++errors={continue|remount-ro|panic} ++.br ++commit=nrsec ++.br ++max_batch_time=usec ++.br ++min_batch_time=usec ++.br ++grpquota|noquota|quota|usrquota ++.br ++prjquota ++.br ++dax ++.br ++lazytime|nolazytime ++.br ++discard|nodiscard ++.br ++init_itable|noinit_itable ++.br ++jqfmt={vfsold|vfsv0|vfsv1} ++.br ++usrjquota=aquota.user|grpjquota=aquota.group ++.PP ++For more information on features and mount options, see the ++.BR ext4 ++man page. Ext4 features and mount options not listed above may not be ++fully supported by Red Hat. If your workload requires a feature or mount ++option that is not fully in this Red Hat release, contact Red Hat support ++to evaluate it for inclusion in our supported list. + .SH FILE SYSTEM FEATURES + A file system formatted for ext2, ext3, or ext4 can have some + collection of the following file system feature flags enabled. Some of +diff --git a/misc/mke2fs.8.in b/misc/mke2fs.8.in +index e6bfc6d6..6106342b 100644 +--- a/misc/mke2fs.8.in ++++ b/misc/mke2fs.8.in +@@ -204,6 +204,54 @@ overridden by the options listed below, are controlled by the + configuration file. See the + .BR mke2fs.conf (5) + manual page for more details. ++.SH RED HAT ENTERPRISE LINUX 8 ++The Ext4 file system is fully supported by Red Hat when using default ++mke2fs and mount options. In addition, the following non-default mke2fs ++features and mount options are also fully supported. ++.SH "Non-default features:" ++project ++.br ++quota ++.br ++mmp ++.br ++.SH "Non-default mount options:" ++bsddf|minixdf ++.br ++grpid|bsdgroups and nogrpid|sysvgroups ++.br ++resgid=n and resuid=n ++.br ++errors={continue|remount-ro|panic} ++.br ++commit=nrsec ++.br ++max_batch_time=usec ++.br ++min_batch_time=usec ++.br ++grpquota|noquota|quota|usrquota ++.br ++prjquota ++.br ++dax ++.br ++lazytime|nolazytime ++.br ++discard|nodiscard ++.br ++init_itable|noinit_itable ++.br ++jqfmt={vfsold|vfsv0|vfsv1} ++.br ++usrjquota=aquota.user|grpjquota=aquota.group ++.PP ++For more information on features and mount options, see the ++.BR ext4 ++man page. Ext4 features and mount options not listed above may not be ++fully supported by Red Hat. If your workload requires a feature or mount ++option that is not fully in this Red Hat release, contact Red Hat support ++to evaluate it for inclusion in our supported list. + .SH OPTIONS + .TP + .BI \-b " block-size" +-- +2.21.3 + diff --git a/SOURCES/e2fsprogs-1.45.6-mke2fs.conf-Introduce-rhel6-and-rhel7-fs_type.patch b/SOURCES/e2fsprogs-1.45.6-mke2fs.conf-Introduce-rhel6-and-rhel7-fs_type.patch new file mode 100644 index 0000000..a4fe78a --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-mke2fs.conf-Introduce-rhel6-and-rhel7-fs_type.patch @@ -0,0 +1,34 @@ +From 42e4b2148a42ce35d5bc86586341a887928ec4dc Mon Sep 17 00:00:00 2001 +From: Lukas Czerner +Date: Tue, 17 Dec 2019 11:24:31 +0100 +Subject: [PATCH 3/7] mke2fs.conf: Introduce rhel6 and rhel7 fs_type + +Signed-off-by: Lukas Czerner +--- + misc/mke2fs.conf.in | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/misc/mke2fs.conf.in b/misc/mke2fs.conf.in +index 01e35cf8..a533b210 100644 +--- a/misc/mke2fs.conf.in ++++ b/misc/mke2fs.conf.in +@@ -14,6 +14,16 @@ + features = has_journal,extent,huge_file,flex_bg,metadata_csum,64bit,dir_nlink,extra_isize + inode_size = 256 + } ++ rhel6_ext4 = { ++ features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize ++ inode_size = 256 ++ enable_periodic_fsck = 1 ++ default_mntopts = "" ++ } ++ rhel7_ext4 = { ++ features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize,64bit ++ inode_size = 256 ++ } + small = { + blocksize = 1024 + inode_size = 128 +-- +2.21.3 + diff --git a/SPECS/e2fsprogs.spec b/SPECS/e2fsprogs.spec index b393ae5..6cc8085 100644 --- a/SPECS/e2fsprogs.spec +++ b/SPECS/e2fsprogs.spec @@ -1,7 +1,7 @@ Summary: Utilities for managing ext2, ext3, and ext4 file systems Name: e2fsprogs -Version: 1.44.6 -Release: 3%{?dist} +Version: 1.45.6 +Release: 1%{?dist} # License tags based on COPYING file distinctions for various components License: GPLv2 @@ -27,15 +27,13 @@ BuildRequires: libuuid-devel BuildRequires: gettext BuildRequires: multilib-rpm-config -Patch0: e2fsprogs-1.44.6-libext2fs-add-ext2fs_-read-write-_inode2.patch -Patch1: e2fsprogs-1.44.6-debugfs-fix-set_inode_field-so-it-can-set-the-checks.patch -Patch2: e2fsprogs-1.44.6-e2image-add-b-and-B-options-to-specify-where-to-find.patch -Patch3: e2fsprogs-1.44.6-debugfs-fix-printing-of-xattrs-with-ea_in_inode-valu.patch -Patch4: e2fsprogs-1.44.6-debugfs-remove-unused-variable-tmp_inode.patch -Patch5: e2fsprogs-1.44.6-libext2fs-remove-unused-variable-old_flags.patch -Patch6: e2fsprogs-1.44.6-e2fsck-check-and-fix-tails-of-all-bitmap-blocks.patch -Patch7: e2fsprogs-1.44.6-e2fsck-remove-an-potentially-ambiguous-dangling-else.patch -Patch8: e2fsprogs-1.44.6-mke2fs-accept-the-english-yes-character-to-the-proce.patch +Patch0: e2fsprogs-1.45.6-Makefile.in-Disable-e2scrub.patch +Patch1: e2fsprogs-1.45.6-Revert-fuse2fs-install-fuse2fs-in-usr-bin-instead-of.patch +Patch2: e2fsprogs-1.45.6-mke2fs.conf-Introduce-rhel6-and-rhel7-fs_type.patch +Patch3: e2fsprogs-1.45.6-man-Add-note-about-RHEL8-supported-features-and-moun.patch +Patch4: e2fsprogs-1.45.6-Revert-libext2fs-revamp-bitmap-types-to-fix-LTO-warn.patch +Patch5: e2fsprogs-1.45.6-Revert-libext2fs-hide-struct-ext2fs_hashmap-as-an-in.patch +Patch6: e2fsprogs-1.45.6-ext2fs-fix-ABI-change-in-the-struct_ext2_filsys-stru.patch %description The e2fsprogs package contains a number of utilities for creating, @@ -161,8 +159,6 @@ It was originally inspired by the Multics SubSystem library. %patch4 -p1 %patch5 -p1 %patch6 -p1 -%patch7 -p1 -%patch8 -p1 %build %configure CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" \ @@ -325,6 +321,21 @@ exit 0 %{_libdir}/pkgconfig/ss.pc %changelog +* Wed Jun 03 2020 Lukas Czerner 1.45.6-5 +- Rebase to the upstream release 1.45.6 (#1843548) + +* Tue Jan 14 2020 Lukas Czerner 1.45.4-3 +- Fix clang warning introduced in previous release (#1783777) + +* Tue Jan 14 2020 Lukas Czerner 1.45.4-2 +- Fix ABI breakage introduced in previous release (#1783777) + +* Sun Dec 15 2019 Lukas Czerner 1.45.4-1 +- Rebase to the release 1.45.4 (#1783777) +- provide rhel6/7 compatible fs_type in mke2fs.conf (#1780279) +- fix crafted ext4 partition leads to out-of-bounds write (#1768709) +- include note about supported rhel8 features and options (#1788573) + * Wed May 29 2019 Lukas Czerner 1.44.6-3 - Backport fixes from 1.45.2 (#1714927) - Fix errors in rpmdiff (#1714923)