diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..52772e4 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/xfsprogs-4.19.0.tar.xz diff --git a/.xfsprogs.metadata b/.xfsprogs.metadata new file mode 100644 index 0000000..72adb91 --- /dev/null +++ b/.xfsprogs.metadata @@ -0,0 +1 @@ +e6aa93d892df76a1675755b88e9ac6b2793eb619 SOURCES/xfsprogs-4.19.0.tar.xz diff --git a/SOURCES/0001-xfs_repair-initialize-non-leaf-finobt-blocks-with-co.patch b/SOURCES/0001-xfs_repair-initialize-non-leaf-finobt-blocks-with-co.patch new file mode 100644 index 0000000..184a614 --- /dev/null +++ b/SOURCES/0001-xfs_repair-initialize-non-leaf-finobt-blocks-with-co.patch @@ -0,0 +1,76 @@ +From 051dae5efb4fc7c1c47ccb72ff161241fb0815ee Mon Sep 17 00:00:00 2001 +From: Brian Foster +Date: Mon, 28 Jan 2019 16:05:16 -0600 +Subject: [PATCH] xfs_repair: initialize non-leaf finobt blocks with correct + magic + +The free inode btree construction code in xfs_repair has a bug where +any non-leaf nodes outside of the leftmost block at the associated +level in the tree are incorrectly initialized with the inobt magic +value. Update the prop_ino_cursor() path responsible for growing the +non-leaf portion of the inode btrees to use the btnum of the +specific tree being generated rather than the hardcoded inode btree +type. + +Signed-off-by: Brian Foster +Reported-by: Lucas Stach +Root-caused-by: Lucas Stach +Reviewed-by: Eric Sandeen +Reviewed-by: Dave Chinner +Signed-off-by: Eric Sandeen +--- + repair/phase5.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/repair/phase5.c b/repair/phase5.c +index 1bacfc7..e8f9f46 100644 +--- a/repair/phase5.c ++++ b/repair/phase5.c +@@ -983,7 +983,7 @@ init_ino_cursor(xfs_mount_t *mp, xfs_agnumber_t agno, bt_status_t *btree_curs, + + static void + prop_ino_cursor(xfs_mount_t *mp, xfs_agnumber_t agno, bt_status_t *btree_curs, +- xfs_agino_t startino, int level) ++ xfs_btnum_t btnum, xfs_agino_t startino, int level) + { + struct xfs_btree_block *bt_hdr; + xfs_inobt_key_t *bt_key; +@@ -1005,7 +1005,7 @@ prop_ino_cursor(xfs_mount_t *mp, xfs_agnumber_t agno, bt_status_t *btree_curs, + * first path up the left side of the tree + * where the agbno's are already set up + */ +- prop_ino_cursor(mp, agno, btree_curs, startino, level); ++ prop_ino_cursor(mp, agno, btree_curs, btnum, startino, level); + } + + if (be16_to_cpu(bt_hdr->bb_numrecs) == +@@ -1041,7 +1041,7 @@ prop_ino_cursor(xfs_mount_t *mp, xfs_agnumber_t agno, bt_status_t *btree_curs, + lptr->buf_p->b_ops = &xfs_inobt_buf_ops; + bt_hdr = XFS_BUF_TO_BLOCK(lptr->buf_p); + memset(bt_hdr, 0, mp->m_sb.sb_blocksize); +- libxfs_btree_init_block(mp, lptr->buf_p, XFS_BTNUM_INO, ++ libxfs_btree_init_block(mp, lptr->buf_p, btnum, + level, 0, agno, 0); + + bt_hdr->bb_u.s.bb_leftsib = cpu_to_be32(lptr->prev_agbno); +@@ -1049,7 +1049,7 @@ prop_ino_cursor(xfs_mount_t *mp, xfs_agnumber_t agno, bt_status_t *btree_curs, + /* + * propagate extent record for first extent in new block up + */ +- prop_ino_cursor(mp, agno, btree_curs, startino, level); ++ prop_ino_cursor(mp, agno, btree_curs, btnum, startino, level); + } + /* + * add inode info to current block +@@ -1201,7 +1201,7 @@ build_ino_tree(xfs_mount_t *mp, xfs_agnumber_t agno, + lptr->modulo--; + + if (lptr->num_recs_pb > 0) +- prop_ino_cursor(mp, agno, btree_curs, ++ prop_ino_cursor(mp, agno, btree_curs, btnum, + ino_rec->ino_startnum, 0); + + bt_rec = (xfs_inobt_rec_t *) +-- +2.9.5 + diff --git a/SOURCES/xfsprogs-4.17.0-reflink-default.patch b/SOURCES/xfsprogs-4.17.0-reflink-default.patch new file mode 100644 index 0000000..3d7ea87 --- /dev/null +++ b/SOURCES/xfsprogs-4.17.0-reflink-default.patch @@ -0,0 +1,74 @@ +Index: xfsprogs-4.19.0/mkfs/xfs_mkfs.c +=================================================================== +--- xfsprogs-4.19.0.orig/mkfs/xfs_mkfs.c ++++ xfsprogs-4.19.0/mkfs/xfs_mkfs.c +@@ -1973,15 +1973,15 @@ _("Directory ftype field always enabled + usage(); + } + +- } else { ++ } else { /* !crcs_enabled */ + /* +- * The kernel doesn't currently support crc=0,finobt=1 +- * filesystems. If crcs are not enabled and the user has not +- * explicitly turned finobt on, then silently turn it off to +- * avoid an unnecessary warning. ++ * The kernel doesn't support crc=0,finobt=1 filesystems. ++ * If crcs are not enabled and the user has not explicitly ++ * turned finobt on, then silently turn it off to avoid an ++ * unnecessary warning. + * If the user explicitly tried to use crc=0,finobt=1, + * then issue an error. +- * The same is also for sparse inodes. ++ * The same is also true for sparse inodes and reflink. + */ + if (cli->sb_feat.finobt && cli_opt_set(&mopts, M_FINOBT)) { + fprintf(stderr, +@@ -2004,7 +2004,7 @@ _("rmapbt not supported without CRC supp + } + cli->sb_feat.rmapbt = false; + +- if (cli->sb_feat.reflink) { ++ if (cli->sb_feat.reflink && cli_opt_set(&mopts, M_REFLINK)) { + fprintf(stderr, + _("reflink not supported without CRC support\n")); + usage(); +@@ -3788,7 +3788,7 @@ main( + .finobt = true, + .spinodes = true, + .rmapbt = false, +- .reflink = false, ++ .reflink = true, + .parent_pointers = false, + .nodalign = false, + .nortalign = false, +Index: xfsprogs-4.19.0/man/man8/mkfs.xfs.8 +=================================================================== +--- xfsprogs-4.19.0.orig/man/man8/mkfs.xfs.8 ++++ xfsprogs-4.19.0/man/man8/mkfs.xfs.8 +@@ -229,9 +229,9 @@ mapping will be changed to the new block + enables the creation of per-file snapshots and deduplication. It is only + available for the data forks of regular files. + .IP +-By default, ++By default in Red Hat Enterprise Linux 8, + .B mkfs.xfs +-will not create reference count btrees and therefore will not enable the ++will create reference count btrees and therefore will enable the + reflink feature. This feature is only available for filesystems created with + the (default) + .B \-m crc=1 +@@ -239,6 +239,13 @@ option set. When the option + .B \-m crc=0 + is used, the reference count btree feature is not supported and reflink is + disabled. ++.IP ++Note: the filesystem DAX mount option ( ++.B \-o dax ++) is incompatible with ++reflink-enabled XFS filesystems. To use filesystem DAX with XFS, specify the ++.B \-m reflink=0 ++option to mkfs.xfs to disable the reflink feature. + .RE + .TP + .BI \-d " data_section_options" diff --git a/SPECS/xfsprogs.spec b/SPECS/xfsprogs.spec new file mode 100644 index 0000000..c81fc9f --- /dev/null +++ b/SPECS/xfsprogs.spec @@ -0,0 +1,224 @@ +Summary: Utilities for managing the XFS filesystem +Name: xfsprogs +Version: 4.19.0 +Release: 2%{?dist} +License: GPL+ and LGPLv2+ +Group: System Environment/Base +URL: https://xfs.wiki.kernel.org +Source0: http://kernel.org/pub/linux/utils/fs/xfs/xfsprogs/%{name}-%{version}.tar.xz +BuildRequires: gcc +BuildRequires: libtool, gettext, libattr-devel, libuuid-devel +BuildRequires: readline-devel, libblkid-devel >= 2.17-0.1.git5e51568 +BuildRequires: lvm2-devel, libicu-devel >= 4.6 +Provides: xfs-cmds +Obsoletes: xfs-cmds <= %{version} +Provides: xfsprogs-qa-devel +Obsoletes: xfsprogs-qa-devel <= %{version} +Conflicts: xfsdump < 3.0.1 + +# reflink is not yet default upstream, but we enabled it as such +Patch0: xfsprogs-4.17.0-reflink-default.patch +Patch1: 0001-xfs_repair-initialize-non-leaf-finobt-blocks-with-co.patch + +%description +A set of commands to use the XFS filesystem, including mkfs.xfs. + +XFS is a high performance journaling filesystem which originated +on the SGI IRIX platform. It is completely multi-threaded, can +support large files and large filesystems, extended attributes, +variable block sizes, is extent based, and makes extensive use of +Btrees (directories, extents, free space) to aid both performance +and scalability. + +This implementation is on-disk compatible with the IRIX version +of XFS. + +%package devel +Summary: XFS filesystem-specific headers +Group: Development/Libraries +Requires: xfsprogs = %{version}-%{release}, libuuid-devel + +%description devel +xfsprogs-devel contains the header files needed to develop XFS +filesystem-specific programs. + +You should install xfsprogs-devel if you want to develop XFS +filesystem-specific programs, If you install xfsprogs-devel, you'll +also want to install xfsprogs. + +%prep +%setup -q + +%patch0 -p1 +%patch1 -p1 + +%build +export tagname=CC + +%configure \ + --enable-readline=yes \ + --enable-blkid=yes \ + --enable-lto=no \ + --enable-scrub=no + +# NOTE scrub manpages manually removed below as well + +make V=1 %{?_smp_mflags} + +%install +make DIST_ROOT=$RPM_BUILD_ROOT install install-dev \ + PKG_ROOT_SBIN_DIR=%{_sbindir} PKG_ROOT_LIB_DIR=%{_libdir} + +# nuke .la files, etc +rm -f $RPM_BUILD_ROOT/{%{_lib}/*.{la,a,so},%{_libdir}/*.{la,a}} + +# remove non-versioned docs location +rm -rf $RPM_BUILD_ROOT/%{_datadir}/doc/xfsprogs/ + +# Remove scrub manpages +rm -rf $RPM_BUILD_ROOT/%{_mandir}/man8/xfs_scrub* + +%find_lang %{name} + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%files -f %{name}.lang +%doc doc/CHANGES README +%{_libdir}/*.so.* +%{_mandir}/man5/* +%{_mandir}/man8/* +%{_sbindir}/* + +%files devel +%{_mandir}/man2/* +%{_mandir}/man3/* +%dir %{_includedir}/xfs +%{_includedir}/xfs/handle.h +%{_includedir}/xfs/jdm.h +%{_includedir}/xfs/linux.h +%{_includedir}/xfs/xfs.h +%{_includedir}/xfs/xfs_arch.h +%{_includedir}/xfs/xfs_fs.h +%{_includedir}/xfs/xfs_types.h +%{_includedir}/xfs/xfs_format.h +%{_includedir}/xfs/xfs_da_format.h +%{_includedir}/xfs/xfs_log_format.h +%{_includedir}/xfs/xqm.h + +%{_libdir}/*.so + +%changelog +* Mon Feb 04 2019 Eric Sandeen 4.19.0-2 +- xfs_repair: initialize non-leaf finobt blocks with correct magic (#1670153) + +* Tue Nov 27 2018 Eric Sandeen 4.19.0-1 +- New upstream release (#1652248) +- Note reflink default in mkfs.xfs manpage (#1641698) +- Fix xfs_db sign extension in agi freecount (#1640090) +- Fix xfs_repair hang on large filesystem (#1630674) + +* Mon Sep 25 2018 Eric Sandeen 4.18.0-3 +- Remove experimental xfs_scrub utility (#1623301) + +* Wed Sep 19 2018 Eric Sandeen 4.18.0-2 +- Fix annobin checks (#1630641) + +* Tue Aug 28 2018 Eric Sandeen 4.18.0-1 +- New upstream release (#1623695) + +* Mon Aug 13 2018 Eric Sandeen 4.17.0-4 +- Disable reflink automatically if crcs are disabled (#1600610) + +* Wed Aug 01 2018 Charalampos Stratakis - 4.17.0-3 +- Rebuild for platform-python + +* Thu Jun 28 2018 Eric Sandeen 4.17.0-2 +- Default mkfs to reflink enabled (#1494028) + +* Thu Jun 28 2018 Eric Sandeen 4.17.0-1 +- New upstream release +- Clean up spec file + +* Mon Feb 26 2018 Eric Sandeen 4.15.1-1 +- New upstream release +- Update Polish translation + +* Mon Feb 26 2018 Eric Sandeen 4.15.0-2 +- BuildRequires: gcc + +* Sat Feb 24 2018 Eric Sandeen 4.15.0-1 +- New upstream release +- Adds new xfs_scrub utility and services + +* Fri Feb 09 2018 Fedora Release Engineering - 4.14.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Mon Nov 27 2017 Eric Sandeen 4.14.0-1 +- New upstream release + +* Wed Sep 27 2017 Eric Sandeen 4.13.1-1 +- New upstream release +- Trim ancient changelog + +* Thu Aug 03 2017 Fedora Release Engineering - 4.12.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Sun Jul 30 2017 Florian Weimer - 4.12.0-3 +- Rebuild with binutils fix for ppc64le (#1475636) + +* Thu Jul 27 2017 Fedora Release Engineering - 4.12.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Mon Jul 24 2017 Eric Sandeen 4.12.0-1 +- New upstream release + +* Fri May 05 2017 Eric Sandeen 4.11.0-1 +- New upstream release + +* Sun Feb 26 2017 Eric Sandeen 4.10.0-1 +- New upstream release + +* Sat Feb 11 2017 Fedora Release Engineering - 4.9.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Thu Jan 12 2017 Igor Gnatenko - 4.9.0-2 +- Rebuild for readline 7.x + +* Thu Jan 05 2017 Eric Sandeen 4.9.0-1 +- New upstream release + +* Tue Oct 18 2016 Eric Sandeen 4.8.0-1 +- New upstream release + +* Tue Sep 06 2016 Eric Sandeen 4.7.0-2 +- Add libattr-devel build dependency to fix xfs_fsr + +* Sun Sep 04 2016 Eric Sandeen 4.7.0-1 +- New upstream release + +* Tue Mar 15 2016 Eric Sandeen 4.5.0-1 +- New upstream release + +* Thu Mar 10 2016 Eric Sandeen 4.3.0-3 +- Fix build w/ new kernels which have [sg]etxattr promotion + +* Fri Feb 05 2016 Fedora Release Engineering - 4.3.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Mon Nov 30 2015 Eric Sandeen 4.3.0-1 +- New upstream release + +* Wed Sep 09 2015 Eric Sandeen 4.2.0-1 +- New upstream release + +* Thu Jul 30 2015 Eric Sandeen 3.2.4-1 +- New upstream release +- Addresses CVE-2012-2150 for xfs_metadump + +* Fri Jun 19 2015 Fedora Release Engineering - 3.2.3-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Wed Jun 10 2015 Eric Sandeen 3.2.3-1 +- New upstream release