Compare commits

..

2 Commits

Author SHA1 Message Date
Brian J. Murrell
c3a8b7f87c Replace Recommends: sendmail with Recommends: /usr/sbin/sendmail
Replace Recommends: sendmail with Recommends: /usr/sbin/sendmail

There is no need to require the sendmail package specifically as many
other packages provide a sendmail command that could be used.

Instead, Recommends: /usr/sbin/sendmail which covers any number of other
packages that provide a sendmail command.

Signed-off-by: Brian J. Murrell <brian@interlinx.bc.ca>
2023-12-30 17:55:28 +00:00
2daec440ef Build and package e2scrub utility
Signed-off-by: Brian J. Murrell <brian@interlinx.bc.ca>
2023-12-28 09:23:02 -05:00
4 changed files with 43 additions and 137 deletions

View File

@ -1,38 +0,0 @@
From 06116f6d053e398d13634df911bcb105d0fb2416 Mon Sep 17 00:00:00 2001
From: Lukas Czerner <lczerner@redhat.com>
Date: Sun, 15 Dec 2019 12:42:28 +0100
Subject: [PATCH 1/7] Makefile.in: Disable e2scrub
e2scrub system is still new and we're not ready to support it yet, so
just disbale it and not even build it.
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
---
Makefile.in | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/Makefile.in b/Makefile.in
index b951c017..34e2048d 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -13,7 +13,6 @@ INSTALL = @INSTALL@
@DEBUGFS_CMT@DEBUGFS_DIR= debugfs
@UUID_CMT@UUID_LIB_SUBDIR= lib/uuid
@BLKID_CMT@BLKID_LIB_SUBDIR= lib/blkid
-@E2SCRUB_CMT@E2SCRUB_DIR= scrub
@ALL_CMT@SUPPORT_LIB_SUBDIR= lib/support
@ALL_CMT@E2P_LIB_SUBDIR= lib/e2p
@ALL_CMT@EXT2FS_LIB_SUBDIR= lib/ext2fs
@@ -21,8 +20,7 @@ INSTALL = @INSTALL@
LIB_SUBDIRS=lib/et lib/ss $(E2P_LIB_SUBDIR) $(UUID_LIB_SUBDIR) \
$(BLKID_LIB_SUBDIR) $(SUPPORT_LIB_SUBDIR) $(EXT2FS_LIB_SUBDIR) intl
-PROG_SUBDIRS=e2fsck $(DEBUGFS_DIR) misc $(RESIZE_DIR) tests/progs po \
- $(E2SCRUB_DIR)
+PROG_SUBDIRS=e2fsck $(DEBUGFS_DIR) misc $(RESIZE_DIR) tests/progs po
SUBDIRS=util $(LIB_SUBDIRS) $(PROG_SUBDIRS) tests
--
2.21.3

View File

