Initialize for e2fsprogs
This commit is contained in:
commit
bff07ce9d1
23 changed files with 10060 additions and 0 deletions
2
.e2fsprogs.metadata
Normal file
2
.e2fsprogs.metadata
Normal file
|
@ -0,0 +1,2 @@
|
|||
f5a4cdd7811adc938722c54fa7c16aac211c0e2be332b0efbd95c9fadcdbbfb3 e2fsprogs-1.46.4.tar.sign
|
||||
f0332c7bfb3e13e5591e62e309a9692d6cce4b61babd33bd21230f00d8213a02 e2fsprogs-1.46.4.tar.xz
|
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
e2fsprogs-1.46.4.tar.sign
|
||||
e2fsprogs-1.46.4.tar.xz
|
11
README.SUSE
Normal file
11
README.SUSE
Normal file
|
@ -0,0 +1,11 @@
|
|||
e2fsprogs-devel
|
||||
---------------
|
||||
Since the e2fsprogs libraries has been split out into own packages,
|
||||
each having its own devel package
|
||||
libext2fs-devel
|
||||
libblkid-devel
|
||||
libuuid-devel
|
||||
libcom_err-devel
|
||||
the e2fsprogs-devel package is deprecated and is provided for temporary
|
||||
backwards compatibility only.
|
||||
|
11
baselibs.conf
Normal file
11
baselibs.conf
Normal file
|
@ -0,0 +1,11 @@
|
|||
libext2fs2
|
||||
libcom_err2
|
||||
obsoletes "libcom_err-<targettype> <= <version>"
|
||||
e2fsprogs
|
||||
e2fsprogs-devel
|
||||
libext2fs-devel
|
||||
requires -libext2fs-<targettype>
|
||||
requires "libext2fs2-<targettype> = <version>"
|
||||
libcom_err-devel
|
||||
requires -libcom_err-<targettype>
|
||||
requires "libcom_err2-<targettype> = <version>"
|
81
debugfs-Fix-headers-for-quota-commands.patch
Normal file
81
debugfs-Fix-headers-for-quota-commands.patch
Normal file
|
@ -0,0 +1,81 @@
|
|||
From bdcd8e7bbc374e28fa699031ad2dd83ed4bc70b4 Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kara <jack@suse.cz>
|
||||
Date: Mon, 23 Aug 2021 16:44:25 +0200
|
||||
Subject: [PATCH 7/8] debugfs: Fix headers for quota commands
|
||||
X-Developer-Signature: v=1; a=openpgp-sha256; l=4088; h=from:subject;
|
||||
bh=DMtVDsyxwY63aIschGhsYoFtaRzgKdcoj+H6ag3wBwA=;
|
||||
b=owEBbQGS/pANAwAIAZydqgc/ZEDZAcsmYgBhI8GmjMKrGf+RnVrgOxdjhO+t478ULkN2q+GNTt0j
|
||||
Guy1xK+JATMEAAEIAB0WIQSrWdEr1p4yirVVKBycnaoHP2RA2QUCYSPBpgAKCRCcnaoHP2RA2QAlB/
|
||||
9TcSu83oYIMfsnjdrDQJRJLdaWiCSP5A5IET00b2JGlqWkSjTLUhcJUHPWq5ZB9q2hLp8z4V4DoTBT
|
||||
dsDPDPqSS6PmG5jdbjU29Gz/iOmUSnNl1IDCHhO/HJwg5DA+fbwpIC1tbNfw6XpvvqpTi6yYJ6B1LP
|
||||
byj3D2PLrvqQDtoxc+V90n59U/irl9HqVh6BJOBlhyYvOdbAkvunt6LIsQZvuVmjcpL+TYhcI+S6Ey
|
||||
fkyC3hebYfeKTg/ZQunW3bJkhso+XRQqUPGDTU393G3SFn5lywV2pMhhupdW7Rek0BjymcqDEqyhDS
|
||||
VRa3oN+/KSiVWg1qy2JAM+ErlZu5fU
|
||||
X-Developer-Key: i=jack@suse.cz; a=openpgp;
|
||||
fpr=93C6099A142276A28BBE35D815BC833443038D8C
|
||||
|
||||
list_quota and get_quota commands have 'blocks' header while what they
|
||||
actually show is a used space in bytes. Fix the header to state 'space'
|
||||
instead.
|
||||
|
||||
Signed-off-by: Jan Kara <jack@suse.cz>
|
||||
---
|
||||
debugfs/quota.c | 4 ++--
|
||||
tests/f_orphquot/expect | 4 ++--
|
||||
tests/f_quota/expect.0 | 12 ++++++------
|
||||
3 files changed, 10 insertions(+), 10 deletions(-)
|
||||
|
||||
Index: e2fsprogs-1.46.4/debugfs/quota.c
|
||||
===================================================================
|
||||
--- e2fsprogs-1.46.4.orig/debugfs/quota.c
|
||||
+++ e2fsprogs-1.46.4/debugfs/quota.c
|
||||
@@ -123,7 +123,7 @@ void do_list_quota(int argc, char *argv[
|
||||
|
||||
printf("%7s %2s %8s %8s %8s %8s %8s %8s\n",
|
||||
quota_type[type], "id",
|
||||
- "blocks", "quota", "limit", "inodes", "quota", "limit");
|
||||
+ "space", "quota", "limit", "inodes", "quota", "limit");
|
||||
qh = current_qctx->quota_file[type];
|
||||
retval = qh->qh_ops->scan_dquots(qh, list_quota_callback, NULL);
|
||||
if (retval) {
|
||||
@@ -158,7 +158,7 @@ void do_get_quota(int argc, char *argv[]
|
||||
|
||||
printf("%7s %2s %8s %8s %8s %8s %8s %8s\n",
|
||||
quota_type[type], "id",
|
||||
- "blocks", "quota", "limit", "inodes", "quota", "limit");
|
||||
+ "space", "quota", "limit", "inodes", "quota", "limit");
|
||||
|
||||
qh = current_qctx->quota_file[type];
|
||||
|
||||
Index: e2fsprogs-1.46.4/tests/f_quota/expect.0
|
||||
===================================================================
|
||||
--- e2fsprogs-1.46.4.orig/tests/f_quota/expect.0
|
||||
+++ e2fsprogs-1.46.4/tests/f_quota/expect.0
|
||||
@@ -1,21 +1,21 @@
|
||||
debugfs: list_quota user
|
||||
- user id blocks quota limit inodes quota limit
|
||||
+ user id space quota limit inodes quota limit
|
||||
0 13312 0 0 2 0 0
|
||||
34 1024 0 0 1 0 0
|
||||
100 2048 32 50 2 20 30
|
||||
debugfs: list_quota group
|
||||
- group id blocks quota limit inodes quota limit
|
||||
+ group id space quota limit inodes quota limit
|
||||
0 16384 0 0 5 0 0
|
||||
debugfs: get_quota user 0
|
||||
- user id blocks quota limit inodes quota limit
|
||||
+ user id space quota limit inodes quota limit
|
||||
0 13312 0 0 2 0 0
|
||||
debugfs: get_quota user 100
|
||||
- user id blocks quota limit inodes quota limit
|
||||
+ user id space quota limit inodes quota limit
|
||||
100 2048 32 50 2 20 30
|
||||
debugfs: get_quota user 34
|
||||
- user id blocks quota limit inodes quota limit
|
||||
+ user id space quota limit inodes quota limit
|
||||
34 1024 0 0 1 0 0
|
||||
debugfs: get_quota group 0
|
||||
- group id blocks quota limit inodes quota limit
|
||||
+ group id space quota limit inodes quota limit
|
||||
0 16384 0 0 5 0 0
|
||||
debugfs:
|
43
e2fsck-Do-not-trash-user-limits-when-processing-orph.patch
Normal file
43
e2fsck-Do-not-trash-user-limits-when-processing-orph.patch
Normal file
|
@ -0,0 +1,43 @@
|
|||
From 1f3a91cf868ededb19b3b37caa3352f67e66a10a Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kara <jack@suse.cz>
|
||||
Date: Mon, 23 Aug 2021 17:04:52 +0200
|
||||
Subject: [PATCH 5/8] e2fsck: Do not trash user limits when processing orphan
|
||||
list
|
||||
X-Developer-Signature: v=1; a=openpgp-sha256; l=770; h=from:subject;
|
||||
bh=qzGpt7+UOJv3hwzSLcLGr0hCRSh47K/myPGChyylU8U=;
|
||||
b=owEBbQGS/pANAwAIAZydqgc/ZEDZAcsmYgBhI8GlX5hq3rRf6HziKT8bgW4lwXuVz7w+FuGOUcPK
|
||||
Xw3NgfGJATMEAAEIAB0WIQSrWdEr1p4yirVVKBycnaoHP2RA2QUCYSPBpQAKCRCcnaoHP2RA2R2qCA
|
||||
DhX7BXpS8G05CmyapN9NiAu63JaSVW4o084uvfnud8EdFUMXbOkwGndcOty1Uk09HXfvVkeaZVTmkv
|
||||
pVfz8s4Vi/vjqCPOkxo7HiElNKlm/s/yCGP05ByfwhCqCXKKoaODsbMZJHz4bpUbfxo+qcBD1C0XuE
|
||||
tYgIzL35Jo0rJA65NyBao65L1jTDw4EZGykaYszfZjPayimYg3z2wl0Kv6qT+niYmOw+6w43O6b+6L
|
||||
vgIv8E0XTR0Pc0/JGhfydCSqYM+zoJXpcuURhap0hIo+j3x8FvRGu5ws5tM5Nw0dLmm/MqiDxfBSdA
|
||||
VYBJ83ewrnLu//5q0Kljfxo6T3qN4W
|
||||
X-Developer-Key: i=jack@suse.cz; a=openpgp;
|
||||
fpr=93C6099A142276A28BBE35D815BC833443038D8C
|
||||
|
||||
When e2fsck was loading quotas to process orphan list, it was loading
|
||||
only quota usage. However subsequent quota writeout has effectively
|
||||
overwritten quota limits, loosing them forever. Make sure quota limits
|
||||
are preserved over orphan replay.
|
||||
|
||||
Signed-off-by: Jan Kara <jack@suse.cz>
|
||||
---
|
||||
e2fsck/super.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/e2fsck/super.c b/e2fsck/super.c
|
||||
index 75b7b8ffa9b6..4ffafb211e50 100644
|
||||
--- a/e2fsck/super.c
|
||||
+++ b/e2fsck/super.c
|
||||
@@ -282,7 +282,7 @@ static errcode_t e2fsck_read_all_quotas(e2fsck_t ctx)
|
||||
continue;
|
||||
|
||||
retval = quota_read_all_dquots(ctx->qctx, qf_ino, qtype,
|
||||
- QREAD_USAGE);
|
||||
+ QREAD_USAGE | QREAD_LIMITS);
|
||||
if (retval)
|
||||
break;
|
||||
}
|
||||
--
|
||||
2.26.2
|
||||
|
12
e2fsprogs-1.42-ext2fsh_implicit.patch
Normal file
12
e2fsprogs-1.42-ext2fsh_implicit.patch
Normal file
|
@ -0,0 +1,12 @@
|
|||
Index: lib/ext2fs/ext2fs.h
|
||||
===================================================================
|
||||
--- lib/ext2fs/ext2fs.h.orig
|
||||
+++ lib/ext2fs/ext2fs.h
|
||||
@@ -62,6 +62,7 @@ extern "C" {
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <errno.h>
|
||||
+#include <unistd.h>
|
||||
|
||||
#if EXT2_FLAT_INCLUDES
|
||||
#include "e2_types.h"
|
18
e2fsprogs-1.42-implicit_fortify_decl.patch
Normal file
18
e2fsprogs-1.42-implicit_fortify_decl.patch
Normal file
|
@ -0,0 +1,18 @@
|
|||
Index: lib/ext2fs/mmp.c
|
||||
===================================================================
|
||||
--- lib/ext2fs/mmp.c.orig
|
||||
+++ lib/ext2fs/mmp.c
|
||||
@@ -27,6 +27,13 @@
|
||||
#include "ext2fs/ext2_fs.h"
|
||||
#include "ext2fs/ext2fs.h"
|
||||
|
||||
+#if _BSD_SOURCE || _XOPEN_SOURCE >= 500
|
||||
+#include <netdb.h>
|
||||
+#endif
|
||||
+
|
||||
+#include <string.h>
|
||||
+#include <stdio.h>
|
||||
+
|
||||
#ifndef O_DIRECT
|
||||
#define O_DIRECT 0
|
||||
#endif
|
1485
e2fsprogs.changes
Normal file
1485
e2fsprogs.changes
Normal file
File diff suppressed because it is too large
Load diff
7161
e2fsprogs.keyring
Normal file
7161
e2fsprogs.keyring
Normal file
File diff suppressed because it is too large
Load diff
568
e2fsprogs.spec
Normal file
568
e2fsprogs.spec
Normal file
|
@ -0,0 +1,568 @@
|
|||
#
|
||||
# spec file for package e2fsprogs
|
||||
#
|
||||
# Copyright (c) 2022-2023 ZhuningOS
|
||||
#
|
||||
|
||||
|
||||
%define build_mini 0
|
||||
|
||||
Name: e2fsprogs
|
||||
%if 0%{?suse_version} >= 1010
|
||||
# Hint for ZYPP
|
||||
Supplements: filesystem(ext2) filesystem(ext3) filesystem(ext4)
|
||||
%endif
|
||||
%if 0%{?suse_version} >= 1210
|
||||
%bcond_without systemd
|
||||
%else
|
||||
%bcond_with systemd
|
||||
%endif
|
||||
BuildRequires: libblkid-devel
|
||||
BuildRequires: libuuid-devel
|
||||
BuildRequires: pkg-config
|
||||
BuildRequires: xz
|
||||
%if ! %{build_mini}
|
||||
%if 0%{?suse_version} > 1220
|
||||
BuildRequires: makeinfo
|
||||
%endif
|
||||
# Define info macros if missing (for Fedora builds)
|
||||
%if ! 0%{?suse_version}
|
||||
%define install_info_prereq info
|
||||
%define install_info sbin/install-info
|
||||
%define install_info_delete sbin/install-info --delete
|
||||
Requires(post): %install_info_prereq
|
||||
Requires(preun): %install_info_prereq
|
||||
%endif
|
||||
%endif
|
||||
# bug437293
|
||||
%ifarch ppc64
|
||||
Obsoletes: e2fsprogs-64bit
|
||||
%endif
|
||||
|
||||
%if %{build_mini}
|
||||
Conflicts: e2fsprogs
|
||||
Conflicts: e2fsprogs-devel
|
||||
Conflicts: libext2fs2
|
||||
Conflicts: libext2fs-devel
|
||||
Conflicts: libcom_err2
|
||||
Conflicts: libcom_err-devel
|
||||
%else
|
||||
Conflicts: e2fsprogs-mini
|
||||
Conflicts: e2fsprogs-mini-devel
|
||||
Conflicts: libext2fs2-mini
|
||||
Conflicts: libext2fs-mini-devel
|
||||
Conflicts: libcom_err2-mini
|
||||
Conflicts: libcom_err-mini-devel
|
||||
%endif
|
||||
#
|
||||
Version: 1.46.4
|
||||
Release: 150400.3.3.1
|
||||
Summary: Utilities for the Second Extended File System
|
||||
License: GPL-2.0-only
|
||||
Group: System/Filesystems
|
||||
URL: http://e2fsprogs.sourceforge.net
|
||||
# For regenerate_initrd_post macro
|
||||
Requires(post): /usr/bin/mkdir /usr/bin/touch
|
||||
Requires: libcom_err2 >= %{version}
|
||||
Requires: libext2fs2 >= %{version}
|
||||
Suggests: e2fsprogs-scrub
|
||||
Source: http://www.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/v%{version}/e2fsprogs-%{version}.tar.xz
|
||||
Source2: README.SUSE
|
||||
Source3: baselibs.conf
|
||||
Source4: http://www.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/v%{version}/e2fsprogs-%{version}.tar.sign
|
||||
Source5: https://thunk.org/tytso/tytso-key.asc#/%{name}.keyring
|
||||
#
|
||||
# e2fsprogs patches
|
||||
#
|
||||
# libcom_err patches
|
||||
Patch3: libcom_err-compile_et_permissions.patch
|
||||
Patch4: e2fsprogs-1.42-implicit_fortify_decl.patch
|
||||
Patch5: e2fsprogs-1.42-ext2fsh_implicit.patch
|
||||
Patch6: harden_e2scrub@.service.patch
|
||||
Patch7: harden_e2scrub_all.service.patch
|
||||
Patch8: harden_e2scrub_fail@.service.patch
|
||||
Patch9: harden_e2scrub_reap.service.patch
|
||||
Patch10: libss-add-newer-libreadline.so.8-to-dlopen-path.patch
|
||||
Patch11: quota-Add-support-to-version-0-quota-format.patch
|
||||
Patch12: quota-Fold-quota_read_all_dquots-into-quota_update_l.patch
|
||||
Patch13: quota-Rename-quota_update_limits-to-quota_read_all_d.patch
|
||||
Patch14: tune2fs-Fix-conversion-of-quota-files.patch
|
||||
Patch15: e2fsck-Do-not-trash-user-limits-when-processing-orph.patch
|
||||
Patch16: debugfs-Fix-headers-for-quota-commands.patch
|
||||
Patch17: quota-Drop-dead-code.patch
|
||||
Patch18: libext2fs-add-sanity-check-to-extent-manipulation.patch
|
||||
# Do not suppress make commands
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
|
||||
%description
|
||||
Utilities needed to create and maintain ext2 and ext3 file systems
|
||||
under Linux. Included in this package are: chattr, lsattr, mke2fs,
|
||||
mklost+found, tune2fs, e2fsck, resize2fs, and badblocks.
|
||||
|
||||
%package devel
|
||||
Summary: Dummy development package
|
||||
# bug437293
|
||||
License: LGPL-2.0-only
|
||||
Group: Development/Libraries/C and C++
|
||||
%ifarch ppc64
|
||||
Obsoletes: e2fsprogs-devel-64bit
|
||||
%endif
|
||||
#
|
||||
Requires: libblkid-devel
|
||||
Requires: libext2fs-devel = %version
|
||||
Requires: libuuid-devel
|
||||
|
||||
%description devel
|
||||
Dummy development package for backwards compatibility.
|
||||
|
||||
%if %{build_mini}
|
||||
%package -n e2fsprogs-scrub-mini
|
||||
%else
|
||||
%package -n e2fsprogs-scrub
|
||||
%endif
|
||||
Summary: Ext2fs scrubbing scripts and service files
|
||||
License: GPL-2.0-only
|
||||
Group: System/Filesystems
|
||||
%if %{with systemd}
|
||||
BuildRequires: systemd-rpm-macros
|
||||
%{?systemd_requires}
|
||||
%endif
|
||||
Requires: e2fsprogs
|
||||
Requires: lvm2
|
||||
Requires: postfix
|
||||
Requires: util-linux
|
||||
|
||||
%description -n e2fsprogs-scrub
|
||||
Scripts and systemd service files for background scrubbing of LVM volumes
|
||||
with ext2, ext3, and ext4 filesystems.
|
||||
|
||||
%if %{build_mini}
|
||||
%package -n libext2fs2-mini
|
||||
%else
|
||||
%package -n libext2fs2
|
||||
%endif
|
||||
Summary: Ext2fs library
|
||||
License: LGPL-2.0-only
|
||||
Group: System/Filesystems
|
||||
|
||||
%if %{build_mini}
|
||||
%description -n libext2fs2-mini
|
||||
%else
|
||||
%description -n libext2fs2
|
||||
%endif
|
||||
The basic Ext2fs shared library.
|
||||
|
||||
%if %{build_mini}
|
||||
%package -n libext2fs-mini-devel
|
||||
%else
|
||||
%package -n libext2fs-devel
|
||||
%endif
|
||||
Summary: Development files for libext2fs
|
||||
License: LGPL-2.0-only
|
||||
Group: Development/Libraries/C and C++
|
||||
Requires: libcom_err-devel
|
||||
Requires: libext2fs2 = %version
|
||||
|
||||
%if %{build_mini}
|
||||
%description -n libext2fs-mini-devel
|
||||
%else
|
||||
%description -n libext2fs-devel
|
||||
%endif
|
||||
Development files for libext2fs.
|
||||
|
||||
%if ! %{build_mini}
|
||||
%package -n libext2fs-devel-static
|
||||
Summary: Development files for libext2fs
|
||||
License: LGPL-2.0-only
|
||||
Group: Development/Libraries/C and C++
|
||||
Requires: libext2fs-devel = %{version}
|
||||
Provides: libext2fs-devel:%{_libdir}/libe2p.a
|
||||
Provides: libext2fs-devel:%{_libdir}/libext2fs.a
|
||||
|
||||
%description -n libext2fs-devel-static
|
||||
Development files for libext2fs. Static libraries.
|
||||
%endif
|
||||
|
||||
%if %{build_mini}
|
||||
%package -n libcom_err2-mini
|
||||
%else
|
||||
%package -n libcom_err2
|
||||
%endif
|
||||
Summary: E2fsprogs error reporting library
|
||||
# bug437293
|
||||
License: MIT
|
||||
Group: System/Filesystems
|
||||
%ifarch ppc64
|
||||
Obsoletes: libcom_err-64bit
|
||||
Obsoletes: libcom_err2-64bit
|
||||
%endif
|
||||
#
|
||||
Provides: libcom_err = %{version}
|
||||
Obsoletes: libcom_err <= 1.40
|
||||
|
||||
%if %{build_mini}
|
||||
%description -n libcom_err2-mini
|
||||
%else
|
||||
%description -n libcom_err2
|
||||
%endif
|
||||
com_err is an error message display library.
|
||||
|
||||
%if %{build_mini}
|
||||
%package -n libcom_err-mini-devel
|
||||
%else
|
||||
%package -n libcom_err-devel
|
||||
%endif
|
||||
Summary: Development files for libcom_err
|
||||
# bug437293
|
||||
License: MIT
|
||||
Group: Development/Libraries/C and C++
|
||||
%ifarch ppc64
|
||||
Obsoletes: libcom_err-devel-64bit
|
||||
%endif
|
||||
#
|
||||
Requires: glibc-devel
|
||||
Requires: libcom_err2 = %version
|
||||
|
||||
%if %{build_mini}
|
||||
%description -n libcom_err-mini-devel
|
||||
%else
|
||||
%description -n libcom_err-devel
|
||||
%endif
|
||||
Development files for the com_err error message display library.
|
||||
|
||||
%if ! %{build_mini}
|
||||
%package -n libcom_err-devel-static
|
||||
Summary: Development files for libcom_err, static libraries
|
||||
License: MIT
|
||||
Group: Development/Libraries/C and C++
|
||||
Requires: libcom_err-devel = %{version}
|
||||
Provides: libcom_err-devel:%{_libdir}/libcom_err.a
|
||||
Provides: libcom_err-devel:%{_libdir}/libss.a
|
||||
# bug437293
|
||||
%ifarch ppc64
|
||||
Obsoletes: libcom_err-devel-64bit
|
||||
%endif
|
||||
#
|
||||
|
||||
%description -n libcom_err-devel-static
|
||||
Development files for the com_err error message display library. Static libraries.
|
||||
%endif
|
||||
|
||||
%prep
|
||||
%setup -q -n e2fsprogs-%{version}
|
||||
# libcom_err patches
|
||||
%patch3 -p1
|
||||
%patch4
|
||||
%patch5
|
||||
cp %{SOURCE2} .
|
||||
%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
|
||||
%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
|
||||
%configure \
|
||||
--with-root-prefix='' \
|
||||
--enable-elf-shlibs \
|
||||
--disable-libblkid \
|
||||
--disable-libuuid \
|
||||
--disable-uuidd \
|
||||
--disable-fsck \
|
||||
--without-crond-dir \
|
||||
--with-systemd-unit-dir=%{?_unitdir} \
|
||||
CFLAGS="$RPM_OPT_FLAGS"
|
||||
%if %{build_mini}
|
||||
rm -rf doc
|
||||
%endif
|
||||
make %{?_smp_mflags} V=1
|
||||
#Guarantee that tranlations match the source messages
|
||||
make -C po update-po
|
||||
|
||||
%install
|
||||
make install install-libs DESTDIR=$RPM_BUILD_ROOT ELF_INSTALL_DIR=/%{_libdir}
|
||||
|
||||
%{find_lang} e2fsprogs
|
||||
|
||||
rm $RPM_BUILD_ROOT%{_libdir}/e2initrd_helper
|
||||
|
||||
%if !0%{?usrmerged}
|
||||
mkdir %{buildroot}/sbin
|
||||
ln -s %{_sbindir}/badblocks %{buildroot}/sbin/badblocks
|
||||
ln -s %{_sbindir}/debugfs %{buildroot}/sbin/debugfs
|
||||
ln -s %{_sbindir}/dumpe2fs %{buildroot}/sbin/dumpe2fs
|
||||
ln -s %{_sbindir}/e2undo %{buildroot}/sbin/e2undo
|
||||
ln -s %{_sbindir}/e2fsck %{buildroot}/sbin/e2fsck
|
||||
ln -s %{_sbindir}/e2label %{buildroot}/sbin/e2label
|
||||
ln -s %{_sbindir}/e2mmpstatus %{buildroot}/sbin/e2mmpstatus
|
||||
ln -s %{_sbindir}/fsck.ext2 %{buildroot}/sbin/fsck.ext2
|
||||
ln -s %{_sbindir}/fsck.ext3 %{buildroot}/sbin/fsck.ext3
|
||||
ln -s %{_sbindir}/fsck.ext4 %{buildroot}/sbin/fsck.ext4
|
||||
ln -s %{_sbindir}/mke2fs %{buildroot}/sbin/mke2fs
|
||||
ln -s %{_sbindir}/mkfs.ext2 %{buildroot}/sbin/mkfs.ext2
|
||||
ln -s %{_sbindir}/mkfs.ext3 %{buildroot}/sbin/mkfs.ext3
|
||||
ln -s %{_sbindir}/mkfs.ext4 %{buildroot}/sbin/mkfs.ext4
|
||||
ln -s %{_sbindir}/resize2fs %{buildroot}/sbin/resize2fs
|
||||
ln -s %{_sbindir}/tune2fs %{buildroot}/sbin/tune2fs
|
||||
ln -s %{_sbindir}/e2image %{buildroot}/sbin/e2image
|
||||
ln -s %{_sbindir}/logsave %{buildroot}/sbin/logsave
|
||||
mkdir %{buildroot}/%{_lib}
|
||||
pushd %{buildroot}/%{_libdir}
|
||||
LIBNAMES=$(ls *.so.*)
|
||||
popd
|
||||
for libName in $LIBNAMES;
|
||||
do ln -s %{_libdir}/$libName %{buildroot}/%{_lib};
|
||||
done
|
||||
%endif
|
||||
|
||||
%if %{with systemd}
|
||||
%if %{build_mini}
|
||||
%pre -n e2fsprogs-scrub-mini
|
||||
%else
|
||||
%pre -n e2fsprogs-scrub
|
||||
%endif
|
||||
%service_add_pre e2scrub@.service e2scrub_all.service e2scrub_all.timer e2scrub_fail@.service e2scrub_reap.service
|
||||
%endif
|
||||
|
||||
%post
|
||||
/sbin/ldconfig
|
||||
%if ! %{build_mini}
|
||||
%if 0%{?suse_version} <= 1530
|
||||
%install_info --info-dir=%{_infodir} %{_infodir}/libext2fs.info.gz
|
||||
%endif
|
||||
%{?regenerate_initrd_post}
|
||||
%endif
|
||||
|
||||
%if %{with systemd}
|
||||
%if %{build_mini}
|
||||
%post -n e2fsprogs-scrub-mini
|
||||
%else
|
||||
%post -n e2fsprogs-scrub
|
||||
%endif
|
||||
%service_add_post e2scrub@.service e2scrub_all.service e2scrub_all.timer e2scrub_fail@.service e2scrub_reap.service
|
||||
%endif
|
||||
|
||||
%if %{with systemd}
|
||||
%if %{build_mini}
|
||||
%preun -n e2fsprogs-scrub-mini
|
||||
%else
|
||||
%preun
|
||||
%if 0%{?suse_version} <= 1530
|
||||
%install_info_delete --info-dir=%{_infodir} %{_infodir}/libext2fs.info.gz
|
||||
%endif
|
||||
%preun -n e2fsprogs-scrub
|
||||
%endif
|
||||
%service_del_preun e2scrub@.service e2scrub_all.service e2scrub_all.timer e2scrub_fail@.service e2scrub_reap.service
|
||||
%endif
|
||||
|
||||
%postun
|
||||
/sbin/ldconfig
|
||||
%if ! %{build_mini}
|
||||
%{?regenerate_initrd_post}
|
||||
%endif
|
||||
|
||||
%if %{with systemd}
|
||||
%if %{build_mini}
|
||||
%postun -n e2fsprogs-scrub-mini
|
||||
%else
|
||||
%postun -n e2fsprogs-scrub
|
||||
%endif
|
||||
%service_del_postun e2scrub@.service e2scrub_all.service e2scrub_all.timer e2scrub_fail@.service e2scrub_reap.service
|
||||
%endif
|
||||
|
||||
%if ! %{build_mini}
|
||||
%posttrans
|
||||
%{?regenerate_initrd_posttrans}
|
||||
%endif
|
||||
|
||||
%if %{build_mini}
|
||||
%post -n libext2fs2-mini -p /sbin/ldconfig
|
||||
%else
|
||||
%post -n libext2fs2 -p /sbin/ldconfig
|
||||
%endif
|
||||
|
||||
%if %{build_mini}
|
||||
%postun -n libext2fs2-mini -p /sbin/ldconfig
|
||||
%else
|
||||
%postun -n libext2fs2 -p /sbin/ldconfig
|
||||
%endif
|
||||
|
||||
%if %{build_mini}
|
||||
%post -n libcom_err2-mini -p /sbin/ldconfig
|
||||
%else
|
||||
%post -n libcom_err2 -p /sbin/ldconfig
|
||||
%endif
|
||||
|
||||
%if %{build_mini}
|
||||
%postun -n libcom_err2-mini -p /sbin/ldconfig
|
||||
%else
|
||||
%postun -n libcom_err2 -p /sbin/ldconfig
|
||||
%endif
|
||||
|
||||
%files -f e2fsprogs.lang
|
||||
%defattr(-, root, root)
|
||||
%doc doc/RelNotes/v%{version}.txt README
|
||||
%if 0%{?sle_version} > 120200
|
||||
%license NOTICE
|
||||
%endif
|
||||
%config /etc/mke2fs.conf
|
||||
%if !0%{?usrmerged}
|
||||
/sbin/badblocks
|
||||
/sbin/debugfs
|
||||
/sbin/dumpe2fs
|
||||
/sbin/e2undo
|
||||
/sbin/e2fsck
|
||||
/sbin/e2label
|
||||
/sbin/e2mmpstatus
|
||||
/sbin/fsck.ext2
|
||||
/sbin/fsck.ext3
|
||||
/sbin/fsck.ext4
|
||||
/sbin/mke2fs
|
||||
/sbin/mkfs.ext2
|
||||
/sbin/mkfs.ext3
|
||||
/sbin/mkfs.ext4
|
||||
/sbin/resize2fs
|
||||
/sbin/tune2fs
|
||||
/sbin/e2image
|
||||
/sbin/logsave
|
||||
%endif
|
||||
%{_sbindir}/badblocks
|
||||
%{_sbindir}/debugfs
|
||||
%{_sbindir}/dumpe2fs
|
||||
%{_sbindir}/e2undo
|
||||
%{_sbindir}/e2fsck
|
||||
%{_sbindir}/e2label
|
||||
%{_sbindir}/e2mmpstatus
|
||||
%{_sbindir}/fsck.ext2
|
||||
%{_sbindir}/fsck.ext3
|
||||
%{_sbindir}/fsck.ext4
|
||||
%{_sbindir}/mke2fs
|
||||
%{_sbindir}/mkfs.ext2
|
||||
%{_sbindir}/mkfs.ext3
|
||||
%{_sbindir}/mkfs.ext4
|
||||
%{_sbindir}/resize2fs
|
||||
%{_sbindir}/tune2fs
|
||||
%{_sbindir}/e2image
|
||||
%{_sbindir}/logsave
|
||||
%{_bindir}/chattr
|
||||
%{_bindir}/lsattr
|
||||
%{_sbindir}/mklost+found
|
||||
%{_sbindir}/filefrag
|
||||
%{_sbindir}/e2freefrag
|
||||
%{_sbindir}/e4defrag
|
||||
%{_sbindir}/e4crypt
|
||||
%if ! %{build_mini}
|
||||
%{_infodir}/libext2fs.info.gz
|
||||
%endif
|
||||
%{_mandir}/man1/chattr.1.gz
|
||||
%{_mandir}/man1/lsattr.1.gz
|
||||
%{_mandir}/man5/ext?.5.gz
|
||||
%{_mandir}/man5/e2fsck.conf.5.gz
|
||||
%{_mandir}/man5/mke2fs.conf.5.gz
|
||||
%{_mandir}/man8/*.8.gz
|
||||
|
||||
%files devel
|
||||
%defattr(-,root,root)
|
||||
%doc README.SUSE
|
||||
|
||||
%if %{build_mini}
|
||||
%files -n e2fsprogs-scrub-mini
|
||||
%else
|
||||
%files -n e2fsprogs-scrub
|
||||
%endif
|
||||
%defattr(-,root,root)
|
||||
%config /etc/e2scrub.conf
|
||||
%{_sbindir}/e2scrub
|
||||
%{_sbindir}/e2scrub_all
|
||||
%if %{with systemd}
|
||||
%{_libdir}/e2fsprogs/
|
||||
%{_libdir}/e2fsprogs/e2scrub_fail
|
||||
%{_unitdir}/e2scrub@.service
|
||||
%{_unitdir}/e2scrub_all.service
|
||||
%{_unitdir}/e2scrub_all.timer
|
||||
%{_unitdir}/e2scrub_fail@.service
|
||||
%{_unitdir}/e2scrub_reap.service
|
||||
%endif
|
||||
|
||||
%if %{build_mini}
|
||||
%files -n libext2fs2-mini
|
||||
%else
|
||||
%files -n libext2fs2
|
||||
%endif
|
||||
%defattr(-, root, root)
|
||||
%if !0%{?usrmerged}
|
||||
/%{_lib}/libext2fs.so.*
|
||||
/%{_lib}/libe2p.so.*
|
||||
%endif
|
||||
%{_libdir}/libext2fs.so.*
|
||||
%{_libdir}/libe2p.so.*
|
||||
|
||||
%if %{build_mini}
|
||||
%files -n libext2fs-mini-devel
|
||||
%else
|
||||
%files -n libext2fs-devel
|
||||
%endif
|
||||
%defattr(-, root, root)
|
||||
%{_libdir}/libext2fs.so
|
||||
%{_libdir}/libe2p.so
|
||||
/usr/include/ext2fs
|
||||
/usr/include/e2p
|
||||
%_libdir/pkgconfig/e2p.pc
|
||||
%_libdir/pkgconfig/ext2fs.pc
|
||||
|
||||
%if %{build_mini}
|
||||
%files -n libcom_err2-mini
|
||||
%else
|
||||
%files -n libcom_err2
|
||||
%endif
|
||||
%defattr(-, root, root)
|
||||
%if !0%{?usrmerged}
|
||||
/%{_lib}/libcom_err.so.*
|
||||
/%{_lib}/libss.so.*
|
||||
%endif
|
||||
%{_libdir}/libcom_err.so.*
|
||||
%{_libdir}/libss.so.*
|
||||
|
||||
%if %{build_mini}
|
||||
%files -n libcom_err-mini-devel
|
||||
%else
|
||||
%files -n libcom_err-devel
|
||||
%endif
|
||||
%defattr(-, root, root)
|
||||
%_bindir/compile_et
|
||||
%_bindir/mk_cmds
|
||||
%{_libdir}/libcom_err.so
|
||||
%{_libdir}/libss.so
|
||||
%_libdir/pkgconfig/com_err.pc
|
||||
%_libdir/pkgconfig/ss.pc
|
||||
%_includedir/com_err.h
|
||||
%_includedir/et
|
||||
%_includedir/ss
|
||||
%_datadir/et
|
||||
%_datadir/ss
|
||||
%{_mandir}/man1/compile_et.1.gz
|
||||
%{_mandir}/man1/mk_cmds.1.gz
|
||||
%{_mandir}/man3/com_err.3.gz
|
||||
|
||||
%if ! %{build_mini}
|
||||
%files -n libcom_err-devel-static
|
||||
%defattr(-, root, root)
|
||||
%{_libdir}/libcom_err.a
|
||||
%{_libdir}/libss.a
|
||||
|
||||
%files -n libext2fs-devel-static
|
||||
%defattr(-, root, root)
|
||||
%{_libdir}/libext2fs.a
|
||||
%{_libdir}/libe2p.a
|
||||
%endif
|
||||
|
||||
%changelog
|
20
harden_e2scrub@.service.patch
Normal file
20
harden_e2scrub@.service.patch
Normal file
|
@ -0,0 +1,20 @@
|
|||
Index: e2fsprogs-1.46.4/scrub/e2scrub@.service.in
|
||||
===================================================================
|
||||
--- e2fsprogs-1.46.4.orig/scrub/e2scrub@.service.in
|
||||
+++ e2fsprogs-1.46.4/scrub/e2scrub@.service.in
|
||||
@@ -10,6 +10,15 @@ PrivateNetwork=true
|
||||
ProtectSystem=true
|
||||
ProtectHome=read-only
|
||||
PrivateTmp=yes
|
||||
+# added automatically, for details please see
|
||||
+# https://en.opensuse.org/openSUSE:Security_Features#Systemd_hardening_effort
|
||||
+ProtectHostname=true
|
||||
+ProtectClock=true
|
||||
+ProtectKernelTunables=true
|
||||
+ProtectKernelLogs=true
|
||||
+ProtectControlGroups=true
|
||||
+RestrictRealtime=true
|
||||
+# end of automatic additions
|
||||
AmbientCapabilities=CAP_SYS_ADMIN CAP_SYS_RAWIO
|
||||
NoNewPrivileges=yes
|
||||
User=root
|
23
harden_e2scrub_all.service.patch
Normal file
23
harden_e2scrub_all.service.patch
Normal file
|
@ -0,0 +1,23 @@
|
|||
Index: e2fsprogs-1.46.3/scrub/e2scrub_all.service.in
|
||||
===================================================================
|
||||
--- e2fsprogs-1.46.3.orig/scrub/e2scrub_all.service.in
|
||||
+++ e2fsprogs-1.46.3/scrub/e2scrub_all.service.in
|
||||
@@ -6,6 +6,18 @@ ConditionCapability=CAP_SYS_RAWIO
|
||||
Documentation=man:e2scrub_all(8)
|
||||
|
||||
[Service]
|
||||
+# added automatically, for details please see
|
||||
+# https://en.opensuse.org/openSUSE:Security_Features#Systemd_hardening_effort
|
||||
+ProtectSystem=full
|
||||
+ProtectHome=true
|
||||
+ProtectHostname=true
|
||||
+ProtectClock=true
|
||||
+ProtectKernelTunables=true
|
||||
+ProtectKernelModules=true
|
||||
+ProtectKernelLogs=true
|
||||
+ProtectControlGroups=true
|
||||
+RestrictRealtime=true
|
||||
+# end of automatic additions
|
||||
Type=oneshot
|
||||
Environment=SERVICE_MODE=1
|
||||
ExecStart=@root_sbindir@/e2scrub_all
|
23
harden_e2scrub_fail@.service.patch
Normal file
23
harden_e2scrub_fail@.service.patch
Normal file
|
@ -0,0 +1,23 @@
|
|||
Index: e2fsprogs-1.46.3/scrub/e2scrub_fail@.service.in
|
||||
===================================================================
|
||||
--- e2fsprogs-1.46.3.orig/scrub/e2scrub_fail@.service.in
|
||||
+++ e2fsprogs-1.46.3/scrub/e2scrub_fail@.service.in
|
||||
@@ -3,6 +3,18 @@ Description=Online ext4 Metadata Check F
|
||||
Documentation=man:e2scrub(8)
|
||||
|
||||
[Service]
|
||||
+# added automatically, for details please see
|
||||
+# https://en.opensuse.org/openSUSE:Security_Features#Systemd_hardening_effort
|
||||
+ProtectSystem=full
|
||||
+ProtectHome=true
|
||||
+ProtectHostname=true
|
||||
+ProtectClock=true
|
||||
+ProtectKernelTunables=true
|
||||
+ProtectKernelModules=true
|
||||
+ProtectKernelLogs=true
|
||||
+ProtectControlGroups=true
|
||||
+RestrictRealtime=true
|
||||
+# end of automatic additions
|
||||
Type=oneshot
|
||||
ExecStart=@pkglibdir@/e2scrub_fail "%I"
|
||||
User=mail
|
21
harden_e2scrub_reap.service.patch
Normal file
21
harden_e2scrub_reap.service.patch
Normal file
|
@ -0,0 +1,21 @@
|
|||
Index: e2fsprogs-1.46.3/scrub/e2scrub_reap.service.in
|
||||
===================================================================
|
||||
--- e2fsprogs-1.46.3.orig/scrub/e2scrub_reap.service.in
|
||||
+++ e2fsprogs-1.46.3/scrub/e2scrub_reap.service.in
|
||||
@@ -11,6 +11,16 @@ PrivateNetwork=true
|
||||
ProtectSystem=true
|
||||
ProtectHome=read-only
|
||||
PrivateTmp=yes
|
||||
+# added automatically, for details please see
|
||||
+# https://en.opensuse.org/openSUSE:Security_Features#Systemd_hardening_effort
|
||||
+ProtectHostname=true
|
||||
+ProtectClock=true
|
||||
+ProtectKernelTunables=true
|
||||
+ProtectKernelModules=true
|
||||
+ProtectKernelLogs=true
|
||||
+ProtectControlGroups=true
|
||||
+RestrictRealtime=true
|
||||
+# end of automatic additions
|
||||
AmbientCapabilities=CAP_SYS_ADMIN CAP_SYS_RAWIO
|
||||
NoNewPrivileges=yes
|
||||
User=root
|
13
libcom_err-compile_et_permissions.patch
Normal file
13
libcom_err-compile_et_permissions.patch
Normal file
|
@ -0,0 +1,13 @@
|
|||
Index: e2fsprogs-1.42.13/lib/et/compile_et.sh.in
|
||||
===================================================================
|
||||
--- e2fsprogs-1.42.13.orig/lib/et/compile_et.sh.in
|
||||
+++ e2fsprogs-1.42.13/lib/et/compile_et.sh.in
|
||||
@@ -51,7 +51,7 @@ if test -f ${BASE}.h && cmp -s ${BASE}.h
|
||||
rm -f ${BASE}.h.$$
|
||||
else
|
||||
mv -f ${BASE}.h.$$ ${BASE}.h
|
||||
- chmod a-w ${BASE}.h
|
||||
+# chmod a-w ${BASE}.h
|
||||
fi
|
||||
$AWK -f "${DIR}/et_c.awk" "outfile=${BASE}.c.$$" "outfn=${BASE}.c" "$ROOT.et"
|
||||
if test -f ${BASE}.c && cmp -s ${BASE}.c.$$ ${BASE}.c ; then
|
56
libext2fs-add-sanity-check-to-extent-manipulation.patch
Normal file
56
libext2fs-add-sanity-check-to-extent-manipulation.patch
Normal file
|
@ -0,0 +1,56 @@
|
|||
From ab51d587bb9b229b1fade1afd02e1574c1ba5c76 Mon Sep 17 00:00:00 2001
|
||||
From: Lukas Czerner <lczerner@redhat.com>
|
||||
Date: Thu, 21 Apr 2022 19:31:48 +0200
|
||||
Subject: [PATCH] libext2fs: add sanity check to extent manipulation
|
||||
References: bsc#1198446 CVE-2022-1304
|
||||
|
||||
It is possible to have a corrupted extent tree in such a way that a leaf
|
||||
node contains zero extents in it. Currently if that happens and we try
|
||||
to traverse the tree we can end up accessing wrong data, or possibly
|
||||
even uninitialized memory. Make sure we don't do that.
|
||||
|
||||
Additionally make sure that we have a sane number of bytes passed to
|
||||
memmove() in ext2fs_extent_delete().
|
||||
|
||||
Note that e2fsck is currently unable to spot and fix such corruption in
|
||||
pass1.
|
||||
|
||||
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
|
||||
Reported-by: Nils Bars <nils_bars@t-online.de>
|
||||
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2068113
|
||||
Addresses: CVE-2022-1304
|
||||
Addresses-Debian-Bug: #1010263
|
||||
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
|
||||
---
|
||||
lib/ext2fs/extent.c | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/lib/ext2fs/extent.c b/lib/ext2fs/extent.c
|
||||
index b324c7b0f8c8..1a206a16c13f 100644
|
||||
--- a/lib/ext2fs/extent.c
|
||||
+++ b/lib/ext2fs/extent.c
|
||||
@@ -495,6 +495,10 @@ retry:
|
||||
ext2fs_le16_to_cpu(eh->eh_entries);
|
||||
newpath->max_entries = ext2fs_le16_to_cpu(eh->eh_max);
|
||||
|
||||
+ /* Make sure there is at least one extent present */
|
||||
+ if (newpath->left <= 0)
|
||||
+ return EXT2_ET_EXTENT_NO_DOWN;
|
||||
+
|
||||
if (path->left > 0) {
|
||||
ix++;
|
||||
newpath->end_blk = ext2fs_le32_to_cpu(ix->ei_block);
|
||||
@@ -1630,6 +1634,10 @@ errcode_t ext2fs_extent_delete(ext2_extent_handle_t handle, int flags)
|
||||
|
||||
cp = path->curr;
|
||||
|
||||
+ /* Sanity check before memmove() */
|
||||
+ if (path->left < 0)
|
||||
+ return EXT2_ET_EXTENT_LEAF_BAD;
|
||||
+
|
||||
if (path->left) {
|
||||
memmove(cp, cp + sizeof(struct ext3_extent_idx),
|
||||
path->left * sizeof(struct ext3_extent_idx));
|
||||
--
|
||||
2.34.1
|
||||
|
29
libss-add-newer-libreadline.so.8-to-dlopen-path.patch
Normal file
29
libss-add-newer-libreadline.so.8-to-dlopen-path.patch
Normal file
|
@ -0,0 +1,29 @@
|
|||
From 0a60ee129b9137a9a5cd49c4dd15247830a7f319 Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kara <jack@suse.cz>
|
||||
Date: Fri, 20 Aug 2021 18:12:04 +0200
|
||||
Subject: [PATCH] libss: add newer libreadline.so.8 to dlopen path
|
||||
|
||||
OpenSUSE Tumbleweed now has libreadline.so.8. Add it to the list of libs
|
||||
to look for.
|
||||
|
||||
Signed-off-by: Jan Kara <jack@suse.cz>
|
||||
---
|
||||
lib/ss/get_readline.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/ss/get_readline.c b/lib/ss/get_readline.c
|
||||
index 11c72b3387d1..aa1615747934 100644
|
||||
--- a/lib/ss/get_readline.c
|
||||
+++ b/lib/ss/get_readline.c
|
||||
@@ -37,7 +37,7 @@ static void ss_release_readline(ss_data *info)
|
||||
#endif
|
||||
|
||||
/* Libraries we will try to use for readline/editline functionality */
|
||||
-#define DEFAULT_LIBPATH "libreadline.so.7:libreadline.so.6:libreadline.so.5:libreadline.so.4:libreadline.so:libedit.so.2:libedit.so:libeditline.so.0:libeditline.so"
|
||||
+#define DEFAULT_LIBPATH "libreadline.so.8:libreadline.so.7:libreadline.so.6:libreadline.so.5:libreadline.so.4:libreadline.so:libedit.so.2:libedit.so:libeditline.so.0:libeditline.so"
|
||||
|
||||
#ifdef HAVE_DLOPEN
|
||||
void ss_get_readline(int sci_idx)
|
||||
--
|
||||
2.26.2
|
||||
|
188
quota-Add-support-to-version-0-quota-format.patch
Normal file
188
quota-Add-support-to-version-0-quota-format.patch
Normal file
|
@ -0,0 +1,188 @@
|
|||
From cb060896aac2207ea77479db2e2212ebe7955de9 Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kara <jack@suse.cz>
|
||||
Date: Fri, 20 Aug 2021 21:18:32 +0200
|
||||
Subject: [PATCH 1/8] quota: Add support to version 0 quota format
|
||||
X-Developer-Signature: v=1; a=openpgp-sha256; l=6268; h=from:subject;
|
||||
bh=UhE03jWwtF7/2Unh5tfHgBCzzdLaSNZ7G9C22vuq4H4=;
|
||||
b=owEBbQGS/pANAwAIAZydqgc/ZEDZAcsmYgBhI8GhrizE8ehds+qrTxuX1OCIKL+zMflZgbZ3qOb5
|
||||
4X5jnt+JATMEAAEIAB0WIQSrWdEr1p4yirVVKBycnaoHP2RA2QUCYSPBoQAKCRCcnaoHP2RA2dHMCA
|
||||
CzR/VySs+XXZrCsUYOO3oUzFueRoSJnOAuAUONScP8h7x8fH7wclET0eU/ZGDTMFPrhSIAWjqqwfI8
|
||||
zeFGmbi4GR5BRbsxWNCJnmjwtbxHfOiXsH8KLqT8DyLFl/Svw4yHi9URyIKk4rij2q9AqmA1DTc5M6
|
||||
iMHejidF5w4SbKSmvVYpJi1Ny/TyWXUU9ATzZv01cwjBnMsTw+xq3MD55K9VVZJ9tIF3YZd0PahiT0
|
||||
h/zKA7uQX6W3PKWVuTHkSzjUnsOhKMCX9MxMX6uGXzHBiUsqdCSijVQ6qwBmbwbbz5OZRBRdTfm+0X
|
||||
6fJidGzi6Zcpp/jOs8RIOSu55qCTAb
|
||||
X-Developer-Key: i=jack@suse.cz; a=openpgp;
|
||||
fpr=93C6099A142276A28BBE35D815BC833443038D8C
|
||||
|
||||
Version 0 quota format differs from version 1 by having only 32-bit
|
||||
counters for inodes and block limits. For many installations this is not
|
||||
limiting and thus the format is widely used. Also quota tools still
|
||||
create quota files with this format by default. Add support for this
|
||||
quota format to e2fsprogs so that we can seamlessly convert quota files
|
||||
in this format into our internal quota files.
|
||||
|
||||
Signed-off-by: Jan Kara <jack@suse.cz>
|
||||
---
|
||||
lib/support/quotaio_v2.c | 85 +++++++++++++++++++++++++++++++++++++---
|
||||
lib/support/quotaio_v2.h | 17 +++++++-
|
||||
2 files changed, 96 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/lib/support/quotaio_v2.c b/lib/support/quotaio_v2.c
|
||||
index 23717f03f428..a49aa6ac8c2f 100644
|
||||
--- a/lib/support/quotaio_v2.c
|
||||
+++ b/lib/support/quotaio_v2.c
|
||||
@@ -41,6 +41,68 @@ struct quotafile_ops quotafile_ops_2 = {
|
||||
.report = v2_report,
|
||||
};
|
||||
|
||||
+/*
|
||||
+ * Copy dquot from disk to memory
|
||||
+ */
|
||||
+static void v2r0_disk2memdqblk(struct dquot *dquot, void *dp)
|
||||
+{
|
||||
+ struct util_dqblk *m = &dquot->dq_dqb;
|
||||
+ struct v2r0_disk_dqblk *d = dp, empty;
|
||||
+
|
||||
+ dquot->dq_id = ext2fs_le32_to_cpu(d->dqb_id);
|
||||
+ m->dqb_ihardlimit = ext2fs_le32_to_cpu(d->dqb_ihardlimit);
|
||||
+ m->dqb_isoftlimit = ext2fs_le32_to_cpu(d->dqb_isoftlimit);
|
||||
+ m->dqb_bhardlimit = ext2fs_le32_to_cpu(d->dqb_bhardlimit);
|
||||
+ m->dqb_bsoftlimit = ext2fs_le32_to_cpu(d->dqb_bsoftlimit);
|
||||
+ m->dqb_curinodes = ext2fs_le32_to_cpu(d->dqb_curinodes);
|
||||
+ m->dqb_curspace = ext2fs_le64_to_cpu(d->dqb_curspace);
|
||||
+ m->dqb_itime = ext2fs_le64_to_cpu(d->dqb_itime);
|
||||
+ m->dqb_btime = ext2fs_le64_to_cpu(d->dqb_btime);
|
||||
+
|
||||
+ memset(&empty, 0, sizeof(struct v2r0_disk_dqblk));
|
||||
+ empty.dqb_itime = ext2fs_cpu_to_le64(1);
|
||||
+ if (!memcmp(&empty, dp, sizeof(struct v2r0_disk_dqblk)))
|
||||
+ m->dqb_itime = 0;
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * Copy dquot from memory to disk
|
||||
+ */
|
||||
+static void v2r0_mem2diskdqblk(void *dp, struct dquot *dquot)
|
||||
+{
|
||||
+ struct util_dqblk *m = &dquot->dq_dqb;
|
||||
+ struct v2r0_disk_dqblk *d = dp;
|
||||
+
|
||||
+ d->dqb_ihardlimit = ext2fs_cpu_to_le32(m->dqb_ihardlimit);
|
||||
+ d->dqb_isoftlimit = ext2fs_cpu_to_le32(m->dqb_isoftlimit);
|
||||
+ d->dqb_bhardlimit = ext2fs_cpu_to_le32(m->dqb_bhardlimit);
|
||||
+ d->dqb_bsoftlimit = ext2fs_cpu_to_le32(m->dqb_bsoftlimit);
|
||||
+ d->dqb_curinodes = ext2fs_cpu_to_le32(m->dqb_curinodes);
|
||||
+ d->dqb_curspace = ext2fs_cpu_to_le64(m->dqb_curspace);
|
||||
+ d->dqb_itime = ext2fs_cpu_to_le64(m->dqb_itime);
|
||||
+ d->dqb_btime = ext2fs_cpu_to_le64(m->dqb_btime);
|
||||
+ d->dqb_id = ext2fs_cpu_to_le32(dquot->dq_id);
|
||||
+ if (qtree_entry_unused(&dquot->dq_h->qh_info.u.v2_mdqi.dqi_qtree, dp))
|
||||
+ d->dqb_itime = ext2fs_cpu_to_le64(1);
|
||||
+}
|
||||
+
|
||||
+static int v2r0_is_id(void *dp, struct dquot *dquot)
|
||||
+{
|
||||
+ struct v2r0_disk_dqblk *d = dp;
|
||||
+ struct qtree_mem_dqinfo *info =
|
||||
+ &dquot->dq_h->qh_info.u.v2_mdqi.dqi_qtree;
|
||||
+
|
||||
+ if (qtree_entry_unused(info, dp))
|
||||
+ return 0;
|
||||
+ return ext2fs_le32_to_cpu(d->dqb_id) == dquot->dq_id;
|
||||
+}
|
||||
+
|
||||
+static struct qtree_fmt_operations v2r0_fmt_ops = {
|
||||
+ .mem2disk_dqblk = v2r0_mem2diskdqblk,
|
||||
+ .disk2mem_dqblk = v2r0_disk2memdqblk,
|
||||
+ .is_id = v2r0_is_id,
|
||||
+};
|
||||
+
|
||||
/*
|
||||
* Copy dquot from disk to memory
|
||||
*/
|
||||
@@ -164,7 +226,8 @@ static int v2_check_file(struct quota_handle *h, int type, int fmt)
|
||||
log_err("Your quota file is stored in wrong endianity");
|
||||
return 0;
|
||||
}
|
||||
- if (V2_VERSION != ext2fs_le32_to_cpu(dqh.dqh_version))
|
||||
+ if (V2_VERSION_R0 != ext2fs_le32_to_cpu(dqh.dqh_version) &&
|
||||
+ V2_VERSION_R1 != ext2fs_le32_to_cpu(dqh.dqh_version))
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
@@ -174,13 +237,25 @@ static int v2_check_file(struct quota_handle *h, int type, int fmt)
|
||||
*/
|
||||
static int v2_init_io(struct quota_handle *h)
|
||||
{
|
||||
+ struct v2_disk_dqheader dqh;
|
||||
struct v2_disk_dqinfo ddqinfo;
|
||||
struct v2_mem_dqinfo *info;
|
||||
__u64 filesize;
|
||||
+ int version;
|
||||
|
||||
- h->qh_info.u.v2_mdqi.dqi_qtree.dqi_entry_size =
|
||||
- sizeof(struct v2r1_disk_dqblk);
|
||||
- h->qh_info.u.v2_mdqi.dqi_qtree.dqi_ops = &v2r1_fmt_ops;
|
||||
+ if (!v2_read_header(h, &dqh))
|
||||
+ return -1;
|
||||
+ version = ext2fs_le32_to_cpu(dqh.dqh_version);
|
||||
+
|
||||
+ if (version == V2_VERSION_R0) {
|
||||
+ h->qh_info.u.v2_mdqi.dqi_qtree.dqi_entry_size =
|
||||
+ sizeof(struct v2r0_disk_dqblk);
|
||||
+ h->qh_info.u.v2_mdqi.dqi_qtree.dqi_ops = &v2r0_fmt_ops;
|
||||
+ } else {
|
||||
+ h->qh_info.u.v2_mdqi.dqi_qtree.dqi_entry_size =
|
||||
+ sizeof(struct v2r1_disk_dqblk);
|
||||
+ h->qh_info.u.v2_mdqi.dqi_qtree.dqi_ops = &v2r1_fmt_ops;
|
||||
+ }
|
||||
|
||||
/* Read information about quotafile */
|
||||
if (h->e2fs_read(&h->qh_qf, V2_DQINFOOFF, &ddqinfo,
|
||||
@@ -231,7 +306,7 @@ static int v2_new_io(struct quota_handle *h)
|
||||
|
||||
/* Write basic quota header */
|
||||
ddqheader.dqh_magic = ext2fs_cpu_to_le32(file_magics[h->qh_type]);
|
||||
- ddqheader.dqh_version = ext2fs_cpu_to_le32(V2_VERSION);
|
||||
+ ddqheader.dqh_version = ext2fs_cpu_to_le32(V2_VERSION_R1);
|
||||
if (h->e2fs_write(&h->qh_qf, 0, &ddqheader, sizeof(ddqheader)) !=
|
||||
sizeof(ddqheader))
|
||||
return -1;
|
||||
diff --git a/lib/support/quotaio_v2.h b/lib/support/quotaio_v2.h
|
||||
index de2db2785cb0..35054cafaa23 100644
|
||||
--- a/lib/support/quotaio_v2.h
|
||||
+++ b/lib/support/quotaio_v2.h
|
||||
@@ -13,7 +13,8 @@
|
||||
/* Offset of info header in file */
|
||||
#define V2_DQINFOOFF sizeof(struct v2_disk_dqheader)
|
||||
/* Supported version of quota-tree format */
|
||||
-#define V2_VERSION 1
|
||||
+#define V2_VERSION_R1 1
|
||||
+#define V2_VERSION_R0 0
|
||||
|
||||
struct v2_disk_dqheader {
|
||||
__le32 dqh_magic; /* Magic number identifying file */
|
||||
@@ -36,6 +37,20 @@ struct v2_disk_dqinfo {
|
||||
* free entry */
|
||||
} __attribute__ ((packed));
|
||||
|
||||
+struct v2r0_disk_dqblk {
|
||||
+ __le32 dqb_id; /* id this quota applies to */
|
||||
+ __le32 dqb_ihardlimit; /* absolute limit on allocated inodes */
|
||||
+ __le32 dqb_isoftlimit; /* preferred inode limit */
|
||||
+ __le32 dqb_curinodes; /* current # allocated inodes */
|
||||
+ __le32 dqb_bhardlimit; /* absolute limit on disk space
|
||||
+ * (in QUOTABLOCK_SIZE) */
|
||||
+ __le32 dqb_bsoftlimit; /* preferred limit on disk space
|
||||
+ * (in QUOTABLOCK_SIZE) */
|
||||
+ __le64 dqb_curspace; /* current space occupied (in bytes) */
|
||||
+ __le64 dqb_btime; /* time limit for excessive disk use */
|
||||
+ __le64 dqb_itime; /* time limit for excessive inode use */
|
||||
+} __attribute__ ((packed));
|
||||
+
|
||||
struct v2r1_disk_dqblk {
|
||||
__le32 dqb_id; /* id this quota applies to */
|
||||
__le32 dqb_pad;
|
||||
--
|
||||
2.26.2
|
||||
|
57
quota-Drop-dead-code.patch
Normal file
57
quota-Drop-dead-code.patch
Normal file
|
@ -0,0 +1,57 @@
|
|||
From 32d9f7b1e48f203315890b4d7374f4afd68ce7bb Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kara <jack@suse.cz>
|
||||
Date: Mon, 23 Aug 2021 17:09:41 +0200
|
||||
Subject: [PATCH 8/8] quota: Drop dead code
|
||||
X-Developer-Signature: v=1; a=openpgp-sha256; l=1119; h=from:subject;
|
||||
bh=61dKtjVKi3diCfHpa1/d4uDj1elmJCEY1fKv83UzzKA=;
|
||||
b=owEBbQGS/pANAwAIAZydqgc/ZEDZAcsmYgBhI8GnVlsRAgEc7AzGwJddaA7LDt33ZX+Yj9rady7y
|
||||
42St04GJATMEAAEIAB0WIQSrWdEr1p4yirVVKBycnaoHP2RA2QUCYSPBpwAKCRCcnaoHP2RA2aBMCA
|
||||
COK2Z3O7gobEnW9GHL1bd1MlJOqsYxPxnOp3rFCkB4Kb6V770XUoCCnyeD7NwNxooWZSNOB7JCuyGQ
|
||||
Yl945dec75Yv8zw49bulfVe496hHFX4O4UzAgZKG0vZYAjHpwaEk9Txf3MLpSHxSFlvbH8LE4sT7yD
|
||||
M4wEEznUZokwwRoj+ds12+Rm+P1Sj/AhghUTaPFpuA5RjplBAg728b9f6Ia2JMsNzxoBRksVdOONjU
|
||||
2gtjwbR7Ne2GlN722u71YHItAL0sBAVPIHZQznZEKAZFwEnOHSRWlvwLItLdMfpoMcYXjDJIWz+mXx
|
||||
QbpFU9jSQfiJBn+wba2yVZKohLP403
|
||||
X-Developer-Key: i=jack@suse.cz; a=openpgp;
|
||||
fpr=93C6099A142276A28BBE35D815BC833443038D8C
|
||||
|
||||
Drop unused function from quota support code.
|
||||
|
||||
Signed-off-by: Jan Kara <jack@suse.cz>
|
||||
---
|
||||
lib/support/mkquota.c | 20 --------------------
|
||||
1 file changed, 20 deletions(-)
|
||||
|
||||
diff --git a/lib/support/mkquota.c b/lib/support/mkquota.c
|
||||
index 0fefca90c843..a4401b7f77af 100644
|
||||
--- a/lib/support/mkquota.c
|
||||
+++ b/lib/support/mkquota.c
|
||||
@@ -564,26 +564,6 @@ static int scan_dquots_callback(struct dquot *dquot, void *cb_data)
|
||||
return 0;
|
||||
}
|
||||
|
||||
-/*
|
||||
- * Write all memory dquots into quota file
|
||||
- */
|
||||
-#if 0 /* currently unused, but may be useful in the future? */
|
||||
-static errcode_t quota_write_all_dquots(struct quota_handle *qh,
|
||||
- quota_ctx_t qctx)
|
||||
-{
|
||||
- errcode_t err;
|
||||
-
|
||||
- err = ext2fs_read_bitmaps(qctx->fs);
|
||||
- if (err)
|
||||
- return err;
|
||||
- write_dquots(qctx->quota_dict[qh->qh_type], qh);
|
||||
- ext2fs_mark_bb_dirty(qctx->fs);
|
||||
- qctx->fs->flags &= ~EXT2_FLAG_SUPER_ONLY;
|
||||
- ext2fs_write_bitmaps(qctx->fs);
|
||||
- return 0;
|
||||
-}
|
||||
-#endif
|
||||
-
|
||||
/*
|
||||
* Read quotas from disk and updates the in-memory information determined by
|
||||
* 'flags' from the on-disk data.
|
||||
--
|
||||
2.26.2
|
||||
|
77
quota-Fold-quota_read_all_dquots-into-quota_update_l.patch
Normal file
77
quota-Fold-quota_read_all_dquots-into-quota_update_l.patch
Normal file
|
@ -0,0 +1,77 @@
|
|||
From cbc02e7ef11d5129d090ff49aa1aa57c6ac67fd5 Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kara <jack@suse.cz>
|
||||
Date: Mon, 23 Aug 2021 16:20:52 +0200
|
||||
Subject: [PATCH 2/8] quota: Fold quota_read_all_dquots() into
|
||||
quota_update_limits()
|
||||
X-Developer-Signature: v=1; a=openpgp-sha256; l=1845; h=from:subject;
|
||||
bh=P7jQb3ZXNuPWs0M0khNUm88nO2ChkOKzT3PGfFt2YNE=;
|
||||
b=owEBbQGS/pANAwAIAZydqgc/ZEDZAcsmYgBhI8GihdgOLrTUGvgyKLo/9lHgsSXNpuX+TjVHdW+m
|
||||
661Y0fGJATMEAAEIAB0WIQSrWdEr1p4yirVVKBycnaoHP2RA2QUCYSPBogAKCRCcnaoHP2RA2aEPB/
|
||||
9zdPkcMlJKxGzpEO0BmaBNu0c3VbFZR72otTj64Pm1AWxyU9PL288d+VnPov7WSeduPBKtXxmevxAw
|
||||
tR0TYFt4ui8Gr7HLMoTvP7EJ3YX/KZ2mnXnz9JJ5DB2fG07VBbKmcfPKzsxYTUd0Xe5RJU0PYPI62W
|
||||
j8W17jQelcHCNhAJk6oJFP7hPE+dsGUzGthbeQhWrb5zmboB/Ui55mfM1mLaloebpJkg1eqEZzX1jE
|
||||
6T9iEfBSgv5WowKIfJInnXkI+l4UED+Ri1pjuFgBtpWjJEP8ixpFhlo0ULZxfK/OX9sFWQU+Z+opoM
|
||||
Qi0W7Fbb7hR7YZP84xnIbF1FUgHa+l
|
||||
X-Developer-Key: i=jack@suse.cz; a=openpgp;
|
||||
fpr=93C6099A142276A28BBE35D815BC833443038D8C
|
||||
|
||||
There's just one caller of quota_read_all_dquots(), fold it into its
|
||||
caller quota_update_limits(). No functional changes.
|
||||
|
||||
Signed-off-by: Jan Kara <jack@suse.cz>
|
||||
---
|
||||
lib/support/mkquota.c | 24 ++++++------------------
|
||||
1 file changed, 6 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/lib/support/mkquota.c b/lib/support/mkquota.c
|
||||
index fbc3833aee98..8e5c61a601cc 100644
|
||||
--- a/lib/support/mkquota.c
|
||||
+++ b/lib/support/mkquota.c
|
||||
@@ -564,23 +564,6 @@ static int scan_dquots_callback(struct dquot *dquot, void *cb_data)
|
||||
return 0;
|
||||
}
|
||||
|
||||
-/*
|
||||
- * Read all dquots from quota file into memory
|
||||
- */
|
||||
-static errcode_t quota_read_all_dquots(struct quota_handle *qh,
|
||||
- quota_ctx_t qctx,
|
||||
- int update_limits EXT2FS_ATTR((unused)))
|
||||
-{
|
||||
- struct scan_dquots_data scan_data;
|
||||
-
|
||||
- scan_data.quota_dict = qctx->quota_dict[qh->qh_type];
|
||||
- scan_data.check_consistency = 0;
|
||||
- scan_data.update_limits = 0;
|
||||
- scan_data.update_usage = 1;
|
||||
-
|
||||
- return qh->qh_ops->scan_dquots(qh, scan_dquots_callback, &scan_data);
|
||||
-}
|
||||
-
|
||||
/*
|
||||
* Write all memory dquots into quota file
|
||||
*/
|
||||
@@ -607,6 +590,7 @@ static errcode_t quota_write_all_dquots(struct quota_handle *qh,
|
||||
errcode_t quota_update_limits(quota_ctx_t qctx, ext2_ino_t qf_ino,
|
||||
enum quota_type qtype)
|
||||
{
|
||||
+ struct scan_dquots_data scan_data;
|
||||
struct quota_handle *qh;
|
||||
errcode_t err;
|
||||
|
||||
@@ -625,7 +609,11 @@ errcode_t quota_update_limits(quota_ctx_t qctx, ext2_ino_t qf_ino,
|
||||
goto out;
|
||||
}
|
||||
|
||||
- quota_read_all_dquots(qh, qctx, 1);
|
||||
+ scan_data.quota_dict = qctx->quota_dict[qh->qh_type];
|
||||
+ scan_data.check_consistency = 0;
|
||||
+ scan_data.update_limits = 0;
|
||||
+ scan_data.update_usage = 1;
|
||||
+ qh->qh_ops->scan_dquots(qh, scan_dquots_callback, &scan_data);
|
||||
|
||||
err = quota_file_close(qctx, qh);
|
||||
if (err) {
|
||||
--
|
||||
2.26.2
|
||||
|
112
quota-Rename-quota_update_limits-to-quota_read_all_d.patch
Normal file
112
quota-Rename-quota_update_limits-to-quota_read_all_d.patch
Normal file
|
@ -0,0 +1,112 @@
|
|||
From f2a7403c6e232aa8dba92d56178d81ba8285fa65 Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kara <jack@suse.cz>
|
||||
Date: Mon, 23 Aug 2021 16:32:13 +0200
|
||||
Subject: [PATCH 3/8] quota: Rename quota_update_limits() to
|
||||
quota_read_all_dquots()
|
||||
X-Developer-Signature: v=1; a=openpgp-sha256; l=3796; h=from:subject;
|
||||
bh=EWzfurjfbAs2HTtmIoM8glu+EY0nvkRwYkafyLH0vAw=;
|
||||
b=owEBbQGS/pANAwAIAZydqgc/ZEDZAcsmYgBhI8GjQ7OLyPGH5e21pa5vzRbAJrBUX2fqN9Cishyr
|
||||
zRhheaOJATMEAAEIAB0WIQSrWdEr1p4yirVVKBycnaoHP2RA2QUCYSPBowAKCRCcnaoHP2RA2fqAB/
|
||||
99OFSOi1posHQs9IivQagLwUAxytNoe9VWRoUqypcx5DFtbSItNlcyRCRxmouxUdpTyWR3BoYfDz97
|
||||
/R2KsPNu9XU6oA2NiC7WcmNdSJ0ay+sRuXy2EF5FxCvXjB4xN7pUu7QEEjcQXOYOwIsdEDQru+eajq
|
||||
NK05uq6j0Zb/zelJ9VkTA0iKkiCkKGNYZlCUkn3x+E8wTb4RCbywnAynC6RXFlmt+EnaxxHoGCsJGv
|
||||
TLIe+yhPDECdjW39RZWYV87fRRGDRiVnuDFR0uj0QRFY1unELcy+Z72lySrH9X3SZl9VB72WKvofFb
|
||||
Ar8ofkj4dd4g8RTr9WRC+h9b1kwnNk
|
||||
X-Developer-Key: i=jack@suse.cz; a=openpgp;
|
||||
fpr=93C6099A142276A28BBE35D815BC833443038D8C
|
||||
|
||||
quota_update_limits() is a misnomer because what it actually does is
|
||||
that it updates 'usage' counters and leaves 'limit' counters intact.
|
||||
Rename quota_update_limits() to quota_read_all_dquots() and while
|
||||
changing prototype also add a flags argument so that callers can control
|
||||
which quota information is actually updated from the disk.
|
||||
|
||||
Signed-off-by: Jan Kara <jack@suse.cz>
|
||||
---
|
||||
e2fsck/super.c | 3 ++-
|
||||
lib/support/mkquota.c | 11 ++++++-----
|
||||
lib/support/quotaio.h | 7 +++++--
|
||||
misc/tune2fs.c | 5 +++--
|
||||
4 files changed, 16 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/e2fsck/super.c b/e2fsck/super.c
|
||||
index e1c3f93572f4..75b7b8ffa9b6 100644
|
||||
--- a/e2fsck/super.c
|
||||
+++ b/e2fsck/super.c
|
||||
@@ -281,7 +281,8 @@ static errcode_t e2fsck_read_all_quotas(e2fsck_t ctx)
|
||||
if (qf_ino == 0)
|
||||
continue;
|
||||
|
||||
- retval = quota_update_limits(ctx->qctx, qf_ino, qtype);
|
||||
+ retval = quota_read_all_dquots(ctx->qctx, qf_ino, qtype,
|
||||
+ QREAD_USAGE);
|
||||
if (retval)
|
||||
break;
|
||||
}
|
||||
diff --git a/lib/support/mkquota.c b/lib/support/mkquota.c
|
||||
index 8e5c61a601cc..0fefca90c843 100644
|
||||
--- a/lib/support/mkquota.c
|
||||
+++ b/lib/support/mkquota.c
|
||||
@@ -585,10 +585,11 @@ static errcode_t quota_write_all_dquots(struct quota_handle *qh,
|
||||
#endif
|
||||
|
||||
/*
|
||||
- * Updates the in-memory quota limits from the given quota inode.
|
||||
+ * Read quotas from disk and updates the in-memory information determined by
|
||||
+ * 'flags' from the on-disk data.
|
||||
*/
|
||||
-errcode_t quota_update_limits(quota_ctx_t qctx, ext2_ino_t qf_ino,
|
||||
- enum quota_type qtype)
|
||||
+errcode_t quota_read_all_dquots(quota_ctx_t qctx, ext2_ino_t qf_ino,
|
||||
+ enum quota_type qtype, unsigned int flags)
|
||||
{
|
||||
struct scan_dquots_data scan_data;
|
||||
struct quota_handle *qh;
|
||||
@@ -611,8 +612,8 @@ errcode_t quota_update_limits(quota_ctx_t qctx, ext2_ino_t qf_ino,
|
||||
|
||||
scan_data.quota_dict = qctx->quota_dict[qh->qh_type];
|
||||
scan_data.check_consistency = 0;
|
||||
- scan_data.update_limits = 0;
|
||||
- scan_data.update_usage = 1;
|
||||
+ scan_data.update_limits = !!(flags & QREAD_LIMITS);
|
||||
+ scan_data.update_usage = !!(flags & QREAD_USAGE);
|
||||
qh->qh_ops->scan_dquots(qh, scan_dquots_callback, &scan_data);
|
||||
|
||||
err = quota_file_close(qctx, qh);
|
||||
diff --git a/lib/support/quotaio.h b/lib/support/quotaio.h
|
||||
index 6068970009f5..84fac35dda20 100644
|
||||
--- a/lib/support/quotaio.h
|
||||
+++ b/lib/support/quotaio.h
|
||||
@@ -224,8 +224,11 @@ void quota_data_add(quota_ctx_t qctx, struct ext2_inode_large *inode,
|
||||
void quota_data_sub(quota_ctx_t qctx, struct ext2_inode_large *inode,
|
||||
ext2_ino_t ino, qsize_t space);
|
||||
errcode_t quota_write_inode(quota_ctx_t qctx, enum quota_type qtype);
|
||||
-errcode_t quota_update_limits(quota_ctx_t qctx, ext2_ino_t qf_ino,
|
||||
- enum quota_type type);
|
||||
+/* Flags for quota_read_all_dquots() */
|
||||
+#define QREAD_USAGE 0x01
|
||||
+#define QREAD_LIMITS 0x02
|
||||
+errcode_t quota_read_all_dquots(quota_ctx_t qctx, ext2_ino_t qf_ino,
|
||||
+ enum quota_type type, unsigned int flags);
|
||||
errcode_t quota_compute_usage(quota_ctx_t qctx);
|
||||
void quota_release_context(quota_ctx_t *qctx);
|
||||
errcode_t quota_remove_inode(ext2_filsys fs, enum quota_type qtype);
|
||||
diff --git a/misc/tune2fs.c b/misc/tune2fs.c
|
||||
index f739f16cd62b..bb08f8026918 100644
|
||||
--- a/misc/tune2fs.c
|
||||
+++ b/misc/tune2fs.c
|
||||
@@ -1671,8 +1671,9 @@ static int handle_quota_options(ext2_filsys fs)
|
||||
if (quota_enable[qtype] == QOPT_ENABLE &&
|
||||
*quota_sb_inump(fs->super, qtype) == 0) {
|
||||
if ((qf_ino = quota_file_exists(fs, qtype)) > 0) {
|
||||
- retval = quota_update_limits(qctx, qf_ino,
|
||||
- qtype);
|
||||
+ retval = quota_read_all_dquots(qctx, qf_ino,
|
||||
+ qtype,
|
||||
+ QREAD_USAGE);
|
||||
if (retval) {
|
||||
com_err(program_name, retval,
|
||||
_("while updating quota limits (%d)"),
|
||||
--
|
||||
2.26.2
|
||||
|
47
tune2fs-Fix-conversion-of-quota-files.patch
Normal file
47
tune2fs-Fix-conversion-of-quota-files.patch
Normal file
|
@ -0,0 +1,47 @@
|
|||
From 5d446b4969ee6cb4025f576158be562c87d57142 Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kara <jack@suse.cz>
|
||||
Date: Fri, 20 Aug 2021 21:35:34 +0200
|
||||
Subject: [PATCH 4/8] tune2fs: Fix conversion of quota files
|
||||
X-Developer-Signature: v=1; a=openpgp-sha256; l=1210; h=from:subject;
|
||||
bh=Lx1UJPZNLgsKBmmbN+0GUP40hOyhJD5D9kEVqqVigg4=;
|
||||
b=owEBbQGS/pANAwAIAZydqgc/ZEDZAcsmYgBhI8GkUaN9eZsgn0XvL7BSjbTu57jpbJHkTGpEei61
|
||||
KG+q9pGJATMEAAEIAB0WIQSrWdEr1p4yirVVKBycnaoHP2RA2QUCYSPBpAAKCRCcnaoHP2RA2Z7NB/
|
||||
4osbGPQGrmAwHVUJEqkXAxOBazQE/W3qiykm9uUmzeBGC++5nQzo1J05nb479mQY84Lu8j1Mhbloh8
|
||||
vtdLdJ0HVHxHQrY058HIXBQfAYlLV0pN6/qRNCVelyjdqQVTjri8oD+TVCjsu4aaTu9ZLZCYM41w5s
|
||||
gweKqj260PJ93IL025nGha6ZL2BsenQy/tKRG7/I9O/c6YUAFKSvXDJ0M/L4XtgMTKxzROSiKDmy8h
|
||||
gEw2Gc9oCZLISL2ulhLJ6ppxQ7jcbvoTuZmdFxhbQIfs8gQnmxlGcQLWs5fDMIKfux5qBwQGnYIC1u
|
||||
jZOGndUvcOaDO3Zexb1ik8pxnpIi+F
|
||||
X-Developer-Key: i=jack@suse.cz; a=openpgp;
|
||||
fpr=93C6099A142276A28BBE35D815BC833443038D8C
|
||||
|
||||
When tune2fs is enabling quota feature, it looks for old-style quota
|
||||
files and tries to transfer limits stored in these files into newly
|
||||
created hidded quota files. However the code doing the transfer setups
|
||||
the quota scan wrongly and instead of transferring limits we transfer
|
||||
usage. So not only quota limits are lost (at least they can still be
|
||||
recovered from the old quota files) but also usage information may be
|
||||
wrong if the accounting in e2fsprogs does not exactly match the
|
||||
accounting in quota-tools (which is actually the case). Fix the setup of
|
||||
the quota scan.
|
||||
|
||||
Signed-off-by: Jan Kara <jack@suse.cz>
|
||||
---
|
||||
misc/tune2fs.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/misc/tune2fs.c b/misc/tune2fs.c
|
||||
index bb08f8026918..0f6ef3d6df6b 100644
|
||||
--- a/misc/tune2fs.c
|
||||
+++ b/misc/tune2fs.c
|
||||
@@ -1673,7 +1673,7 @@ static int handle_quota_options(ext2_filsys fs)
|
||||
if ((qf_ino = quota_file_exists(fs, qtype)) > 0) {
|
||||
retval = quota_read_all_dquots(qctx, qf_ino,
|
||||
qtype,
|
||||
- QREAD_USAGE);
|
||||
+ QREAD_LIMITS);
|
||||
if (retval) {
|
||||
com_err(program_name, retval,
|
||||
_("while updating quota limits (%d)"),
|
||||
--
|
||||
2.26.2
|
||||
|
Loading…
Add table
Reference in a new issue