From 154e2af4aa491ac4ab9b04727ad61033927cd88d4e2f8977013a0c726e9e4783 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20=C4=8Cerm=C3=A1k?= Date: Thu, 7 Dec 2023 10:33:56 +0000 Subject: [PATCH 1/3] [info=5d9e4f974ca7e2613971391aa258523d22ca9b52] OBS-URL: https://build.opensuse.org/package/show/devel:Factory:git-workflow:staging:ailiopoulos:xfsprogs:5/xfsprogs?expand=0&rev=1 --- ...de-back-into-place-if-corrupted-by-b.patch | 280 ------------------ _scmsync.obsinfo | 4 + xfsprogs-6.4.0.tar.sign | 7 - xfsprogs-6.4.0.tar.xz | 3 - xfsprogs-6.5.0.tar.sign | 7 + xfsprogs-6.5.0.tar.xz | 3 + xfsprogs.changes | 23 ++ xfsprogs.spec | 4 +- 8 files changed, 38 insertions(+), 293 deletions(-) delete mode 100644 0001-repair-shift-inode-back-into-place-if-corrupted-by-b.patch create mode 100644 _scmsync.obsinfo delete mode 100644 xfsprogs-6.4.0.tar.sign delete mode 100644 xfsprogs-6.4.0.tar.xz create mode 100644 xfsprogs-6.5.0.tar.sign create mode 100644 xfsprogs-6.5.0.tar.xz diff --git a/0001-repair-shift-inode-back-into-place-if-corrupted-by-b.patch b/0001-repair-shift-inode-back-into-place-if-corrupted-by-b.patch deleted file mode 100644 index 8d2e3ce..0000000 --- a/0001-repair-shift-inode-back-into-place-if-corrupted-by-b.patch +++ /dev/null @@ -1,280 +0,0 @@ -From e2239ef552a48edd33740fec8a005a7ac12dcc80 Mon Sep 17 00:00:00 2001 -From: Jeffrey Mahoney -Date: Tue, 21 Aug 2018 13:41:20 -0400 -Subject: [PATCH] repair: shift inode back into place if corrupted by bad log - replay -References: bsc#1105396 - -SUSE kernels 3.12.74-60.64.40 through 3.12.74-60.64.99 contained -a regression where xfs_icdinode_t modified di_dmstate to be -an atomic_t. Since we only complain if an inode item is too large, -if a kernel with this patch applied mounted a file system with inode -items in the log formatted by a kernel without this patch, they would -be used but would be interpreted using the structure with the atomic_t. - -As a result, the inode would be copied incorrectly, corrupting di_dmstate -and the members that follow it. - -For v3 inodes, we can detect that the UUID is shifted forward -8 bytes and recover di_uuid, di_ino, di_crtime, di_pad2, di_cowextsize, -di_flags2, and di_lsn. The UUID and inode number being incorrect -will trip the verifier on iread, but it will have been flushed from the -log in a broken state. - -di_changecount is lost entirely since half is overwritten by the CRC -being updated and the other half fell in a hole in the structure. -di_flags is lost entirely since it is overwritten by the half of -the generation number. Half of the generation number is lost since -it falls in a hole in the structure. - -For v2 inodes, the corruption is more limited but impossible to -detect beyond invalid flags being in use. - -Without this fix, xfs_repair will clear the affected inodes, causing -big problems. - -Signed-off-by: Jeff Mahoney ---- - repair/dinode.c | 186 ++++++++++++++++++++++++++++++++++++++++++++++-- - 1 file changed, 180 insertions(+), 6 deletions(-) - -diff --git a/repair/dinode.c b/repair/dinode.c -index 8ea919698d14..81238568ac8e 100644 ---- a/repair/dinode.c -+++ b/repair/dinode.c -@@ -2239,6 +2239,160 @@ _("Bad extent size hint %u on inode %" PRIu64 ", "), - } - } - -+static int -+check_shifted_uuid(struct xfs_dinode *dino, xfs_mount_t *mp) -+{ -+ uint64_t tmp64; -+ char tmpuuid[16]; -+ uuid_t uuid; -+ -+ tmp64 = be64_to_cpu(dino->di_ino); -+ memcpy(tmpuuid, &tmp64, sizeof(tmp64)); -+ memcpy(tmpuuid + 8, &dino->di_uuid, 8); -+ memcpy(uuid, tmpuuid, 16); -+ -+ return !platform_uuid_compare(&uuid, &mp->m_sb.sb_meta_uuid); -+} -+ -+/* -+ * There was a kernel that would use incorrectly-formatted log items. -+ * If it recovered a dirty log, corrupted inodes would result. -+ * 12 bytes of the inode are completely unrecoverable. Those are -+ * documented below. -+ */ -+static void -+repair_inode_with_bad_atomic(struct xfs_dinode *dino, xfs_mount_t *mp) -+{ -+ struct xfs_dinode fixed; -+ struct xfs_legacy_timestamp *lts; -+ uint64_t tmp64; -+ uint32_t tmp32; -+ char tmpuuid[16]; -+ char *tmpptr; -+ -+ uuid_t uuid; -+ -+ tmp64 = be64_to_cpu(dino->di_ino); -+ memcpy(tmpuuid, &tmp64, sizeof(tmp64)); -+ tmpptr = (char *)dino->di_uuid; -+ memcpy(tmpuuid + 8, tmpptr, 8); -+ memcpy(uuid, tmpuuid, 16); -+ -+ memcpy(&fixed, dino, sizeof(fixed)); -+ memcpy(&fixed.di_uuid, uuid, sizeof(uuid)); -+ -+ tmp32 = *(uint32_t *)&dino->di_pad2[4]; -+ lts = (struct xfs_legacy_timestamp *)&(fixed.di_crtime); -+ lts->t_sec = cpu_to_be32(tmp32); -+ tmp32 = *(uint32_t *)&dino->di_pad2[8]; -+ lts->t_nsec = cpu_to_be32(tmp32); -+ -+ tmp64 = be32_to_cpu(((struct xfs_legacy_timestamp *)(&(dino->di_crtime)))->t_nsec); -+ tmp64 <<= 32; -+ tmp64 |= be32_to_cpu(((struct xfs_legacy_timestamp *)(&(dino->di_crtime)))->t_sec); -+ fixed.di_ino = cpu_to_be64(tmp64); -+ -+ tmp64 = be64_to_cpu(fixed.di_ino); -+ -+ memcpy(fixed.di_pad2 + 8, dino->di_pad2, 4); -+ -+ tmp32 = be32_to_cpu(dino->di_cowextsize); -+ memcpy(fixed.di_pad2 + 4, &tmp32, 4); -+ -+ tmp64 = be64_to_cpu(dino->di_flags2); -+ tmp32 = tmp64 >> 32; -+ memcpy(fixed.di_pad2, &tmp32, 4); -+ -+ fixed.di_cowextsize = cpu_to_be32(tmp64); -+ fixed.di_flags2 = dino->di_lsn; -+ fixed.di_lsn = dino->di_changecount; -+ -+ /* -+ * This is lost entirely. Half falls in padding and half -+ * is overwritten by the CRC. -+ */ -+ fixed.di_changecount = 0; -+ -+#if __BYTE_ORDER == __LITTLE_ENDIAN -+ /* -+ * Half of the generation number is lost, but it's the high bits. -+ * Pick a high number and hope for the best. -+ */ -+ tmp32 = 0xff000000; -+ tmp32 |= be16_to_cpu(dino->di_flags); -+ fixed.di_gen = cpu_to_be32(tmp32); -+#else -+ /* -+ * Half of the generation number is lost, but it's the low bits, -+ * so we can fake it. -+ */ -+ tmp32 = be16_to_cpu(dino->di_flags) + 1; -+ tmp32 <<= 16; -+ fixed.di_gen = cpu_to_be32(tmp32); -+#endif -+ -+ /* -+ * The flags are lost since the atomic_t was 32-bit and we -+ * only keep 16. -+ */ -+ fixed.di_flags = 0; -+ -+ memcpy(dino, &fixed, sizeof(*dino)); -+ xfs_dinode_calc_crc(mp, dino); -+} -+ -+static int -+process_dinode_int(xfs_mount_t *mp, struct xfs_dinode *dino, xfs_agnumber_t agno, -+ xfs_agino_t ino, int was_free, int *dirty, int *used, -+ int verify_mode, int uncertain, int ino_discovery, -+ int check_dups, int extra_attr_check, int *isa_dir, -+ xfs_ino_t *parent, int recurse); -+ -+static int -+handle_malformed_inode(xfs_mount_t *mp, struct xfs_dinode *dino, -+ xfs_agnumber_t agno, xfs_agino_t ino, int was_free, -+ int *dirty, int *used, int verify_mode, int uncertain, -+ int ino_discovery, int check_dups, int extra_attr_check, -+ int *isa_dir, xfs_ino_t *parent) -+{ -+ struct xfs_dinode save; -+ int retval; -+ xfs_ino_t lino = XFS_AGINO_TO_INO(mp, agno, ino); -+ -+ if (!uncertain) -+ do_warn(_("malformed inode %" PRIu64 " found%c"), -+ lino, verify_mode ? '\n' : ','); -+ -+ /* -+ * We can't just pass a local copy to verify since we need the -+ * data fork to check directories. -+ */ -+ if (verify_mode || no_modify) -+ memcpy(&save, dino, sizeof(*dino)); -+ -+ repair_inode_with_bad_atomic(dino, mp); -+ retval = process_dinode_int(mp, dino, agno, ino, was_free, dirty, -+ used, verify_mode, uncertain, ino_discovery, -+ check_dups, extra_attr_check, -+ isa_dir, parent, 1); -+ -+ if (verify_mode || no_modify) { -+ memcpy(dino, &save, sizeof(*dino)); -+ *dirty = 0; -+ } -+ -+ if (retval == 0 && !verify_mode) { -+ if (no_modify) -+ do_warn(_(" would repair\n")); -+ else { -+ do_warn(_(" repairing\n")); -+ *dirty = 1; -+ } -+ } -+ -+ return retval; -+} -+ - /* - * returns 0 if the inode is ok, 1 if the inode is corrupt - * check_dups can be set to 1 *only* when called by the -@@ -2263,7 +2417,8 @@ process_dinode_int(xfs_mount_t *mp, - * duplicate blocks */ - int extra_attr_check, /* 1 == do attribute format and value checks */ - int *isa_dir, /* out == 1 if inode is a directory */ -- xfs_ino_t *parent) /* out -- parent if ino is a dir */ -+ xfs_ino_t *parent, /* out -- parent if ino is a dir */ -+ int recurse) - { - xfs_rfsblock_t totblocks = 0; - xfs_rfsblock_t atotblocks = 0; -@@ -2379,6 +2534,25 @@ process_dinode_int(xfs_mount_t *mp, - * memory and hence invalidated the CRC. - */ - if (xfs_has_crc(mp)) { -+ int good_uuid = 1; -+ -+ if (platform_uuid_compare(&dino->di_uuid, -+ &mp->m_sb.sb_meta_uuid)) -+ good_uuid = 0; -+ -+ /* -+ * Only check to see if it's a malformed inode if it has -+ * a valid magic, crc, and version and an invalid uuid. -+ */ -+ if (!good_uuid && !retval && !recurse && -+ check_shifted_uuid(dino, mp)) -+ return handle_malformed_inode(mp, dino, agno, ino, -+ was_free, dirty, used, -+ verify_mode, uncertain, -+ ino_discovery, check_dups, -+ extra_attr_check, -+ isa_dir, parent); -+ - if (be64_to_cpu(dino->di_ino) != lino) { - if (!uncertain) - do_warn( -@@ -2389,8 +2563,7 @@ _("inode identifier %llu mismatch on inode %" PRIu64 "\n"), - return 1; - goto clear_bad_out; - } -- if (platform_uuid_compare(&dino->di_uuid, -- &mp->m_sb.sb_meta_uuid)) { -+ if (!good_uuid) { - if (!uncertain) - do_warn( - _("UUID mismatch on inode %" PRIu64 "\n"), lino); -@@ -2952,7 +3125,8 @@ process_dinode( - #endif - return process_dinode_int(mp, dino, agno, ino, was_free, dirty, used, - verify_mode, uncertain, ino_discovery, -- check_dups, extra_attr_check, isa_dir, parent); -+ check_dups, extra_attr_check, isa_dir, parent, -+ 0); - } - - /* -@@ -2979,7 +3153,7 @@ verify_dinode( - - return process_dinode_int(mp, dino, agno, ino, 0, &dirty, &used, - verify_mode, uncertain, ino_discovery, -- check_dups, 0, &isa_dir, &parent); -+ check_dups, 0, &isa_dir, &parent, 0); - } - - /* -@@ -3005,5 +3179,5 @@ verify_uncertain_dinode( - - return process_dinode_int(mp, dino, agno, ino, 0, &dirty, &used, - verify_mode, uncertain, ino_discovery, -- check_dups, 0, &isa_dir, &parent); -+ check_dups, 0, &isa_dir, &parent, 0); - } --- -2.36.1 - diff --git a/_scmsync.obsinfo b/_scmsync.obsinfo new file mode 100644 index 0000000..bdc9010 --- /dev/null +++ b/_scmsync.obsinfo @@ -0,0 +1,4 @@ +mtime: 1697359362 +commit: 5d9e4f974ca7e2613971391aa258523d22ca9b52 +url: https://src.opensuse.org/ailiopoulos/xfsprogs.git +revision: 5d9e4f974ca7e2613971391aa258523d22ca9b52 diff --git a/xfsprogs-6.4.0.tar.sign b/xfsprogs-6.4.0.tar.sign deleted file mode 100644 index 3bf4ec3..0000000 --- a/xfsprogs-6.4.0.tar.sign +++ /dev/null @@ -1,7 +0,0 @@ ------BEGIN PGP SIGNATURE----- - -iIUEABYIAC0WIQT6QG4gav94c4l8aGS0VhjDaiT9IwUCZLfVMw8cY2VtQGtlcm5l -bC5vcmcACgkQtFYYw2ok/SNKPwEA6fsxp1TRbPXQn6a605fU3cE6WjcqDLej3zYa -lx91BnABAKIWP14Rd7KPbCH4ezAPydFZxSn26trKqPxzAFOZ/skP -=mkU4 ------END PGP SIGNATURE----- diff --git a/xfsprogs-6.4.0.tar.xz b/xfsprogs-6.4.0.tar.xz deleted file mode 100644 index 5288339..0000000 --- a/xfsprogs-6.4.0.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c31868418bfbf49a3a9c47fc70cdffde9d96f4ff0051bd04a0881e6654648104 -size 1344720 diff --git a/xfsprogs-6.5.0.tar.sign b/xfsprogs-6.5.0.tar.sign new file mode 100644 index 0000000..926a212 --- /dev/null +++ b/xfsprogs-6.5.0.tar.sign @@ -0,0 +1,7 @@ +-----BEGIN PGP SIGNATURE----- + +iIUEABYIAC0WIQT6QG4gav94c4l8aGS0VhjDaiT9IwUCZSfZXQ8cY2VtQGtlcm5l +bC5vcmcACgkQtFYYw2ok/SOFogD+MZ4LooqWPZ9aNEfw/GEtiJJzlVMwYHFcgqDK +xgilyusBAKOZeJc4SiFarTv2PnIRuMDxhwaFm0Sy+ngiFn0whlED +=k6/7 +-----END PGP SIGNATURE----- diff --git a/xfsprogs-6.5.0.tar.xz b/xfsprogs-6.5.0.tar.xz new file mode 100644 index 0000000..5893963 --- /dev/null +++ b/xfsprogs-6.5.0.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8db81712b32756b97d89dd9a681ac5e325bbb75e585382cd4863fab7f9d021c6 +size 1348452 diff --git a/xfsprogs.changes b/xfsprogs.changes index d27aa81..e72b588 100644 --- a/xfsprogs.changes +++ b/xfsprogs.changes @@ -1,3 +1,26 @@ +------------------------------------------------------------------- +Fri Oct 13 14:45:05 UTC 2023 - Anthony Iliopoulos + +- update to 6.5.0 + - libxfs: fix atomic64_t detection on x86_32 + - libxfs: use XFS_IGET_CREATE when creating new files + - libfrog: fix overly sleep workqueues + - xfs_db: use directio for device access + - libxfs: make platform_set_blocksize optional with directio + - mkfs: add a config file for 6.6 LTS kernels + - mkfs: enable reverse mapping by default + - mkfs: enable large extent counts by default + - xfs_db: create unlinked inodes + - xfs_db: dump unlinked buckets + - xfsprogs: don't allow udisks to automount XFS filesystems with no prompt + - xfs_repair: fix repair failure caused by dirty flag being abnormally set on buffer + +- drop 0001-repair-shift-inode-back-into-place-if-corrupted-by-b.patch + + This was a fix for a regression that occurred in SLE12 SP1. We can + safely drop this, as upgrading to SLE15 (and later) is only supported + from SLE12-SP4. + ------------------------------------------------------------------- Thu Jul 20 08:45:36 UTC 2023 - Anthony Iliopoulos diff --git a/xfsprogs.spec b/xfsprogs.spec index 17094b4..fb8c2d1 100644 --- a/xfsprogs.spec +++ b/xfsprogs.spec @@ -25,7 +25,7 @@ %endif %define libname libhandle1 Name: xfsprogs -Version: 6.4.0 +Version: 6.5.0 Release: 0 Summary: Utilities for managing the XFS file system License: GPL-2.0-or-later @@ -37,7 +37,6 @@ Source2: %{name}.keyring Source3: module-setup.sh.in Source4: dracut-fsck-help.txt Patch0: xfsprogs-docdir.diff -Patch1: 0001-repair-shift-inode-back-into-place-if-corrupted-by-b.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: libblkid-devel @@ -110,7 +109,6 @@ on xfs filesystems. %prep %setup -q %patch0 -p1 -%patch1 -p1 %build aclocal -I m4 From c30eee9f93ac3ad2edf87753c16d8482ce0c66d2576a8cc7624de070d362c433 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20=C4=8Cerm=C3=A1k?= Date: Thu, 7 Dec 2023 11:18:15 +0000 Subject: [PATCH 2/3] [info=17a039502c700d6b8955d686db5cd68e72adc5b0] OBS-URL: https://build.opensuse.org/package/show/devel:Factory:git-workflow:staging:ailiopoulos:xfsprogs:5/xfsprogs?expand=0&rev=2 --- _scmsync.obsinfo | 6 +++--- xfsprogs-docdir.diff | 10 +++++----- xfsprogs.changes | 6 ++++++ xfsprogs.spec | 2 +- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/_scmsync.obsinfo b/_scmsync.obsinfo index bdc9010..fe5239e 100644 --- a/_scmsync.obsinfo +++ b/_scmsync.obsinfo @@ -1,4 +1,4 @@ -mtime: 1697359362 -commit: 5d9e4f974ca7e2613971391aa258523d22ca9b52 +mtime: 1701947816 +commit: 17a039502c700d6b8955d686db5cd68e72adc5b0 url: https://src.opensuse.org/ailiopoulos/xfsprogs.git -revision: 5d9e4f974ca7e2613971391aa258523d22ca9b52 +revision: 17a039502c700d6b8955d686db5cd68e72adc5b0 diff --git a/xfsprogs-docdir.diff b/xfsprogs-docdir.diff index 29e77c0..a904a6a 100644 --- a/xfsprogs-docdir.diff +++ b/xfsprogs-docdir.diff @@ -1,8 +1,8 @@ -diff --git a/include/builddefs.in b/include/builddefs.in -index 0bb364310d78..07775ac2d5e7 100644 ---- a/include/builddefs.in -+++ b/include/builddefs.in -@@ -54,7 +54,7 @@ PKG_LIB_DIR = @libdir@@libdirsuffix@ +Index: xfsprogs-6.5.0/include/builddefs.in +=================================================================== +--- xfsprogs-6.5.0.orig/include/builddefs.in ++++ xfsprogs-6.5.0/include/builddefs.in +@@ -55,7 +55,7 @@ PKG_LIB_SCRIPT_DIR = @libdir@ PKG_INC_DIR = @includedir@/xfs DK_INC_DIR = @includedir@/disk PKG_MAN_DIR = @mandir@ diff --git a/xfsprogs.changes b/xfsprogs.changes index e72b588..094703b 100644 --- a/xfsprogs.changes +++ b/xfsprogs.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Dec 7 11:06:23 UTC 2023 - Anthony Iliopoulos + +- refresh xfsprogs-docdir.diff +- change spec to autopatch + ------------------------------------------------------------------- Fri Oct 13 14:45:05 UTC 2023 - Anthony Iliopoulos diff --git a/xfsprogs.spec b/xfsprogs.spec index fb8c2d1..f3bafce 100644 --- a/xfsprogs.spec +++ b/xfsprogs.spec @@ -108,7 +108,7 @@ on xfs filesystems. %prep %setup -q -%patch0 -p1 +%autopatch -p1 %build aclocal -I m4 From f87a133f12531402bf1514a8288325b172d845ae077fbf737050ffedacefbc4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20=C4=8Cerm=C3=A1k?= Date: Thu, 7 Dec 2023 11:19:17 +0000 Subject: [PATCH 3/3] [info=5d9e4f974ca7e2613971391aa258523d22ca9b52] OBS-URL: https://build.opensuse.org/package/show/devel:Factory:git-workflow:staging:ailiopoulos:xfsprogs:5/xfsprogs?expand=0&rev=3 --- _scmsync.obsinfo | 6 +++--- xfsprogs-docdir.diff | 10 +++++----- xfsprogs.changes | 6 ------ xfsprogs.spec | 2 +- 4 files changed, 9 insertions(+), 15 deletions(-) diff --git a/_scmsync.obsinfo b/_scmsync.obsinfo index fe5239e..bdc9010 100644 --- a/_scmsync.obsinfo +++ b/_scmsync.obsinfo @@ -1,4 +1,4 @@ -mtime: 1701947816 -commit: 17a039502c700d6b8955d686db5cd68e72adc5b0 +mtime: 1697359362 +commit: 5d9e4f974ca7e2613971391aa258523d22ca9b52 url: https://src.opensuse.org/ailiopoulos/xfsprogs.git -revision: 17a039502c700d6b8955d686db5cd68e72adc5b0 +revision: 5d9e4f974ca7e2613971391aa258523d22ca9b52 diff --git a/xfsprogs-docdir.diff b/xfsprogs-docdir.diff index a904a6a..29e77c0 100644 --- a/xfsprogs-docdir.diff +++ b/xfsprogs-docdir.diff @@ -1,8 +1,8 @@ -Index: xfsprogs-6.5.0/include/builddefs.in -=================================================================== ---- xfsprogs-6.5.0.orig/include/builddefs.in -+++ xfsprogs-6.5.0/include/builddefs.in -@@ -55,7 +55,7 @@ PKG_LIB_SCRIPT_DIR = @libdir@ +diff --git a/include/builddefs.in b/include/builddefs.in +index 0bb364310d78..07775ac2d5e7 100644 +--- a/include/builddefs.in ++++ b/include/builddefs.in +@@ -54,7 +54,7 @@ PKG_LIB_DIR = @libdir@@libdirsuffix@ PKG_INC_DIR = @includedir@/xfs DK_INC_DIR = @includedir@/disk PKG_MAN_DIR = @mandir@ diff --git a/xfsprogs.changes b/xfsprogs.changes index 094703b..e72b588 100644 --- a/xfsprogs.changes +++ b/xfsprogs.changes @@ -1,9 +1,3 @@ -------------------------------------------------------------------- -Thu Dec 7 11:06:23 UTC 2023 - Anthony Iliopoulos - -- refresh xfsprogs-docdir.diff -- change spec to autopatch - ------------------------------------------------------------------- Fri Oct 13 14:45:05 UTC 2023 - Anthony Iliopoulos diff --git a/xfsprogs.spec b/xfsprogs.spec index f3bafce..fb8c2d1 100644 --- a/xfsprogs.spec +++ b/xfsprogs.spec @@ -108,7 +108,7 @@ on xfs filesystems. %prep %setup -q -%autopatch -p1 +%patch0 -p1 %build aclocal -I m4