@ -1,54 +0,0 @@
From 6338a8467564c3a0a12e9fcb08bdd748d736ac2f Mon Sep 17 00:00:00 2001
From: Theodore Ts'o <tytso@mit.edu>
Date: Sun, 17 May 2020 23:05:11 -0400
Subject: [PATCH] libext2fs: retry reading superblock on open when checksum is
bad
When opening a file system which is mounted, it's possible that when
ext2fs_open2() is racing with the kernel modifying the orphaned inode
list, the superblock's checksum could be incorrect. So retry reading
the superblock in the hopes that the problem will self-correct.
Google-Bug-Id: 151453112
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Pavel Reichl <preichl@redhat.com>
---
lib/ext2fs/openfs.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/lib/ext2fs/openfs.c b/lib/ext2fs/openfs.c
index 51b54a44..ae54870e 100644
--- a/lib/ext2fs/openfs.c
+++ b/lib/ext2fs/openfs.c
@@ -134,6 +134,7 @@ errcode_t ext2fs_open2(const char *name, const char *io_options,
int j;
#endif
char *time_env;
+ int csum_retries = 0;
EXT2_CHECK_MAGIC(manager, EXT2_ET_MAGIC_IO_MANAGER);
@@ -221,6 +222,7 @@ errcode_t ext2fs_open2(const char *name, const char *io_options,
if (retval)
goto cleanup;
}
+retry:
retval = io_channel_read_blk(fs->io, superblock, -SUPERBLOCK_SIZE,
fs->super);
if (retval)
@@ -232,8 +234,11 @@ errcode_t ext2fs_open2(const char *name, const char *io_options,
retval = 0;
if (!ext2fs_verify_csum_type(fs, fs->super))
retval = EXT2_ET_UNKNOWN_CSUM;
- if (!ext2fs_superblock_csum_verify(fs, fs->super))
+ if (!ext2fs_superblock_csum_verify(fs, fs->super)) {
+ if (csum_retries++ < 3)
+ goto retry;
retval = EXT2_ET_SB_CSUM_INVALID;
+ }
}
#ifdef WORDS_BIGENDIAN
--
2.48.1

View File

@ -1,35 +0,0 @@
From 43a498e938887956f393b5e45ea6ac79cc5f4b84 Mon Sep 17 00:00:00 2001
From: Theodore Ts'o <tytso@mit.edu>
Date: Thu, 15 Jun 2023 00:17:01 -0400
Subject: [PATCH] resize2fs: use Direct I/O when reading the superblock for
online resizes
If the file system is mounted, the superblock can be changing while
resize2fs is trying to read the superblock, resulting in checksum
failures. One way of avoiding this problem is read the superblock
using Direct I/O, since the kernel makes sure that what gets written
to disk is self-consistent.
Suggested-by: Krister Johansen <kjlx@templeofstupid.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Pavel Reichl <preichl@redhat.com>
---
resize/main.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/resize/main.c b/resize/main.c
index 94f5ec6d..f914c050 100644
--- a/resize/main.c
+++ b/resize/main.c
@@ -403,6 +403,8 @@
if (!(mount_flags & EXT2_MF_MOUNTED))
io_flags = EXT2_FLAG_RW | EXT2_FLAG_EXCLUSIVE;
+ if (mount_flags & EXT2_MF_MOUNTED)
+ io_flags |= EXT2_FLAG_DIRECT_IO;
io_flags |= EXT2_FLAG_64BITS;
if (undo_file) {
--
2.48.1

View File

@ -1,7 +1,7 @@
Summary: Utilities for managing ext2, ext3, and ext4 file systems
Name: e2fsprogs
Version: 1.45.6
Release: 6%{?dist}
Release: 5.1%{?dist}
# License tags based on COPYING file distinctions for various components
License: GPLv2
@ -26,8 +26,8 @@ BuildRequires: libblkid-devel
BuildRequires: libuuid-devel
BuildRequires: gettext
BuildRequires: multilib-rpm-config
BuildRequires: systemd
Patch0: e2fsprogs-1.45.6-Makefile.in-Disable-e2scrub.patch
Patch1: e2fsprogs-1.45.6-Revert-fuse2fs-install-fuse2fs-in-usr-bin-instead-of.patch
Patch2: e2fsprogs-1.45.6-mke2fs.conf-Introduce-rhel6-and-rhel7-fs_type.patch
Patch3: e2fsprogs-1.45.6-man-Add-note-about-RHEL8-supported-features-and-moun.patch
@ -86,8 +86,6 @@ Patch55: e2fsprogs-1.45.6-e2fsck-add-maximum-string-length-specifiers-to-fscan.p
Patch56: e2fsprogs-1.45.6-tests-Add-option-to-print-diff-output-of-failed-test.patch
Patch57: e2fsprogs-1.45.6-libext2fs-add-sanity-check-to-extent-manipulation.patch
Patch58: e2fsprogs-1.45.6-libss-fix-possible-NULL-pointer-dereferece-on-alloca.patch
Patch59: e2fsprogs-1.45.7-libext2fs-retry-reading-superblock-on-open-when-chec.patch
Patch60: e2fsprogs-1.47.1-resize2fs-use-Direct-I-O-when-reading-the-superblock.patch
%description
The e2fsprogs package contains a number of utilities for creating,
@ -203,10 +201,28 @@ parses a command table to generate a simple command-line interface parser.
It was originally inspired by the Multics SubSystem library.
%package -n e2scrub
Summary: Online Ext4 metadata consistency checking tool and service
License: GPLv2 and LGPLv2
Recommends: /usr/sbin/sendmail
Requires: systemd
Requires: util-linux
Requires: lvm2
Requires: e2fsprogs%{?_isa} = %{version}-%{release}
%description -n e2scrub
This package includes e2scrub script that can check ext[234] file system
metadata consistency while the file system is online. It also containes a
systemd service that can be enabled to do consistency check periodically.
The file system consistency check can be performed online and does not
require the file system to be unmounted. It uses lvm snapshots to do this
which means that it can only be done on file systems that are on a lvm
managed device with some free space available in respective volume group.
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
@ -265,8 +281,8 @@ It was originally inspired by the Multics SubSystem library.
%patch56 -p1
%patch57 -p1
%patch58 -p1
%patch59 -p1
%patch60 -p1
%global _udevdir %{_prefix}/lib/udev/rules.d
%build
%configure CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" \
@ -379,6 +395,9 @@ exit 0
%{_mandir}/man8/resize2fs.8*
%{_mandir}/man8/tune2fs.8*
# We do not install e2scrub cron job so just exclude it
%exclude %{_libdir}/e2fsprogs/e2scrub_all_cron
%files libs
%{!?_licensedir:%global license %%doc}
%license NOTICE
@ -428,10 +447,24 @@ exit 0
%{_mandir}/man1/mk_cmds.1*
%{_libdir}/pkgconfig/ss.pc
%files -n e2scrub
%config(noreplace) %{_sysconfdir}/e2scrub.conf
%{_sbindir}/e2scrub
%{_sbindir}/e2scrub_all
%{_mandir}/man8/e2scrub.8*
%{_mandir}/man8/e2scrub_all.8*
%{_libdir}/e2fsprogs/e2scrub_fail
%{_unitdir}/e2scrub@.service
%{_unitdir}/e2scrub_all.service
%{_unitdir}/e2scrub_all.timer
%{_unitdir}/e2scrub_fail@.service
%{_unitdir}/e2scrub_reap.service
%{_udevdir}/96-e2scrub.rules
%changelog
* Thu Jan 23 2025 Pavel Reichl <preichl@redhat.com> 1.45.6-6
- Fix e2fsprogs: online resize fails
- Related: RHEL-60512
* Thu Dec 28 2023 Brian J. Murrell <brian@intelinx.bc.ca> 1.45.6-5.1
- Build and package e2scrub package
- remove e2fsprogs-1.45.6-Makefile.in-Disable-e2scrub.patch
* Wed May 11 2022 Lukas Czerner <lczerner@redhat.com> 1.45.6-5
- Update e2fsprogs with upstream fixes and improvements (#2083621)