From cf54d5c3419aa351b378883edab02a7cd7327040 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Thu, 23 Apr 2020 22:07:34 +0000 Subject: [PATCH] import e2fsprogs-1.45.4-3.el8 --- .e2fsprogs.metadata | 1 + .gitignore | 1 + ...s-1.45.4-Makefile.in-Disable-e2scrub.patch | 38 + ...nstall-fuse2fs-in-usr-bin-instead-of.patch | 45 + ...ut-RHEL8-supported-features-and-moun.patch | 133 ++ ....conf-Disable-fname_encoding-feature.patch | 27 + ...nf-Introduce-rhel6-and-rhel7-fs_type.patch | 34 + ....45.5-Fix-UBSan-when-shifting-1LL-63.patch | 42 + ...-hide-struct-ext2fs_hashmap-as-an-in.patch | 86 + ...-revamp-bitmap-types-to-fix-LTO-warn.patch | 1421 +++++++++++++++++ ...there-is-a-corrupted-directory-block.patch | 53 + ...ck-for-future-superblock-times-if-ch.patch | 43 + ...-t-try-to-rehash-a-deleted-directory.patch | 46 + ...x-to-return-ENOMEM-in-alloc_size_dir.patch | 32 + ...fix-use-after-free-in-calculate_tree.patch | 72 + ...hange-in-the-struct_ext2_filsys-stru.patch | 50 + ...San-when-updating-an-inline_data-fil.patch | 39 + ...g-when-reading-or-writing-more-than-.patch | 41 + ...ly-free-the-bitmaps-in-read_bitmap-s.patch | 36 + ...-the-block-numbers-for-the-allocatio.patch | 51 + ...-toggling-uninit_bg-on-live-filesyst.patch | 56 + SPECS/e2fsprogs.spec | 1038 ++++++++++++ 22 files changed, 3385 insertions(+) create mode 100644 .e2fsprogs.metadata create mode 100644 .gitignore create mode 100644 SOURCES/e2fsprogs-1.45.4-Makefile.in-Disable-e2scrub.patch create mode 100644 SOURCES/e2fsprogs-1.45.4-Revert-fuse2fs-install-fuse2fs-in-usr-bin-instead-of.patch create mode 100644 SOURCES/e2fsprogs-1.45.4-man-Add-note-about-RHEL8-supported-features-and-moun.patch create mode 100644 SOURCES/e2fsprogs-1.45.4-mke2fs.conf-Disable-fname_encoding-feature.patch create mode 100644 SOURCES/e2fsprogs-1.45.4-mke2fs.conf-Introduce-rhel6-and-rhel7-fs_type.patch create mode 100644 SOURCES/e2fsprogs-1.45.5-Fix-UBSan-when-shifting-1LL-63.patch create mode 100644 SOURCES/e2fsprogs-1.45.5-Revert-libext2fs-hide-struct-ext2fs_hashmap-as-an-in.patch create mode 100644 SOURCES/e2fsprogs-1.45.5-Revert-libext2fs-revamp-bitmap-types-to-fix-LTO-warn.patch create mode 100644 SOURCES/e2fsprogs-1.45.5-e2fsck-abort-if-there-is-a-corrupted-directory-block.patch create mode 100644 SOURCES/e2fsprogs-1.45.5-e2fsck-don-t-check-for-future-superblock-times-if-ch.patch create mode 100644 SOURCES/e2fsprogs-1.45.5-e2fsck-don-t-try-to-rehash-a-deleted-directory.patch create mode 100644 SOURCES/e2fsprogs-1.45.5-e2fsck-fix-to-return-ENOMEM-in-alloc_size_dir.patch create mode 100644 SOURCES/e2fsprogs-1.45.5-e2fsck-fix-use-after-free-in-calculate_tree.patch create mode 100644 SOURCES/e2fsprogs-1.45.5-ext2fs-fix-ABI-change-in-the-struct_ext2_filsys-stru.patch create mode 100644 SOURCES/e2fsprogs-1.45.5-libext2fs-fix-UBSan-when-updating-an-inline_data-fil.patch create mode 100644 SOURCES/e2fsprogs-1.45.5-libext2fs-fix-bug-when-reading-or-writing-more-than-.patch create mode 100644 SOURCES/e2fsprogs-1.45.5-libext2fs-properly-free-the-bitmaps-in-read_bitmap-s.patch create mode 100644 SOURCES/e2fsprogs-1.45.5-libext2fs-verify-the-block-numbers-for-the-allocatio.patch create mode 100644 SOURCES/e2fsprogs-1.45.5-tune2fs-prohibit-toggling-uninit_bg-on-live-filesyst.patch create mode 100644 SPECS/e2fsprogs.spec diff --git a/.e2fsprogs.metadata b/.e2fsprogs.metadata new file mode 100644 index 0000000..cadf1a3 --- /dev/null +++ b/.e2fsprogs.metadata @@ -0,0 +1 @@ +4f2ac3a153c23d57968632e12c944eeb50613c51 SOURCES/e2fsprogs-1.45.4.tar.xz diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7dff4db --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/e2fsprogs-1.45.4.tar.xz diff --git a/SOURCES/e2fsprogs-1.45.4-Makefile.in-Disable-e2scrub.patch b/SOURCES/e2fsprogs-1.45.4-Makefile.in-Disable-e2scrub.patch new file mode 100644 index 0000000..b5da68b --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.4-Makefile.in-Disable-e2scrub.patch @@ -0,0 +1,38 @@ +From bb566b0efe6179a1aa2dac6e3c05a12f59eac8a3 Mon Sep 17 00:00:00 2001 +From: Lukas Czerner +Date: Sun, 15 Dec 2019 12:42:28 +0100 +Subject: [PATCH 2/2] 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.0 + diff --git a/SOURCES/e2fsprogs-1.45.4-Revert-fuse2fs-install-fuse2fs-in-usr-bin-instead-of.patch b/SOURCES/e2fsprogs-1.45.4-Revert-fuse2fs-install-fuse2fs-in-usr-bin-instead-of.patch new file mode 100644 index 0000000..5afdf1f --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.4-Revert-fuse2fs-install-fuse2fs-in-usr-bin-instead-of.patch @@ -0,0 +1,45 @@ +From 6499a3eef9583d893a442372e1567d74ce5a045b Mon Sep 17 00:00:00 2001 +From: Lukas Czerner +Date: Sun, 15 Dec 2019 14:39:46 +0100 +Subject: [PATCH] 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 f2554446..22c98489 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.0 + diff --git a/SOURCES/e2fsprogs-1.45.4-man-Add-note-about-RHEL8-supported-features-and-moun.patch b/SOURCES/e2fsprogs-1.45.4-man-Add-note-about-RHEL8-supported-features-and-moun.patch new file mode 100644 index 0000000..b97c27b --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.4-man-Add-note-about-RHEL8-supported-features-and-moun.patch @@ -0,0 +1,133 @@ +From e571c0f64fe02f09472a1011b3f129f94b3ec4ed Mon Sep 17 00:00:00 2001 +From: Lukas Czerner +Date: Wed, 18 Dec 2019 11:03:37 +0100 +Subject: [PATCH] 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 5bcee25e..8297bc5b 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.1 + diff --git a/SOURCES/e2fsprogs-1.45.4-mke2fs.conf-Disable-fname_encoding-feature.patch b/SOURCES/e2fsprogs-1.45.4-mke2fs.conf-Disable-fname_encoding-feature.patch new file mode 100644 index 0000000..0419aa2 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.4-mke2fs.conf-Disable-fname_encoding-feature.patch @@ -0,0 +1,27 @@ +From 007d212c3f6c4942185e53a41011d11585827033 Mon Sep 17 00:00:00 2001 +From: Lukas Czerner +Date: Sun, 15 Dec 2019 12:05:41 +0100 +Subject: [PATCH 1/2] mke2fs.conf: Disable fname_encoding feature + +It's still rather new and we do not feel ready supporting it at the +moment, so just disable it. + +Signed-off-by: Lukas Czerner +--- + misc/mke2fs.conf.in | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/misc/mke2fs.conf.in b/misc/mke2fs.conf.in +index 00afd912..01e35cf8 100644 +--- a/misc/mke2fs.conf.in ++++ b/misc/mke2fs.conf.in +@@ -45,6 +45,3 @@ + blocksize = 4096 + inode_size = 128 + } +- +-[options] +- fname_encoding = utf8 +-- +2.21.0 + diff --git a/SOURCES/e2fsprogs-1.45.4-mke2fs.conf-Introduce-rhel6-and-rhel7-fs_type.patch b/SOURCES/e2fsprogs-1.45.4-mke2fs.conf-Introduce-rhel6-and-rhel7-fs_type.patch new file mode 100644 index 0000000..2956e7f --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.4-mke2fs.conf-Introduce-rhel6-and-rhel7-fs_type.patch @@ -0,0 +1,34 @@ +From 541e51dcf19433838aba7de11e6f3f124e6ef4da Mon Sep 17 00:00:00 2001 +From: Lukas Czerner +Date: Tue, 17 Dec 2019 11:24:31 +0100 +Subject: [PATCH] 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.1 + diff --git a/SOURCES/e2fsprogs-1.45.5-Fix-UBSan-when-shifting-1LL-63.patch b/SOURCES/e2fsprogs-1.45.5-Fix-UBSan-when-shifting-1LL-63.patch new file mode 100644 index 0000000..bdc6164 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.5-Fix-UBSan-when-shifting-1LL-63.patch @@ -0,0 +1,42 @@ +From d7968909c6b503c3c96d36ae2a686b1b07308077 Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Mon, 4 Nov 2019 21:22:54 -0500 +Subject: [PATCH 03/10] Fix UBSan when shifting (1LL << 63) + +Signed-off-by: Theodore Ts'o +--- + lib/ext2fs/qcow2.h | 4 ++-- + misc/e2image.c | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/lib/ext2fs/qcow2.h b/lib/ext2fs/qcow2.h +index 5576348a..b649c9cf 100644 +--- a/lib/ext2fs/qcow2.h ++++ b/lib/ext2fs/qcow2.h +@@ -30,8 +30,8 @@ + + #define QCOW_MAGIC (('Q' << 24) | ('F' << 16) | ('I' << 8) | 0xfb) + #define QCOW_VERSION 2 +-#define QCOW_OFLAG_COPIED (1LL << 63) +-#define QCOW_OFLAG_COMPRESSED (1LL << 62) ++#define QCOW_OFLAG_COPIED (1ULL << 63) ++#define QCOW_OFLAG_COMPRESSED (1ULL << 62) + + #define QCOW_COMPRESSED 1 + #define QCOW_ENCRYPTED 2 +diff --git a/misc/e2image.c b/misc/e2image.c +index 3c881fee..30f25432 100644 +--- a/misc/e2image.c ++++ b/misc/e2image.c +@@ -54,7 +54,7 @@ extern int optind; + #include "support/plausible.h" + #include "../version.h" + +-#define QCOW_OFLAG_COPIED (1LL << 63) ++#define QCOW_OFLAG_COPIED (1ULL << 63) + #define NO_BLK ((blk64_t) -1) + + /* Image types */ +-- +2.21.1 + diff --git a/SOURCES/e2fsprogs-1.45.5-Revert-libext2fs-hide-struct-ext2fs_hashmap-as-an-in.patch b/SOURCES/e2fsprogs-1.45.5-Revert-libext2fs-hide-struct-ext2fs_hashmap-as-an-in.patch new file mode 100644 index 0000000..55db8f2 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.5-Revert-libext2fs-hide-struct-ext2fs_hashmap-as-an-in.patch @@ -0,0 +1,86 @@ +From cff7039936d361a0ab1d76ef0c12b681f3be9172 Mon Sep 17 00:00:00 2001 +From: Lukas Czerner +Date: Tue, 14 Jan 2020 09:49:31 +0100 +Subject: [PATCH 2/2] 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.1 + diff --git a/SOURCES/e2fsprogs-1.45.5-Revert-libext2fs-revamp-bitmap-types-to-fix-LTO-warn.patch b/SOURCES/e2fsprogs-1.45.5-Revert-libext2fs-revamp-bitmap-types-to-fix-LTO-warn.patch new file mode 100644 index 0000000..4318f12 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.5-Revert-libext2fs-revamp-bitmap-types-to-fix-LTO-warn.patch @@ -0,0 +1,1421 @@ +From 48101b992aa733fe97bfefe2e43a29fca9e65748 Mon Sep 17 00:00:00 2001 +From: Lukas Czerner +Date: Tue, 14 Jan 2020 09:49:19 +0100 +Subject: [PATCH 1/2] 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 e25db2c6..84021917 100644 +--- a/lib/ext2fs/bitmaps.c ++++ b/lib/ext2fs/bitmaps.c +@@ -125,7 +125,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); +@@ -148,15 +147,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 59fd9742..c50a67cf 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 c94c21b6..674baa3e 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.1 + diff --git a/SOURCES/e2fsprogs-1.45.5-e2fsck-abort-if-there-is-a-corrupted-directory-block.patch b/SOURCES/e2fsprogs-1.45.5-e2fsck-abort-if-there-is-a-corrupted-directory-block.patch new file mode 100644 index 0000000..e1f9146 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.5-e2fsck-abort-if-there-is-a-corrupted-directory-block.patch @@ -0,0 +1,53 @@ +From 8a51e038d172c3405466ddb60d712c2ac934b954 Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Thu, 19 Dec 2019 19:37:34 -0500 +Subject: [PATCH 07/10] e2fsck: abort if there is a corrupted directory block + when rehashing + +In e2fsck pass 3a, when we are rehashing directories, at least in +theory, all of the directories should have had corruptions with +respect to directory entry structure fixed. However, it's possible +(for example, if the user declined a fix) that we can reach this stage +of processing with a corrupted directory entries. + +So check for that case and don't try to process a corrupted directory +block so we don't run into trouble in mutate_name() if there is a +zero-length file name. + +Addresses: TALOS-2019-0973 +Addresses: CVE-2019-5188 +Signed-off-by: Theodore Ts'o +--- + e2fsck/rehash.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/e2fsck/rehash.c b/e2fsck/rehash.c +index a5fc1be1..3dd1e941 100644 +--- a/e2fsck/rehash.c ++++ b/e2fsck/rehash.c +@@ -160,6 +160,10 @@ static int fill_dir_block(ext2_filsys fs, + dir_offset += rec_len; + if (dirent->inode == 0) + continue; ++ if ((name_len) == 0) { ++ fd->err = EXT2_ET_DIR_CORRUPTED; ++ return BLOCK_ABORT; ++ } + if (!fd->compress && (name_len == 1) && + (dirent->name[0] == '.')) + continue; +@@ -401,6 +405,11 @@ static int duplicate_search_and_fix(e2fsck_t ctx, ext2_filsys fs, + continue; + } + new_len = ext2fs_dirent_name_len(ent->dir); ++ if (new_len == 0) { ++ /* should never happen */ ++ ext2fs_unmark_valid(fs); ++ continue; ++ } + memcpy(new_name, ent->dir->name, new_len); + mutate_name(new_name, &new_len); + for (j=0; j < fd->num_array; j++) { +-- +2.21.1 + diff --git a/SOURCES/e2fsprogs-1.45.5-e2fsck-don-t-check-for-future-superblock-times-if-ch.patch b/SOURCES/e2fsprogs-1.45.5-e2fsck-don-t-check-for-future-superblock-times-if-ch.patch new file mode 100644 index 0000000..47438f9 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.5-e2fsck-don-t-check-for-future-superblock-times-if-ch.patch @@ -0,0 +1,43 @@ +From a9daa3b6b888c2834de9869ba8037c22ae8c47e5 Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Wed, 1 Jan 2020 21:50:27 -0500 +Subject: [PATCH 10/10] e2fsck: don't check for future superblock times if + checkinterval == 0 + +We are no longer enabling periodic file system checks by default in +mke2fs. The only reason why we force file system checks if the last +mount time or last write time in the superblock is if this might +bypass the periodic file systme checks. So if the checkinterval is +zero, skip the last mount/write time checks since there's no reason to +force a check just because the system clock is incorrect. + +Signed-off-by: Theodore Ts'o +--- + e2fsck/super.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/e2fsck/super.c b/e2fsck/super.c +index e5932be6..18affcf7 100644 +--- a/e2fsck/super.c ++++ b/e2fsck/super.c +@@ -1038,7 +1038,7 @@ void check_super_block(e2fsck_t ctx) + * Check to see if the superblock last mount time or last + * write time is in the future. + */ +- if (!broken_system_clock && ++ if (!broken_system_clock && fs->super->s_checkinterval && + !(ctx->flags & E2F_FLAG_TIME_INSANE) && + fs->super->s_mtime > (__u32) ctx->now) { + pctx.num = fs->super->s_mtime; +@@ -1050,7 +1050,7 @@ void check_super_block(e2fsck_t ctx) + fs->flags |= EXT2_FLAG_DIRTY; + } + } +- if (!broken_system_clock && ++ if (!broken_system_clock && fs->super->s_checkinterval && + !(ctx->flags & E2F_FLAG_TIME_INSANE) && + fs->super->s_wtime > (__u32) ctx->now) { + pctx.num = fs->super->s_wtime; +-- +2.21.1 + diff --git a/SOURCES/e2fsprogs-1.45.5-e2fsck-don-t-try-to-rehash-a-deleted-directory.patch b/SOURCES/e2fsprogs-1.45.5-e2fsck-don-t-try-to-rehash-a-deleted-directory.patch new file mode 100644 index 0000000..11a70e7 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.5-e2fsck-don-t-try-to-rehash-a-deleted-directory.patch @@ -0,0 +1,46 @@ +From c8bbee5fdc46876ec96be9c40831dcafadbcb983 Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Thu, 19 Dec 2019 19:45:06 -0500 +Subject: [PATCH 08/10] e2fsck: don't try to rehash a deleted directory + +If directory has been deleted in pass1[bcd] processing, then we +shouldn't try to rehash the directory in pass 3a when we try to +rehash/reoptimize directories. + +Signed-off-by: Theodore Ts'o +--- + e2fsck/pass1b.c | 4 ++++ + e2fsck/rehash.c | 2 ++ + 2 files changed, 6 insertions(+) + +diff --git a/e2fsck/pass1b.c b/e2fsck/pass1b.c +index 5693b9cf..bca701ca 100644 +--- a/e2fsck/pass1b.c ++++ b/e2fsck/pass1b.c +@@ -705,6 +705,10 @@ static void delete_file(e2fsck_t ctx, ext2_ino_t ino, + fix_problem(ctx, PR_1B_BLOCK_ITERATE, &pctx); + if (ctx->inode_bad_map) + ext2fs_unmark_inode_bitmap2(ctx->inode_bad_map, ino); ++ if (ctx->inode_reg_map) ++ ext2fs_unmark_inode_bitmap2(ctx->inode_reg_map, ino); ++ ext2fs_unmark_inode_bitmap2(ctx->inode_dir_map, ino); ++ ext2fs_unmark_inode_bitmap2(ctx->inode_used_map, ino); + ext2fs_inode_alloc_stats2(fs, ino, -1, LINUX_S_ISDIR(dp->inode.i_mode)); + quota_data_sub(ctx->qctx, &dp->inode, ino, + pb.dup_blocks * fs->blocksize); +diff --git a/e2fsck/rehash.c b/e2fsck/rehash.c +index 3dd1e941..2c908be0 100644 +--- a/e2fsck/rehash.c ++++ b/e2fsck/rehash.c +@@ -1028,6 +1028,8 @@ void e2fsck_rehash_directories(e2fsck_t ctx) + if (!ext2fs_u32_list_iterate(iter, &ino)) + break; + } ++ if (!ext2fs_test_inode_bitmap2(ctx->inode_dir_map, ino)) ++ continue; + + pctx.dir = ino; + if (first) { +-- +2.21.1 + diff --git a/SOURCES/e2fsprogs-1.45.5-e2fsck-fix-to-return-ENOMEM-in-alloc_size_dir.patch b/SOURCES/e2fsprogs-1.45.5-e2fsck-fix-to-return-ENOMEM-in-alloc_size_dir.patch new file mode 100644 index 0000000..16a15c4 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.5-e2fsck-fix-to-return-ENOMEM-in-alloc_size_dir.patch @@ -0,0 +1,32 @@ +From 4215866fa515f8f319ae602797984289248d8bfe Mon Sep 17 00:00:00 2001 +From: Wang Shilong +Date: Tue, 26 Nov 2019 18:03:58 +0900 +Subject: [PATCH] e2fsck: fix to return ENOMEM in alloc_size_dir() + +Two memory allocation return check is missed. + +Signed-off-by: Wang Shilong +Signed-off-by: Theodore Ts'o +--- + e2fsck/rehash.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/e2fsck/rehash.c b/e2fsck/rehash.c +index e0764d0b..54bc6803 100644 +--- a/e2fsck/rehash.c ++++ b/e2fsck/rehash.c +@@ -276,7 +276,11 @@ static errcode_t alloc_size_dir(ext2_filsys fs, struct out_dir *outdir, + outdir->hashes = new_mem; + } else { + outdir->buf = malloc(blocks * fs->blocksize); ++ if (!outdir->buf) ++ return ENOMEM; + outdir->hashes = malloc(blocks * sizeof(ext2_dirhash_t)); ++ if (!outdir->hashes) ++ return ENOMEM; + outdir->num = 0; + } + outdir->max = blocks; +-- +2.21.1 + diff --git a/SOURCES/e2fsprogs-1.45.5-e2fsck-fix-use-after-free-in-calculate_tree.patch b/SOURCES/e2fsprogs-1.45.5-e2fsck-fix-use-after-free-in-calculate_tree.patch new file mode 100644 index 0000000..758bd63 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.5-e2fsck-fix-use-after-free-in-calculate_tree.patch @@ -0,0 +1,72 @@ +From aa011a6deafa48b1015d402d7ec0bd40f9308109 Mon Sep 17 00:00:00 2001 +From: Wang Shilong +Date: Mon, 30 Dec 2019 19:52:39 -0500 +Subject: [PATCH 09/10] e2fsck: fix use after free in calculate_tree() + +The problem is alloc_blocks() will call get_next_block() which might +reallocate outdir->buf, and memory address could be changed after +this. To fix this, pointers that point into outdir->buf, such as +int_limit and root need to be recaulated based on the new starting +address of outdir->buf. + +[ Changed to correctly recalculate int_limit, and to optimize how we + reallocate outdir->buf. -TYT ] + +Signed-off-by: Wang Shilong +Signed-off-by: Theodore Ts'o +--- + e2fsck/rehash.c | 17 ++++++++++++++++- + 1 file changed, 16 insertions(+), 1 deletion(-) + +diff --git a/e2fsck/rehash.c b/e2fsck/rehash.c +index 2c908be0..e0764d0b 100644 +--- a/e2fsck/rehash.c ++++ b/e2fsck/rehash.c +@@ -297,7 +297,11 @@ static errcode_t get_next_block(ext2_filsys fs, struct out_dir *outdir, + errcode_t retval; + + if (outdir->num >= outdir->max) { +- retval = alloc_size_dir(fs, outdir, outdir->max + 50); ++ int increment = outdir->max / 10; ++ ++ if (increment < 50) ++ increment = 50; ++ retval = alloc_size_dir(fs, outdir, outdir->max + increment); + if (retval) + return retval; + } +@@ -641,6 +645,9 @@ static int alloc_blocks(ext2_filsys fs, + if (retval) + return retval; + ++ /* outdir->buf might be reallocated */ ++ *prev_ent = (struct ext2_dx_entry *) (outdir->buf + *prev_offset); ++ + *next_ent = set_int_node(fs, block_start); + *limit = (struct ext2_dx_countlimit *)(*next_ent); + if (next_offset) +@@ -730,6 +737,9 @@ static errcode_t calculate_tree(ext2_filsys fs, + return retval; + } + if (c3 == 0) { ++ int delta1 = (char *)int_limit - outdir->buf; ++ int delta2 = (char *)root - outdir->buf; ++ + retval = alloc_blocks(fs, &limit, &int_ent, + &dx_ent, &int_offset, + NULL, outdir, i, &c2, +@@ -737,6 +747,11 @@ static errcode_t calculate_tree(ext2_filsys fs, + if (retval) + return retval; + ++ /* outdir->buf might be reallocated */ ++ int_limit = (struct ext2_dx_countlimit *) ++ (outdir->buf + delta1); ++ root = (struct ext2_dx_entry *) ++ (outdir->buf + delta2); + } + dx_ent->block = ext2fs_cpu_to_le32(i); + if (c3 != limit->limit) +-- +2.21.1 + diff --git a/SOURCES/e2fsprogs-1.45.5-ext2fs-fix-ABI-change-in-the-struct_ext2_filsys-stru.patch b/SOURCES/e2fsprogs-1.45.5-ext2fs-fix-ABI-change-in-the-struct_ext2_filsys-stru.patch new file mode 100644 index 0000000..f1973df --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.5-ext2fs-fix-ABI-change-in-the-struct_ext2_filsys-stru.patch @@ -0,0 +1,50 @@ +From 687ba50f6dde0b753870fcd62be5ef30c75bb38f Mon Sep 17 00:00:00 2001 +From: Lukas Czerner +Date: Tue, 14 Jan 2020 20:56:41 +0100 +Subject: [PATCH] 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 c50a67cf..5bb9133a 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.1 + diff --git a/SOURCES/e2fsprogs-1.45.5-libext2fs-fix-UBSan-when-updating-an-inline_data-fil.patch b/SOURCES/e2fsprogs-1.45.5-libext2fs-fix-UBSan-when-updating-an-inline_data-fil.patch new file mode 100644 index 0000000..875709d --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.5-libext2fs-fix-UBSan-when-updating-an-inline_data-fil.patch @@ -0,0 +1,39 @@ +From bee65149cc025522ae0e2c37a0ce817641ebac28 Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Mon, 4 Nov 2019 18:43:49 -0500 +Subject: [PATCH 02/10] libext2fs: fix UBSan when updating an inline_data file + +What memcpy does when the length is zero is not well-defined. So +avoid it. + +Bug: https://github.com/tytso/e2fsprogs/issues/25 +Signed-off-by: Theodore Ts'o +--- + lib/ext2fs/ext_attr.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/lib/ext2fs/ext_attr.c b/lib/ext2fs/ext_attr.c +index 78a823a9..affc1a8f 100644 +--- a/lib/ext2fs/ext_attr.c ++++ b/lib/ext2fs/ext_attr.c +@@ -1550,14 +1550,15 @@ errcode_t ext2fs_xattr_set(struct ext2_xattr_handle *h, + new_value, &value_len); + if (ret) + goto out; +- } else ++ } else if (value_len) + memcpy(new_value, value, value_len); + + /* Imitate kernel behavior by skipping update if value is the same. */ + for (x = h->attrs; x < h->attrs + h->count; x++) { + if (!strcmp(x->name, name)) { + if (!x->ea_ino && x->value_len == value_len && +- !memcmp(x->value, new_value, value_len)) { ++ (!value_len || ++ !memcmp(x->value, new_value, value_len))) { + ret = 0; + goto out; + } +-- +2.21.1 + diff --git a/SOURCES/e2fsprogs-1.45.5-libext2fs-fix-bug-when-reading-or-writing-more-than-.patch b/SOURCES/e2fsprogs-1.45.5-libext2fs-fix-bug-when-reading-or-writing-more-than-.patch new file mode 100644 index 0000000..75ccd91 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.5-libext2fs-fix-bug-when-reading-or-writing-more-than-.patch @@ -0,0 +1,41 @@ +From b989de221a8399d42aede6da03297cad3330f12a Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Mon, 4 Nov 2019 16:43:41 -0500 +Subject: [PATCH 01/10] libext2fs: fix bug when reading or writing more than + 2GB in unix_io + +If count * block_size exceeds 2GB, we will overflow a 32-bit signed +integer value. This shouldn't happen in practice except for +fuzz-corrupted file systems, but let's fix the code so it's correct. + +Bug: https://github.com/tytso/e2fsprogs/issues/24 +Signed-off-by: Theodore Ts'o +--- + lib/ext2fs/unix_io.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/lib/ext2fs/unix_io.c b/lib/ext2fs/unix_io.c +index 74fc8a75..628e60c3 100644 +--- a/lib/ext2fs/unix_io.c ++++ b/lib/ext2fs/unix_io.c +@@ -166,7 +166,7 @@ static errcode_t raw_read_blk(io_channel channel, + unsigned char *buf = bufv; + ssize_t really_read = 0; + +- size = (count < 0) ? -count : count * channel->block_size; ++ size = (count < 0) ? -count : (ext2_loff_t) count * channel->block_size; + data->io_stats.bytes_read += size; + location = ((ext2_loff_t) block * channel->block_size) + data->offset; + +@@ -275,7 +275,7 @@ static errcode_t raw_write_blk(io_channel channel, + if (count < 0) + size = -count; + else +- size = count * channel->block_size; ++ size = (ext2_loff_t) count * channel->block_size; + } + data->io_stats.bytes_written += size; + +-- +2.21.1 + diff --git a/SOURCES/e2fsprogs-1.45.5-libext2fs-properly-free-the-bitmaps-in-read_bitmap-s.patch b/SOURCES/e2fsprogs-1.45.5-libext2fs-properly-free-the-bitmaps-in-read_bitmap-s.patch new file mode 100644 index 0000000..d5b21bf --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.5-libext2fs-properly-free-the-bitmaps-in-read_bitmap-s.patch @@ -0,0 +1,36 @@ +From 764286ba7af40105ec9f27dba164fa53936c282f Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Fri, 8 Nov 2019 09:49:51 -0500 +Subject: [PATCH 04/10] libext2fs: properly free the bitmaps in read_bitmap()'s + error/cleanup path + +Use ext2fs_free_{block,inode}_bitmaps() instead of ext2fs_free_mem() +to avoid some memory leaks if there is an error while calling +read_bitmaps(). + +Signed-off-by: Theodore Ts'o +--- + lib/ext2fs/rw_bitmaps.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/lib/ext2fs/rw_bitmaps.c b/lib/ext2fs/rw_bitmaps.c +index f1c4188b..e092cab0 100644 +--- a/lib/ext2fs/rw_bitmaps.c ++++ b/lib/ext2fs/rw_bitmaps.c +@@ -396,11 +396,11 @@ success_cleanup: + + cleanup: + if (do_block) { +- ext2fs_free_mem(&fs->block_map); ++ ext2fs_free_block_bitmap(fs->block_map); + fs->block_map = 0; + } + if (do_inode) { +- ext2fs_free_mem(&fs->inode_map); ++ ext2fs_free_inode_bitmap(fs->inode_map); + fs->inode_map = 0; + } + if (inode_bitmap) +-- +2.21.1 + diff --git a/SOURCES/e2fsprogs-1.45.5-libext2fs-verify-the-block-numbers-for-the-allocatio.patch b/SOURCES/e2fsprogs-1.45.5-libext2fs-verify-the-block-numbers-for-the-allocatio.patch new file mode 100644 index 0000000..1a36d32 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.5-libext2fs-verify-the-block-numbers-for-the-allocatio.patch @@ -0,0 +1,51 @@ +From 21e41eeef968941c1ee0126852fdb705967730ea Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Fri, 8 Nov 2019 11:58:10 -0500 +Subject: [PATCH 05/10] libext2fs: verify the block numbers for the allocation + bitmaps are valid + +This avoids a potential UBsan failure when we multiply an insanely +high block number with the block size and we get a multiplication +overflow. + +Google-Bug-Id: 128130353 +Signed-off-by: Theodore Ts'o +--- + lib/ext2fs/rw_bitmaps.c | 14 ++++++++------ + 1 file changed, 8 insertions(+), 6 deletions(-) + +diff --git a/lib/ext2fs/rw_bitmaps.c b/lib/ext2fs/rw_bitmaps.c +index e092cab0..d80c9eb8 100644 +--- a/lib/ext2fs/rw_bitmaps.c ++++ b/lib/ext2fs/rw_bitmaps.c +@@ -306,9 +306,10 @@ static errcode_t read_bitmaps(ext2_filsys fs, int do_inode, int do_block) + for (i = 0; i < fs->group_desc_count; i++) { + if (block_bitmap) { + blk = ext2fs_block_bitmap_loc(fs, i); +- if (csum_flag && +- ext2fs_bg_flags_test(fs, i, EXT2_BG_BLOCK_UNINIT) && +- ext2fs_group_desc_csum_verify(fs, i)) ++ if ((csum_flag && ++ ext2fs_bg_flags_test(fs, i, EXT2_BG_BLOCK_UNINIT) && ++ ext2fs_group_desc_csum_verify(fs, i)) || ++ (blk >= ext2fs_blocks_count(fs->super))) + blk = 0; + if (blk) { + retval = io_channel_read_blk64(fs->io, blk, +@@ -340,9 +341,10 @@ static errcode_t read_bitmaps(ext2_filsys fs, int do_inode, int do_block) + } + if (inode_bitmap) { + blk = ext2fs_inode_bitmap_loc(fs, i); +- if (csum_flag && +- ext2fs_bg_flags_test(fs, i, EXT2_BG_INODE_UNINIT) && +- ext2fs_group_desc_csum_verify(fs, i)) ++ if ((csum_flag && ++ ext2fs_bg_flags_test(fs, i, EXT2_BG_INODE_UNINIT) && ++ ext2fs_group_desc_csum_verify(fs, i)) || ++ (blk >= ext2fs_blocks_count(fs->super))) + blk = 0; + if (blk) { + retval = io_channel_read_blk64(fs->io, blk, +-- +2.21.1 + diff --git a/SOURCES/e2fsprogs-1.45.5-tune2fs-prohibit-toggling-uninit_bg-on-live-filesyst.patch b/SOURCES/e2fsprogs-1.45.5-tune2fs-prohibit-toggling-uninit_bg-on-live-filesyst.patch new file mode 100644 index 0000000..4e2d4e7 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.5-tune2fs-prohibit-toggling-uninit_bg-on-live-filesyst.patch @@ -0,0 +1,56 @@ +From d758a667f27b38d9ecc0715062307a8bce741aee Mon Sep 17 00:00:00 2001 +From: "Darrick J. Wong" +Date: Wed, 20 Nov 2019 11:32:55 -0800 +Subject: [PATCH 06/10] tune2fs: prohibit toggling uninit_bg on live + filesystems + +An internal customer followed an erroneous AskUbuntu article[1] to try to +change the UUID of a live ext4 filesystem. The article claims that you +can work around tune2fs' "cannot change UUID on live fs" error by +disabling uninit_bg, changing the UUID, and re-enabling the feature. + +This led to metadata corruption because tune2fs' journal descriptor +rewrite races with regular filesystem writes. Therefore, prevent +administrators from turning on or off uninit_bg on a mounted fs. + +[1] https://askubuntu.com/questions/132079/how-do-i-change-uuid-of-a-disk-to-whatever-i-want/195839#459097 + +Signed-off-by: Darrick J. Wong +Signed-off-by: Theodore Ts'o +--- + misc/tune2fs.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/misc/tune2fs.c b/misc/tune2fs.c +index 7d2d38d7..301cf388 100644 +--- a/misc/tune2fs.c ++++ b/misc/tune2fs.c +@@ -1308,6 +1308,12 @@ mmp_error: + + if (FEATURE_ON(E2P_FEATURE_RO_INCOMPAT, + EXT4_FEATURE_RO_COMPAT_GDT_CSUM)) { ++ if (mount_flags & EXT2_MF_MOUNTED) { ++ fputs(_("Cannot enable uninit_bg on a mounted " ++ "filesystem!\n"), stderr); ++ exit(1); ++ } ++ + /* Do not enable uninit_bg when metadata_csum enabled */ + if (ext2fs_has_feature_metadata_csum(fs->super)) + ext2fs_clear_feature_gdt_csum(fs->super); +@@ -1317,6 +1323,12 @@ mmp_error: + + if (FEATURE_OFF(E2P_FEATURE_RO_INCOMPAT, + EXT4_FEATURE_RO_COMPAT_GDT_CSUM)) { ++ if (mount_flags & EXT2_MF_MOUNTED) { ++ fputs(_("Cannot disable uninit_bg on a mounted " ++ "filesystem!\n"), stderr); ++ exit(1); ++ } ++ + err = disable_uninit_bg(fs, + EXT4_FEATURE_RO_COMPAT_GDT_CSUM); + if (err) +-- +2.21.1 + diff --git a/SPECS/e2fsprogs.spec b/SPECS/e2fsprogs.spec new file mode 100644 index 0000000..012fc4d --- /dev/null +++ b/SPECS/e2fsprogs.spec @@ -0,0 +1,1038 @@ +Summary: Utilities for managing ext2, ext3, and ext4 file systems +Name: e2fsprogs +Version: 1.45.4 +Release: 3%{?dist} + +# License tags based on COPYING file distinctions for various components +License: GPLv2 +Group: System Environment/Base +Source0: https://www.kernel.org/pub/linux/kernel/people/tytso/%{name}/v%{version}/%{name}-%{version}.tar.xz + +Url: http://e2fsprogs.sourceforge.net/ +Requires: e2fsprogs-libs%{?_isa} = %{version}-%{release} +Requires: libcom_err%{?_isa} = %{version}-%{release} +Requires: libss = %{version}-%{release} + +# e4fsprogs was a parallel ext4-capable package in RHEL5.x +%if 0%{?rhel} > 0 +Obsoletes: e4fsprogs < %{version}-%{release} +Provides: e4fsprogs = %{version}-%{release} +%endif + +BuildRequires: pkgconfig, texinfo, libselinux-devel, gcc +BuildRequires: fuse-devel +BuildRequires: libsepol-devel +BuildRequires: libblkid-devel +BuildRequires: libuuid-devel +BuildRequires: gettext +BuildRequires: multilib-rpm-config + +Patch0: e2fsprogs-1.45.4-Makefile.in-Disable-e2scrub.patch +Patch1: e2fsprogs-1.45.4-mke2fs.conf-Disable-fname_encoding-feature.patch +Patch2: e2fsprogs-1.45.4-Revert-fuse2fs-install-fuse2fs-in-usr-bin-instead-of.patch +Patch3: e2fsprogs-1.45.4-mke2fs.conf-Introduce-rhel6-and-rhel7-fs_type.patch +Patch4: e2fsprogs-1.45.4-man-Add-note-about-RHEL8-supported-features-and-moun.patch +Patch5: e2fsprogs-1.45.5-libext2fs-fix-bug-when-reading-or-writing-more-than-.patch +Patch6: e2fsprogs-1.45.5-libext2fs-fix-UBSan-when-updating-an-inline_data-fil.patch +Patch7: e2fsprogs-1.45.5-Fix-UBSan-when-shifting-1LL-63.patch +Patch8: e2fsprogs-1.45.5-libext2fs-properly-free-the-bitmaps-in-read_bitmap-s.patch +Patch9: e2fsprogs-1.45.5-libext2fs-verify-the-block-numbers-for-the-allocatio.patch +Patch10: e2fsprogs-1.45.5-tune2fs-prohibit-toggling-uninit_bg-on-live-filesyst.patch +Patch11: e2fsprogs-1.45.5-e2fsck-abort-if-there-is-a-corrupted-directory-block.patch +Patch12: e2fsprogs-1.45.5-e2fsck-don-t-try-to-rehash-a-deleted-directory.patch +Patch13: e2fsprogs-1.45.5-e2fsck-fix-use-after-free-in-calculate_tree.patch +Patch14: e2fsprogs-1.45.5-e2fsck-don-t-check-for-future-superblock-times-if-ch.patch +Patch15: e2fsprogs-1.45.5-Revert-libext2fs-revamp-bitmap-types-to-fix-LTO-warn.patch +Patch16: e2fsprogs-1.45.5-Revert-libext2fs-hide-struct-ext2fs_hashmap-as-an-in.patch +Patch17: e2fsprogs-1.45.5-ext2fs-fix-ABI-change-in-the-struct_ext2_filsys-stru.patch +Patch18: e2fsprogs-1.45.5-e2fsck-fix-to-return-ENOMEM-in-alloc_size_dir.patch + +%description +The e2fsprogs package contains a number of utilities for creating, +checking, modifying, and correcting any inconsistencies in second, +third and fourth extended (ext2/ext3/ext4) file systems. E2fsprogs +contains e2fsck (used to repair file system inconsistencies after an +unclean shutdown), mke2fs (used to initialize a partition to contain +an empty ext2 file system), debugfs (used to examine the internal +structure of a file system, to manually repair a corrupted +file system, or to create test cases for e2fsck), tune2fs (used to +modify file system parameters), and most of the other core ext2fs +file system utilities. + +You should install the e2fsprogs package if you need to manage the +performance of an ext2, ext3, or ext4 file system. + +%package libs +Summary: Ext2/3/4 file system specific shared libraries +Group: Development/Libraries +License: GPLv2 and LGPLv2 +Requires: libcom_err%{?_isa} = %{version}-%{release} + +%description libs +E2fsprogs-libs contains libe2p and libext2fs, the libraries of the +e2fsprogs package. + +These libraries are used to directly access ext2/3/4 file systems +from user space. + +%package static +Summary: Ext2/3/4 file system specific static libraries +Group: Development/Libraries +License: GPLv2 and LGPLv2 + +%description static +E2fsprogs-static contains all static libraries built from e2fsprogs, +including libext2fs, libcom_err, libe2p, and libss. + +These libraries are used to directly access ext2/3/4 file systems +from user space, and perform other useful functions. + +%package devel +Summary: Ext2/3/4 file system specific libraries and headers +Group: Development/Libraries +License: GPLv2 and LGPLv2 +Requires: e2fsprogs-libs%{?_isa} = %{version}-%{release} +Requires: libcom_err-devel%{?_isa} = %{version}-%{release} +Requires: gawk +Requires: pkgconfig +Requires(post): info +Requires(preun): info + +%description devel +E2fsprogs-devel contains the libraries and header files needed to +develop second, third and fourth extended (ext2/ext3/ext4) +file system specific programs. + +You should install e2fsprogs-devel if you want to develop ext2/3/4 +file system specific programs. If you install e2fsprogs-devel, you'll +also want to install e2fsprogs. + +%package -n libcom_err +Summary: Common error description library +Group: Development/Libraries +License: MIT + +%description -n libcom_err +This is the common error description library, part of e2fsprogs. + +libcom_err is an attempt to present a common error-handling mechanism. + +%package -n libcom_err-devel +Summary: Common error description library +Group: Development/Libraries +License: MIT +Requires: libcom_err%{?_isa} = %{version}-%{release} +Requires: pkgconfig + +%description -n libcom_err-devel +This is the common error description development library and headers, +part of e2fsprogs. It contains the compile_et command, used +to convert a table listing error-code names and associated messages +messages into a C source file suitable for use with the library. + +libcom_err is an attempt to present a common error-handling mechanism. + +%package -n libss +Summary: Command line interface parsing library +Group: Development/Libraries +License: MIT +Requires: libcom_err%{?_isa} = %{version}-%{release} + +%description -n libss +This is libss, a command line interface parsing library, part of e2fsprogs. + +This package includes a tool that parses a command table to generate +a simple command-line interface parser, the include files needed to +compile and use it. + +It was originally inspired by the Multics SubSystem library. + +%package -n libss-devel +Summary: Command line interface parsing library +Group: Development/Libraries +License: MIT +Requires: libss%{?_isa} = %{version}-%{release} +Requires: pkgconfig + +%description -n libss-devel +This is the command line interface parsing (libss) development library +and headers, part of e2fsprogs. It contains the mk_cmds command, which +parses a command table to generate a simple command-line interface parser. + +It was originally inspired by the Multics SubSystem library. + +%prep +%setup -q + +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 +%patch6 -p1 +%patch7 -p1 +%patch8 -p1 +%patch9 -p1 +%patch10 -p1 +%patch11 -p1 +%patch12 -p1 +%patch13 -p1 +%patch14 -p1 +%patch15 -p1 +%patch16 -p1 +%patch17 -p1 +%patch18 -p1 + +%build +%configure CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" \ + --enable-elf-shlibs --enable-nls --disable-uuidd --disable-fsck \ + --disable-e2initrd-helper --disable-libblkid --disable-libuuid \ + --enable-quota --with-root-prefix=/usr +make V=1 %{?_smp_mflags} + +%install +rm -rf %{buildroot} +export PATH=/sbin:$PATH +make install install-libs DESTDIR=%{buildroot} INSTALL="%{__install} -p" \ + root_sbindir=%{_sbindir} root_libdir=%{_libdir} + +# Replace arch-dependent header file with arch-independent stub (when needed). +%multilib_fix_c_header --file %{_includedir}/ext2fs/ext2_types.h + +# Hack for now, otherwise strip fails. +chmod +w %{buildroot}%{_libdir}/*.a + +%find_lang %{name} + +%check +make fullcheck + +%post libs -p /sbin/ldconfig +%postun libs -p /sbin/ldconfig + +%post devel +# Test for file; if installed with --excludedocs it may not be there +if [ -f %{_infodir}/libext2fs.info.gz ]; then + /sbin/install-info %{_infodir}/libext2fs.info.gz %{_infodir}/dir || : +fi + +%preun devel +if [ $1 = 0 -a -f %{_infodir}/libext2fs.info.gz ]; then + /sbin/install-info --delete %{_infodir}/libext2fs.info.gz %{_infodir}/dir || : +fi +exit 0 + +%post -n libcom_err -p /sbin/ldconfig +%postun -n libcom_err -p /sbin/ldconfig + +%post -n libss -p /sbin/ldconfig +%postun -n libss -p /sbin/ldconfig + +%files -f %{name}.lang +%doc README +%{!?_licensedir:%global license %%doc} + +%config(noreplace) /etc/mke2fs.conf +%{_sbindir}/badblocks +%{_sbindir}/debugfs +%{_sbindir}/dumpe2fs +%{_sbindir}/e2fsck +%{_sbindir}/e2image +%{_sbindir}/e2label +%{_sbindir}/e2mmpstatus +%{_sbindir}/e2undo +%{_sbindir}/e4crypt +%{_sbindir}/fsck.ext2 +%{_sbindir}/fsck.ext3 +%{_sbindir}/fsck.ext4 +%{_sbindir}/fuse2fs +%{_sbindir}/logsave +%{_sbindir}/mke2fs +%{_sbindir}/mkfs.ext2 +%{_sbindir}/mkfs.ext3 +%{_sbindir}/mkfs.ext4 +%{_sbindir}/resize2fs +%{_sbindir}/tune2fs +%{_sbindir}/filefrag +%{_sbindir}/e2freefrag +%{_sbindir}/e4defrag +%{_sbindir}/mklost+found + +%{_bindir}/chattr +%{_bindir}/lsattr +%{_mandir}/man1/chattr.1* +%{_mandir}/man1/fuse2fs.1* +%{_mandir}/man1/lsattr.1* + +%{_mandir}/man5/ext2.5* +%{_mandir}/man5/ext3.5* +%{_mandir}/man5/ext4.5* +%{_mandir}/man5/e2fsck.conf.5* +%{_mandir}/man5/mke2fs.conf.5* + +%{_mandir}/man8/badblocks.8* +%{_mandir}/man8/debugfs.8* +%{_mandir}/man8/dumpe2fs.8* +%{_mandir}/man8/e2fsck.8* +%{_mandir}/man8/e4crypt.8* +%{_mandir}/man8/filefrag.8* +%{_mandir}/man8/e2freefrag.8* +%{_mandir}/man8/e4defrag.8* +%{_mandir}/man8/fsck.ext2.8* +%{_mandir}/man8/fsck.ext3.8* +%{_mandir}/man8/fsck.ext4.8* +%{_mandir}/man8/e2image.8* +%{_mandir}/man8/e2label.8* +%{_mandir}/man8/e2mmpstatus.8* +%{_mandir}/man8/e2undo.8* +%{_mandir}/man8/logsave.8* +%{_mandir}/man8/mke2fs.8* +%{_mandir}/man8/mkfs.ext2.8* +%{_mandir}/man8/mkfs.ext3.8* +%{_mandir}/man8/mkfs.ext4.8* +%{_mandir}/man8/mklost+found.8* +%{_mandir}/man8/resize2fs.8* +%{_mandir}/man8/tune2fs.8* + +%files libs +%{!?_licensedir:%global license %%doc} +%license NOTICE +%{_libdir}/libe2p.so.* +%{_libdir}/libext2fs.so.* + +%files static +%{!?_licensedir:%global license %%doc} +%license NOTICE +%{_libdir}/*.a + +%files devel +%{_infodir}/libext2fs.info* +%{_libdir}/libe2p.so +%{_libdir}/libext2fs.so +%{_libdir}/pkgconfig/e2p.pc +%{_libdir}/pkgconfig/ext2fs.pc + +%{_includedir}/e2p +%{_includedir}/ext2fs + +%files -n libcom_err +%{!?_licensedir:%global license %%doc} +%license NOTICE +%{_libdir}/libcom_err.so.* + +%files -n libcom_err-devel +%{_bindir}/compile_et +%{_libdir}/libcom_err.so +%{_datadir}/et +%{_includedir}/et +%{_includedir}/com_err.h +%{_mandir}/man1/compile_et.1* +%{_mandir}/man3/com_err.3* +%{_libdir}/pkgconfig/com_err.pc + +%files -n libss +%{!?_licensedir:%global license %%doc} +%license NOTICE +%{_libdir}/libss.so.* + +%files -n libss-devel +%{_bindir}/mk_cmds +%{_libdir}/libss.so +%{_datadir}/ss +%{_includedir}/ss +%{_mandir}/man1/mk_cmds.1* +%{_libdir}/pkgconfig/ss.pc + +%changelog +* 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) + +* Wed May 15 2019 Lukas Czerner 1.44.6-2 +- Backport fixes from 1.45.1 + +* Tue Apr 2 2019 Lukas Czerner 1.44.6-1 +- Rebase to the release 1.44.6 (#1695147) +- Backport fixes from 1.45.0 +- Add gating.yaml (#1679654) + +* Fri Dec 14 2018 Lukas Czerner 1.44.3-2 +- Backport fixes from upstream version 1.44.4 (#1659526) + +* Wed Jul 18 2018 Lukas Czerner 1.44.3-1 +- New upstream release + +* Wed Feb 07 2018 Fedora Release Engineering - 1.43.8-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Tue Jan 9 2018 Lukas Czerner 1.43.8-1 +- New upstream release +- Fix build failure swapfs.c on big-endian + +* Wed Oct 18 2017 Eric Sandeen 1.43.7-1 +- New upstream release + +* Wed Aug 30 2017 Eric Sandeen 1.43.6-1 +- New upstream release + +* Fri Aug 11 2017 Kalev Lember 1.43.5-2 +- Bump and rebuild for an rpm signing issue + +* Tue Aug 08 2017 Eric Sandeen 1.43.5-1 +- New upstream release + +* Wed Aug 02 2017 Fedora Release Engineering - 1.43.4-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 1.43.4-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Wed Feb 01 2017 Stephen Gallagher - 1.43.4-2 +- Add missing %%license macro + +* Tue Jan 31 2017 Eric Sandeen 1.43.4-1 +- New upstream release + +* Mon Sep 05 2016 Eric Sandeen 1.43.3-1 +- New upstream release + +* Mon Sep 05 2016 Eric Sandeen 1.43.2-1 +- New upstream release (broken on i686, not built) + +* Thu Jun 16 2016 Eric Sandeen 1.43.1-2 +- Fix e2undo endian issues (#1344636) + +* Wed Jun 08 2016 Eric Sandeen 1.43.1-1 +- New upstream release + +* Wed Feb 03 2016 Fedora Release Engineering - 1.42.13-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Wed Jun 17 2015 Fedora Release Engineering - 1.42.13-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Mon Jun 08 2015 Eric Sandeen 1.42.13-2 +- Add -fno-strict-aliasing (#1211582) + +* Mon May 18 2015 Eric Sandeen 1.42.13-1 +- New upstream release + +* Thu Apr 30 2015 Eric Sandeen 1.42.12-5 +- Don't trigger full check within time fudge window (#1202024) + +* Tue Feb 24 2015 Eric Sandeen 1.42.12-4 +- Fix potential buffer overflow in closefs (#1193947, CVE-2015-1572) +- Fix dumpe2fs segfault with no arguments (#1194063) +- Don't require fsck prior to resize2fs -P (#1170803) + +* Sat Feb 21 2015 Till Maas - 1.42.12-3 +- Rebuilt for Fedora 23 Change + https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-independent_code + +* Tue Feb 17 2015 Eric Sandeen 1.42.12-2 +- Fix use after free (#1192861) +- Fix time-based fsck if set in superblock (e2fsck.conf, #963283) + +* Fri Aug 29 2014 Eric Sandeen 1.42.12-1 +- New upstream release + +* Sat Aug 16 2014 Fedora Release Engineering - 1.42.11-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Sat Jul 12 2014 Tom Callaway 1.42.11-2 +- fix license handling + +* Fri Jul 11 2014 Eric Sandeen 1.42.11-1 +- New upstream release + +* Tue Jul 01 2014 Dan Horák - 1.42.10-5 +- Rebuilt for buggy rpm 4.12 alpha - + https://lists.fedoraproject.org/pipermail/devel/2014-June/200633.html + +* Mon Jun 30 2014 Dan Horák - 1.42.10-4 +- Add missing dependency info for quota.c - fixes build on s390(x) + +* Sat Jun 07 2014 Fedora Release Engineering - 1.42.10-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Wed May 21 2014 Eric Sandeen 1.42.10-2 +- Fix large file handling on 32-bit builds + +* Mon May 19 2014 Eric Sandeen 1.42.10-1 +- New upstream release +- Enable userspace quota + +* Mon Jan 20 2014 Eric Sandeen 1.42.9-2 +- Fix up Source0 URL + +* Thu Jan 02 2014 Eric Sandeen 1.42.9-1 +- New upstream release +- Re-enable disabled tests for now + +* Sat Aug 03 2013 Fedora Release Engineering - 1.42.8-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Mon Jul 22 2013 Eric Sandeen 1.42.8-2 +- Interpackage dependencies should be for same arch +- Remove newly added but failing resize2fs tests for now + +* Wed Jun 26 2013 Eric Sandeen 1.42.8-1 +- New upstream release + +* Tue Jan 29 2013 Eric Sandeen 1.42.7-2 +- Tighten up inter-package dependencies + +* Tue Jan 22 2013 Eric Sandeen 1.42.7-1 +- New upstream release + +* Tue Oct 02 2012 Eric Sandeen 1.42.6-2 +- Switch back to gzipped tarball to make sf.net source URL correct + +* Tue Oct 02 2012 Eric Sandeen 1.42.6-1 +- New upstream release + +* Thu Aug 16 2012 Eric Sandeen 1.42.5-2 +- Add explicit library deps to e2fsprogs (#848805) + +* Mon Jul 30 2012 Eric Sandeen 1.42.5-1 +- New upstream release + +* Wed Jul 18 2012 Fedora Release Engineering - 1.42.4-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Tue Jun 12 2012 Eric Sandeen 1.42.4-1 +- New upstream release + +* Thu May 31 2012 Eric Sandeen 1.42.3-2 +- Fixes for > 16T filesystems + +* Mon May 14 2012 Eric Sandeen 1.42.3-1 +- New upstream release + +* Sun Apr 22 2012 Eric Sandeen 1.42.2-6 +- Add missing [options] tag to e2fsck.conf + +* Fri Apr 20 2012 Eric Sandeen 1.42.2-5 +- Add broken system clock config to e2fsck.conf to let boot + continue even if system clock very wrong. + +* Mon Apr 09 2012 Eric Sandeen 1.42.2-4 +- Handle 32-bit bitmaps in new find_first_zero functions + +* Fri Mar 30 2012 Richard W.M. Jones 1.42.2-3 +- Rebuild against new RPM (RHBZ#808250). + +* Wed Mar 28 2012 Eric Sandeen 1.42.2-2 +- Move files out of /sbin and /lib into /usr/... + +* Tue Mar 27 2012 Eric Sandeen 1.42.2-1 +- New upstream release + +* Mon Feb 20 2012 Eric Sandeen 1.42.1-1 +- New upstream release + +* Fri Jan 13 2012 Fedora Release Engineering - 1.42-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Tue Nov 29 2011 Eric Sandeen 1.42-1 +- New upstream point release + +* Mon Nov 21 2011 Eric Sandeen 1.42-0.9.WIP.1120 +- Build the right tarball for 1.42-WIP-1120 + +* Mon Nov 21 2011 Eric Sandeen 1.42-0.8.WIP.1120 +- New upstream snapshot release + +* Thu Nov 10 2011 Eric Sandeen 1.42-0.7.WIP.1016 +- Several mmp-related fixes + +* Tue Nov 08 2011 Eric Sandeen 1.42-0.6.WIP.1016 +- Fix e2fsck / make check on big endian arch + +* Mon Oct 17 2011 Eric Sandeen 1.42-0.5.WIP.1016 +- New upstream snapshot release + +* Mon Oct 10 2011 Eric Sandeen 1.42-0.4.WIP.2011.1009 +- New upstream snapshot release + +* Mon Sep 26 2011 Eric Sandeen 1.42-0.3.WIP.0925 +- New upstream snapshot release + +* Tue Aug 09 2011 Eric Sandeen 1.42-0.2.WIP.0702 +- Fix use of uninitialized memory via ext2fs_copy_generic_bmap() + +* Tue Aug 09 2011 Eric Sandeen 1.42-0.1.WIP.0702 +- Test release for >16T support + +* Tue Feb 08 2011 Fedora Release Engineering - 1.41.14-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Thu Dec 23 2010 Eric Sandeen 1.41.14-1 +- New upstream release + +* Wed Dec 22 2010 Dan Horák 1.41.13-2 +- Add upstream fix for big-endian machines + +* Mon Dec 20 2010 Eric Sandeen 1.41.13-1 +- New upstream release + +* Tue Dec 07 2010 Eric Sandeen 1.41.12-7 +- Fix up UTF-8 formatting in e2fsck output (#655227) + +* Wed Oct 06 2010 Eric Sandeen 1.41.12-6 +- Install e4defrag for testing + +* Tue Jul 13 2010 Eric Sandeen 1.41.12-5 +- Relax fsck requirements for resize2fs -P + +* Mon Jul 12 2010 Eric Sandeen 1.41.12-4 +- Add COPYING file to the static subpackage + +* Wed Jun 02 2010 Eric Sandeen 1.41.12-3 +- Reinstate static libs in dedicated package (#596377) + +* Wed May 19 2010 Eric Sandeen 1.41.12-2 +- Fix fsck thinko in 1.41.12 release + +* Mon May 17 2010 Eric Sandeen 1.41.12-1 +- New upstream version + +* Mon Mar 15 2010 Eric Sandeen 1.41.11-1 +- New upstream version + +* Mon Mar 01 2010 Eric Sandeen 1.41.10-5 +- Don't ask for confirmation of misaligned mkfs with -F (#569021) + +* Tue Feb 23 2010 Eric Sandeen 1.41.10-4 +- Fix for e2fsck -fD corruption + +* Fri Feb 12 2010 Eric Sandeen 1.41.10-3 +- And drop virtual provides for static libs + +* Fri Feb 12 2010 Eric Sandeen 1.41.10-2 +- Drop static libs (#545144) + +* Wed Feb 10 2010 Eric Sandeen 1.41.10-1 +- New upstream version + +* Sun Feb 07 2010 Eric Sandeen 1.41.9-10 +- Upstream version of resize2fs array fix, original was wrong + +* Sat Jan 23 2010 Eric Sandeen 1.41.9-9 +- Fix up stray output & re-enable make check +- Fix dlopen issues for newer libreadline +- Fix access beyond end of array in resize2fs + +* Tue Nov 10 2009 Eric Sandeen 1.41.9-8 +- Fix up topology patch to build w/ new util-linux-ng +- Fix endian swapping of backup journal blocks in sb + +* Tue Nov 10 2009 Eric Sandeen 1.41.9-7 +- Re-enable "make check" during build + +* Wed Oct 28 2009 Eric Sandeen 1.41.9-6 +- Add support for block discard (TRIM) at mkfs time +- Add support for new blkid topology awareness + +* Mon Oct 19 2009 Eric Sandeen 1.41.9-5 +- Allow superblock timestamp differences up to 24h (#522969) + +* Tue Oct 06 2009 Eric Sandeen 1.41.9-4 +- Fix install with --excludedocs (#515987) + +* Mon Sep 14 2009 Eric Sandeen 1.41.9-3 +- Drop defrag bits for now, not ready yet. + +* Thu Sep 10 2009 Josef Bacik 1.41.9-2 +- Fix resize -m bug with flexbg (#519131) + +* Sun Aug 23 2009 Eric Sandeen 1.41.9-1 +- New upstream release + +* Thu Aug 06 2009 Eric Sandeen 1.41.8-6 +- Fix filefrag in fallback case +- Add e2freefrag & e4defrag (experimental) + +* Sun Jul 26 2009 Karel Zak 1.41.8-5 +- disable fsck (replaced by util-linux-ng) + +* Sat Jul 25 2009 Karel Zak 1.41.8-4 +- disable libuuid and uuidd (replaced by util-linux-ng) + +* Fri Jul 24 2009 Fedora Release Engineering - 1.41.8-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Fri Jul 17 2009 Eric Sandeen 1.41.8-2 +- Address some package review concerns (#225714) + +* Sun Jul 12 2009 Eric Sandeen 1.41.8-1 +- New upstream version, several resize fixes. + +* Tue Jun 30 2009 Eric Sandeen 1.41.7-1 +- New upstream version + +* Fri Jun 26 2009 Eric Sandeen 1.41.6-6 +- Split out sub-libraries (#225406) +- Don't start uuidd by default + +* Thu Jun 18 2009 Eric Sandeen 1.41.6-5 +- Update journal backup blocks in sb after resize (#505339) +- Fix memory leak in extent handling functions +- Fix bug in inode writing in extent code, clobbered i_extra_isize etc + +* Mon Jun 8 2009 Karel Zak 1.41.6-4 +- set BuildRequires: libblkid-devel (from util-linux-ng) + +* Mon Jun 8 2009 Karel Zak 1.41.6-3 +- temporary use BuildRequires: e2fsprogs-devel (we cannot install + new util-linux-ng with libblkid to buildroots without new e2fsprogs + without libblkid). + +* Thu Jun 4 2009 Karel Zak 1.41.6-2 +- disable libblkid (replaced by libblkid from util-linux-ng) + +* Sat May 30 2009 Eric Sandeen 1.41.6-1 +- New upstream version + +* Fri Apr 24 2009 Eric Sandeen 1.41.5-1 +- New upstream version + +* Wed Apr 22 2009 Eric Sandeen 1.41.4-8 +- Fix support for external journals + +* Wed Apr 22 2009 Eric Sandeen 1.41.4-7 +- Fix ext4 resize issues (#496982) + +* Sat Apr 11 2009 Eric Sandeen 1.41.4-6 +- ignore differing NEEDS_RECOVERY flag on fsck post-resize (#471925) + +* Thu Feb 26 2009 Eric Sandeen 1.41.4-5 +- fix a couple missed descriptions; obsolete e4fsprogs + +* Thu Feb 26 2009 Eric Sandeen 1.41.4-4 +- Edit summary & description to include ext4 (#487469) +- Fix blkid null ptr deref in initrd (#486997) + +* Tue Feb 24 2009 Fedora Release Engineering - 1.41.4-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Thu Jan 29 2009 Eric Sandeen 1.41.4-2 +- Fix debugfs "stat" segfault if no open fs (#482894) +- Fix name of libext2fs info page (#481620) + +* Thu Jan 29 2009 Eric Sandeen 1.41.4-1 +- New upstream release +- Dropped btrfs & resize fixes, upstream now + +* Tue Jan 20 2009 Eric Sandeen 1.41.3-4 +- resize2fs fixes, esp. for ext4 + +* Sat Jan 10 2009 Eric Sandeen 1.41.3-3 +- Remove conservative "don't change journal location" patch for F11 +- Add btrfs recognition to blkid + +* Fri Nov 07 2008 Eric Sandeen 1.41.3-2 +- Bump to revision 2, f10 was behind f9, oops. + +* Mon Oct 13 2008 Eric Sandeen 1.41.3-1 +- New upstream version (very minor fixes, ext4-related) + +* Thu Oct 02 2008 Eric Sandeen 1.41.2-2 +- Fix blkid to recognize ext4dev filesystems as ext4-mountable + +* Thu Oct 02 2008 Eric Sandeen 1.41.2-1 +- New upstream version +- Updated default dir hash (half_md4) for better perf & fewer collisions +- Fixed ext4 online resizing with flex_bg +- ext4 journal now in extents format and in middle of filesystem +- fix unreadable e2image files +- fix file descriptor leak in libcom_err (#464689) + +* Sat Aug 23 2008 Eric Sandeen 1.41.0-2 +- Don't check the group checksum when !GDT_CSUM (#459875) + +* Thu Jul 10 2008 Eric Sandeen 1.41.0-1 +- New upstream version +- ext4 capable + +* Mon Jul 07 2008 Eric Sandeen 1.41-0.2.WIP.0707 +- Fix release macro snafu + +* Mon Jul 07 2008 Eric Sandeen 1.41-0.1.WIP.0707 +- New upstream snapshot release + +* Fri Jun 20 2008 Eric Sandeen 1.41-0.WIP.0617.1 +- Fix blkid -g segfault when clearing entries (#452333) + +* Wed Jun 18 2008 Eric Sandeen 1.41-0.WIP.0617 +- New upstream snapshot release for ext4 capability + +* Wed Jun 04 2008 Eric Sandeen 1.40.10-3 +- Tidy up multilib hack for non-multilib arches (#446016) +- Fix up postun script (#449868) + +* Wed Jun 04 2008 Dennis Gilmore 1.40.10-2 +- setup header support for sparc + +* Fri May 23 2008 Eric Sandeen 1.40.10-1 +- New upstream version +- Fixes unprivileged blkid use problem (#448591) + +* Mon May 12 2008 Eric Sandeen 1.40.9-2 +- Fix blkid swap recognition on big-endian boxes (#445786) + +* Sun Apr 27 2008 Eric Sandeen 1.40.9-1 +- New upstream version + +* Fri Mar 14 2008 Eric Sandeen 1.40.8-2 +- Update ext2fs_swap_inode_full() fix to match upstream +- Check more of swapv1 header in blkid detection (#442937) + +* Fri Mar 14 2008 Eric Sandeen 1.40.8-1 +- New upstream version + +* Mon Mar 03 2008 Eric Sandeen 1.40.7-2 +- second try at fixing resize2fs vs. large inodes... (#434893) + +* Fri Feb 29 2008 Eric Sandeen 1.40.7-1 +- New upstream version, special leap-day edition +- Fix resize2fs losing inline xattrs when shrinking (#434893) + and add patch to fix swap_inode_full in this case +- Allow mke2fs & tune2fs to manipulate large_file feature (#258381) +- Handle lvm error conditions in libblkid (#433857) +- Allow tune2fs to clear the resize_inode feature (#167816) +- Teach blkid to detect LVM2 physical volumes (#409321) +- Show "mostly printable" xattrs as text in debugfs (#430621) +- Trimmed pre-1.38 rpm changelog entries + +* Sun Feb 10 2008 Eric Sandeen 1.40.6-1 +- New upstream version + +* Fri Feb 08 2008 Eric Sandeen 1.40.5-2 +- gcc-4.3 rebuild + +* Mon Jan 28 2008 Eric Sandeen 1.40.5-1 +- New upstream version, drop several now-upstream patches. + +* Thu Jan 24 2008 Eric Sandeen 1.40.4-7 +- Fix sb flag comparisons properly this time (#428893) +- Make 256-byte inodes for the [default] mkfs case. + This will facilitate upgrades to ext4 later, and help xattr perf. + +* Wed Jan 23 2008 Eric Sandeen 1.40.4-6 +- Completely clobber e2fsck.static build. + +* Wed Jan 23 2008 Eric Sandeen 1.40.4-5 +- Ignore some primary/backup superblock flag differences (#428893) +- Teach libblkid about ext4dev. + +* Tue Jan 15 2008 Eric Sandeen 1.40.4-4 +- Build e2fsck as a dynamically linked binary. +- Re-fix uidd manpage default paths. + +* Mon Jan 14 2008 Eric Sandeen 1.40.4-3 +- New uuidd subpackage, and properly set up uuidd at install. + +* Tue Jan 01 2008 Eric Sandeen 1.40.4-2 +- Add new uidd files to specfile + +* Tue Jan 01 2008 Eric Sandeen 1.40.4-1 +- New upstream version, drop several now-upstream patches. + +* Tue Jan 01 2008 Eric Sandeen 1.40.2-15 +- Drop resize_inode removal patch from tune2fs; ostensibly was + for old kernels which could not mount, but seems to be fine. +- Drop pottcdate removal patch, and don't rebuild .po files, + causes multilib problems and we generally shouldn't rebuild. +- Drop multilib patch; wrapper header should take care of this now. +- Drop ->open rename, Fedora seems ok with this now. + +* Tue Dec 11 2007 Eric Sandeen 1.40.2-14 +- Fix integer overflows (#414591 / CVE-2007-5497) + +* Tue Dec 4 2007 Stepan Kasal 1.40.2-13 +- The -devel package now requires device-mapper-devel, to match + the dependency in blkid.pc (#410791) + +* Tue Nov 27 2007 Eric Sandeen 1.40.2-12 +- Use upstream patch for blkid fat detection, avoids div-by-zero + when encountering some BSD partitions (#398281) + +* Tue Oct 23 2007 Eric Sandeen 1.40.2-11 +- Add arm to multilib header wrapper + +* Sat Oct 20 2007 Eric Sandeen 1.40.2-10 +- Make (more) file timestamps match those in tarball for multilib tidiness +- Fix e2fsprogs-libs summary (shared libs not static) + +* Mon Oct 15 2007 Eric Sandeen 1.40.2-9 +- Detect big-endian squashfs filesystems in libblkid (#305151) + +* Tue Oct 02 2007 Eric Sandeen 1.40.2-8 +- Detect squashfs filesystems in libblkid (#305151) + +* Tue Sep 18 2007 Eric Sandeen 1.40.2-7 +- Fix blkid fat probe when there is a real MBR (#290951) + +* Tue Sep 18 2007 Oliver Falk 1.40.2-6 +- Add alpha to the header wrappers + +* Fri Sep 07 2007 Eric Sandeen 1.40.2-5 +- wrap a couple headers to fix multilib issues (#270441) + +* Wed Aug 29 2007 Eric Sandeen 1.40.2-4 +- add gawk to e2fsprogs-devel Requires, compile_et needs it (#265961) + +* Thu Aug 23 2007 Eric Sandeen 1.40.2-3 +- Update license tags +- Fix one open-create caller with no mode +- Protect ->open ops from glibc open-create-mode-checker +- Fix source URL +- Add gawk to BuildRequires + +* Wed Jul 18 2007 Eric Sandeen 1.40.2-2 +- Fix bug in ext2fs_swap_inode_full() on big-endian boxes + +* Tue Jul 17 2007 Eric Sandeen 1.40.2-1 +- New version 1.40.2 +- Fix up warning in badblocks + +* Mon Jun 25 2007 Eric Sandeen 1.39-15 +- Fix up .po files to remove timestamps; multilib issues (#245653) + +* Fri Jun 22 2007 Eric Sandeen 1.39-14 +- Many coverity-found potential leaks, segfaults, etc (#239354) +- Fix debugfs segfaults when no fs open (#208416, #209330) +- Avoid recursive loops in logdump due to symlinks in /dev (#210371) +- Don't write changes to the backup superblocks by default (#229561) +- Correct byteswapping for fast symlinks with xattrs (#232663) +- e2fsck: added sanity check for xattr validation (#230193) + +* Wed Jun 20 2007 Eric Sandeen 1.39-13 +- add dist tag to release field + +* Wed Jun 20 2007 Eric Sandeen 1.39-12 +- add LUKS support to libblkid (#242421) + +* Fri Feb 23 2007 Karsten Hopp 1.39-11 +- fix post/preun requirements +- use smp flags + +* Mon Feb 05 2007 Alasdair Kergon - 1.39-10 +- Add build dependency on new device-mapper-devel package. + +* Mon Dec 25 2006 Thomas Woerner - 1.39-9 +- build fixes for new automake 1.10 (#220715) + +* Mon Dec 18 2006 Thomas Woerner - 1.39-8 +- make uuid_generate_time generate unique uuids (#218606) + +* Wed Sep 20 2006 Jarod Wilson - 1.39-7 +- 32-bit 16T fixups from esandeen (#202807) +- Update summaries and descriptions + +* Sun Sep 17 2006 Karel Zak - 1.39-6 +- Fix problem with empty FAT label (#206656) + +* Tue Sep 5 2006 Peter Jones - 1.39-5 +- Fix memory leak in device probing. + +* Mon Jul 24 2006 Thomas Woerner - 1.39-4 +- fixed multilib devel conflicts (#192665) + +* Thu Jul 20 2006 Bill Nottingham - 1.39-3 +- prevent libblkid returning /dev/dm-X + +* Wed Jul 12 2006 Jesse Keating - 1.39-2.1 +- rebuild + +* Mon Jul 10 2006 Karel Zak - 1.39-2 +- add GFS abd GFS2 support to libblkid + +* Thu Jul 6 2006 Thomas Woerner - 1.39-1 +- new version 1.39 +- dropped ext2online, because resize2fs is now able to do online resize +- spec file cleanup +- enabled checks for build + +* Tue Jun 13 2006 Bill Nottingham - 1.38-15 +- prevent libblkid returning /dev/dm-X +- fix build + +* Tue Mar 21 2006 Karel Zak - 1.38-14 +- prevent error messages to stderr caused by libblkid calling libdevmapper + +* Mon Mar 13 2006 Karel Zak - 1.38-13 +- used upstream version of the blkid-epoch patch (by Theodore Tso, #182188) + +* Wed Mar 8 2006 Peter Jones - 1.38-12 +- Move /etc/blkid.tab to /etc/blkid/blkid.tab + +* Tue Mar 7 2006 David Cantrell - 1.38-11 +- BuildRequires pkgconfig + +* Tue Mar 7 2006 David Cantrell - 1.38-10 +- Disable /etc/blkid.tab caching if time is set before epoch (#182188) + +* Fri Feb 24 2006 Peter Jones - 1.38-9 +- _don't_ handle selinux context on blkid.tab, dwalsh says this is a no-no. + +* Wed Feb 22 2006 Peter Jones - 1.38-8 +- handle selinux context on blkid.tab + +* Mon Feb 20 2006 Karsten Hopp 1.38-7 +- BuildRequires: gettext-devel + +* Fri Feb 10 2006 Jesse Keating - 1.38-6.2 +- bump again for double-long bug on ppc(64) + +* Tue Feb 7 2006 Jesse Keating - 1.38-6.1 +- rebuilt for new gcc4.1 snapshot and glibc changes + +* Wed Jan 11 2006 Karel Zak 1.38-6 +- cleanup device-mapper patch +- use pkg-config for device-mapper + +* Mon Jan 9 2006 Peter Jones 1.38-5 +- fix some more minor logic errors in dm probing + +* Wed Jan 4 2006 Peter Jones 1.38-4 +- fix a logic error in dm probing +- add priority group for dm devices, so they'll be preferred + +* Tue Jan 3 2006 Peter Jones 1.38-3 +- added support for device-mapper devices + +* Fri Dec 9 2005 Jesse Keating +- rebuilt + +* Thu Nov 10 2005 Thomas Woerner 1.38-2.1 +- fixed file conflicts between 32bit and 64bit packages (#168815) +- fixed mklost+found crashes with buffer overflow (#157773) + Thanks to Arjan van de Ven for the patch + +* Wed Nov 9 2005 Thomas Woerner 1.38-2 +- splitted up libs from main package, into a new e2fsprogs-libs package +- fixed requires and prereqs + +* Thu Sep 8 2005 Thomas Woerner 1.38-1 +- new version 1.38 +- Close File descriptor for unregognized devices (#159878) + Thanks to David Milburn for the patch. + Merged from RHEL-4 +- enable tune2fs to set and clear feature resize_inode (#167816) +- removed outdated information from ext2online man page (#164383) +