diff --git a/1001-xfsprogs-add-atomic-write-support.patch b/1001-xfsprogs-add-atomic-write-support.patch index fb0328b03630c9bfc4ba2e1275eb3971e2283603..51ea27e569e1eb1c5342cd9cdd74fb34ab8750ba 100644 --- a/1001-xfsprogs-add-atomic-write-support.patch +++ b/1001-xfsprogs-add-atomic-write-support.patch @@ -1,19 +1,17 @@ -From 78bef13e4a2e405469fddbaf66fbf3fd5df19607 Mon Sep 17 00:00:00 2001 -From: Joseph Qi -Date: Mon, 30 May 2022 15:11:22 +0800 -Subject: [PATCH 9/9] xfsprogs: add atomic write support +From 8dbd4d80e3c167882b6e2836ea560e061df23fcb Mon Sep 17 00:00:00 2001 +From: root +Date: Wed, 13 Mar 2024 13:56:13 +0800 +Subject: [PATCH] change file -Signed-off-by: Gao Xiang -Signed-off-by: Joseph Qi --- libxfs/xfs_format.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libxfs/xfs_format.h b/libxfs/xfs_format.h -index e8e7e634..81f485fc 100644 +index 371dc07..d8929ed 100644 --- a/libxfs/xfs_format.h +++ b/libxfs/xfs_format.h -@@ -450,11 +450,13 @@ xfs_sb_has_compat_feature( +@@ -353,11 +353,13 @@ xfs_sb_has_compat_feature( #define XFS_SB_FEAT_RO_COMPAT_RMAPBT (1 << 1) /* reverse map btree */ #define XFS_SB_FEAT_RO_COMPAT_REFLINK (1 << 2) /* reflinked files */ #define XFS_SB_FEAT_RO_COMPAT_INOBTCNT (1 << 3) /* inobt block counts */ @@ -28,9 +26,9 @@ index e8e7e634..81f485fc 100644 #define XFS_SB_FEAT_RO_COMPAT_UNKNOWN ~XFS_SB_FEAT_RO_COMPAT_ALL static inline bool xfs_sb_has_ro_compat_feature( -@@ -1165,14 +1167,18 @@ static inline void xfs_dinode_put_rdev(struct xfs_dinode *dip, xfs_dev_t rdev) - #define XFS_DIFLAG2_COWEXTSIZE_BIT 2 /* copy on write extent size hint */ +@@ -1070,15 +1072,19 @@ static inline void xfs_dinode_put_rdev(struct xfs_dinode *dip, xfs_dev_t rdev) #define XFS_DIFLAG2_BIGTIME_BIT 3 /* big timestamps */ + #define XFS_DIFLAG2_NREXT64_BIT 4 /* large extent counters */ +/* avoid using the highest bit 63 */ +#define XFS_DIFLAG2_DIO_ATOMIC_WRITE_BIT 60 @@ -39,15 +37,16 @@ index e8e7e634..81f485fc 100644 #define XFS_DIFLAG2_REFLINK (1 << XFS_DIFLAG2_REFLINK_BIT) #define XFS_DIFLAG2_COWEXTSIZE (1 << XFS_DIFLAG2_COWEXTSIZE_BIT) #define XFS_DIFLAG2_BIGTIME (1 << XFS_DIFLAG2_BIGTIME_BIT) + #define XFS_DIFLAG2_NREXT64 (1 << XFS_DIFLAG2_NREXT64_BIT) +#define XFS_DIFLAG2_DIO_ATOMIC_WRITE (1ULL << XFS_DIFLAG2_DIO_ATOMIC_WRITE_BIT) #define XFS_DIFLAG2_ANY \ (XFS_DIFLAG2_DAX | XFS_DIFLAG2_REFLINK | XFS_DIFLAG2_COWEXTSIZE | \ -- XFS_DIFLAG2_BIGTIME) -+ XFS_DIFLAG2_BIGTIME | XFS_DIFLAG2_DIO_ATOMIC_WRITE) +- XFS_DIFLAG2_BIGTIME | XFS_DIFLAG2_NREXT64) ++ XFS_DIFLAG2_BIGTIME | XFS_DIFLAG2_NREXT64 | XFS_DIFLAG2_DIO_ATOMIC_WRITE) static inline bool xfs_dinode_has_bigtime(const struct xfs_dinode *dip) { -- -2.31.1 +2.33.0 diff --git a/xfsprogs-5.10.0.tar.xz b/xfsprogs-5.10.0.tar.xz deleted file mode 100644 index bc28cbd910e821b358369d9eedfc7611221cd25c..0000000000000000000000000000000000000000 Binary files a/xfsprogs-5.10.0.tar.xz and /dev/null differ diff --git a/xfsprogs-5.11.0-mkfs-fix-wrong-inobtcount-usage-error-output.patch b/xfsprogs-5.11.0-mkfs-fix-wrong-inobtcount-usage-error-output.patch deleted file mode 100644 index 9d5b34f9f979319092b9459825cd8259f8e1989c..0000000000000000000000000000000000000000 --- a/xfsprogs-5.11.0-mkfs-fix-wrong-inobtcount-usage-error-output.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 60056b93ba29c1837dacaee1550e0620a1f2b736 Mon Sep 17 00:00:00 2001 -From: Zorro Lang -Date: Fri, 12 Feb 2021 17:23:05 -0500 -Subject: [PATCH 1/9] mkfs: fix wrong inobtcount usage error output - -When mkfs fails, it shows: - ... - /* metadata */ [-m crc=0|1,finobt=0|1,uuid=xxx,rmapbt=0|1,reflink=0|1,\n\ - inobtcnt=0|1,bigtime=0|1]\n\ - ... - -The "inobtcnt=0|1" is wrong usage, it must be inobtcount, there's not -an alias. To avoid misadvice, fix it. - -Signed-off-by: Zorro Lang -Reviewed-by: Eric Sandeen -Signed-off-by: Eric Sandeen ---- - mkfs/xfs_mkfs.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c -index 47acc127..0581843f 100644 ---- a/mkfs/xfs_mkfs.c -+++ b/mkfs/xfs_mkfs.c -@@ -928,7 +928,7 @@ usage( void ) - /* blocksize */ [-b size=num]\n\ - /* config file */ [-c options=xxx]\n\ - /* metadata */ [-m crc=0|1,finobt=0|1,uuid=xxx,rmapbt=0|1,reflink=0|1,\n\ -- inobtcnt=0|1,bigtime=0|1]\n\ -+ inobtcount=0|1,bigtime=0|1]\n\ - /* data subvol */ [-d agcount=n,agsize=n,file,name=xxx,size=num,\n\ - (sunit=value,swidth=value|su=num,sw=num|noalign),\n\ - sectsize=num\n\ --- -2.31.1 - diff --git a/xfsprogs-5.11.0-xfs-refactor-data-device-extent-validation.patch b/xfsprogs-5.11.0-xfs-refactor-data-device-extent-validation.patch deleted file mode 100644 index d350098722f6267bc22926f5da6cb33a7d0336ec..0000000000000000000000000000000000000000 --- a/xfsprogs-5.11.0-xfs-refactor-data-device-extent-validation.patch +++ /dev/null @@ -1,89 +0,0 @@ -From 7e84359f60250be357ed15a1fa626b2e9e2e2dfd Mon Sep 17 00:00:00 2001 -From: "Darrick J. Wong" -Date: Thu, 7 Jan 2021 15:59:17 -0500 -Subject: [PATCH] xfs: refactor data device extent validation - -Source kernel commit: 67457eb0d225521a0e81327aef808cd0f9075880 - -Refactor all the open-coded validation of non-static data device extents -into a single helper. - -Signed-off-by: Darrick J. Wong -Reviewed-by: Dave Chinner -Reviewed-by: Brian Foster -Signed-off-by: Eric Sandeen -Signed-off-by: Ferry Meng ---- - libxfs/xfs_bmap.c | 8 ++------ - libxfs/xfs_types.c | 23 +++++++++++++++++++++++ - libxfs/xfs_types.h | 2 ++ - 3 files changed, 27 insertions(+), 6 deletions(-) - -diff --git a/libxfs/xfs_bmap.c b/libxfs/xfs_bmap.c -index e0ca8b05..b25e32d4 100644 ---- a/libxfs/xfs_bmap.c -+++ b/libxfs/xfs_bmap.c -@@ -6230,12 +6230,8 @@ xfs_bmap_validate_extent( - if (!xfs_verify_rtbno(mp, endfsb)) - return __this_address; - } else { -- if (!xfs_verify_fsbno(mp, irec->br_startblock)) -- return __this_address; -- if (!xfs_verify_fsbno(mp, endfsb)) -- return __this_address; -- if (XFS_FSB_TO_AGNO(mp, irec->br_startblock) != -- XFS_FSB_TO_AGNO(mp, endfsb)) -+ if (!xfs_verify_fsbext(mp, irec->br_startblock, -+ irec->br_blockcount)) - return __this_address; - } - if (irec->br_state != XFS_EXT_NORM && whichfork != XFS_DATA_FORK) -diff --git a/libxfs/xfs_types.c b/libxfs/xfs_types.c -index fa113727..3e6921e0 100644 ---- a/libxfs/xfs_types.c -+++ b/libxfs/xfs_types.c -@@ -61,6 +61,29 @@ xfs_verify_fsbno( - return xfs_verify_agbno(mp, agno, XFS_FSB_TO_AGBNO(mp, fsbno)); - } - -+/* -+ * Verify that a data device extent is fully contained inside the filesystem, -+ * does not cross an AG boundary, and does not point at static metadata. -+ */ -+bool -+xfs_verify_fsbext( -+ struct xfs_mount *mp, -+ xfs_fsblock_t fsbno, -+ xfs_fsblock_t len) -+{ -+ if (fsbno + len <= fsbno) -+ return false; -+ -+ if (!xfs_verify_fsbno(mp, fsbno)) -+ return false; -+ -+ if (!xfs_verify_fsbno(mp, fsbno + len - 1)) -+ return false; -+ -+ return XFS_FSB_TO_AGNO(mp, fsbno) == -+ XFS_FSB_TO_AGNO(mp, fsbno + len - 1); -+} -+ - /* Calculate the first and last possible inode number in an AG. */ - void - xfs_agino_range( -diff --git a/libxfs/xfs_types.h b/libxfs/xfs_types.h -index 397d9477..7feaaac2 100644 ---- a/libxfs/xfs_types.h -+++ b/libxfs/xfs_types.h -@@ -184,6 +184,8 @@ xfs_agblock_t xfs_ag_block_count(struct xfs_mount *mp, xfs_agnumber_t agno); - bool xfs_verify_agbno(struct xfs_mount *mp, xfs_agnumber_t agno, - xfs_agblock_t agbno); - bool xfs_verify_fsbno(struct xfs_mount *mp, xfs_fsblock_t fsbno); -+bool xfs_verify_fsbext(struct xfs_mount *mp, xfs_fsblock_t fsbno, -+ xfs_fsblock_t len); - - void xfs_agino_range(struct xfs_mount *mp, xfs_agnumber_t agno, - xfs_agino_t *first, xfs_agino_t *last); --- -2.19.1.6.gb485710b diff --git a/xfsprogs-5.12.0-libfrog-report-inobtcount-in-geometry.patch b/xfsprogs-5.12.0-libfrog-report-inobtcount-in-geometry.patch deleted file mode 100644 index bd7dde87e3e60b7ab9cf3697f1956d79237c71ac..0000000000000000000000000000000000000000 --- a/xfsprogs-5.12.0-libfrog-report-inobtcount-in-geometry.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 9f7aba4ba43c1f70e9e3909173122fb118671df1 Mon Sep 17 00:00:00 2001 -From: "Darrick J. Wong" -Date: Thu, 15 Apr 2021 15:44:10 -0400 -Subject: [PATCH 2/9] libfrog: report inobtcount in geometry - -Report the inode btree counter feature in fs feature reports. - -Signed-off-by: Darrick J. Wong -Reviewed-by: Christoph Hellwig -Signed-off-by: Eric Sandeen ---- - libfrog/fsgeom.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/libfrog/fsgeom.c b/libfrog/fsgeom.c -index 14507668..4f1a1842 100644 ---- a/libfrog/fsgeom.c -+++ b/libfrog/fsgeom.c -@@ -29,6 +29,7 @@ xfs_report_geom( - int rmapbt_enabled; - int reflink_enabled; - int bigtime_enabled; -+ int inobtcount; - - isint = geo->logstart > 0; - lazycount = geo->flags & XFS_FSOP_GEOM_FLAGS_LAZYSB ? 1 : 0; -@@ -45,12 +46,13 @@ xfs_report_geom( - rmapbt_enabled = geo->flags & XFS_FSOP_GEOM_FLAGS_RMAPBT ? 1 : 0; - reflink_enabled = geo->flags & XFS_FSOP_GEOM_FLAGS_REFLINK ? 1 : 0; - bigtime_enabled = geo->flags & XFS_FSOP_GEOM_FLAGS_BIGTIME ? 1 : 0; -+ inobtcount = geo->flags & XFS_FSOP_GEOM_FLAGS_INOBTCNT ? 1 : 0; - - printf(_( - "meta-data=%-22s isize=%-6d agcount=%u, agsize=%u blks\n" - " =%-22s sectsz=%-5u attr=%u, projid32bit=%u\n" - " =%-22s crc=%-8u finobt=%u, sparse=%u, rmapbt=%u\n" --" =%-22s reflink=%-4u bigtime=%u\n" -+" =%-22s reflink=%-4u bigtime=%u inobtcount=%u\n" - "data =%-22s bsize=%-6u blocks=%llu, imaxpct=%u\n" - " =%-22s sunit=%-6u swidth=%u blks\n" - "naming =version %-14u bsize=%-6u ascii-ci=%d, ftype=%d\n" -@@ -60,7 +62,7 @@ xfs_report_geom( - mntpoint, geo->inodesize, geo->agcount, geo->agblocks, - "", geo->sectsize, attrversion, projid32bit, - "", crcs_enabled, finobt_enabled, spinodes, rmapbt_enabled, -- "", reflink_enabled, bigtime_enabled, -+ "", reflink_enabled, bigtime_enabled, inobtcount, - "", geo->blocksize, (unsigned long long)geo->datablocks, - geo->imaxpct, - "", geo->sunit, geo->swidth, --- -2.31.1 - diff --git a/xfsprogs-5.12.0-libxfs-copy-crtime-correctly-now-that-it-s-timespec6.patch b/xfsprogs-5.12.0-libxfs-copy-crtime-correctly-now-that-it-s-timespec6.patch deleted file mode 100644 index a629e812c04d581f279b5bacb86a54218085b2d5..0000000000000000000000000000000000000000 --- a/xfsprogs-5.12.0-libxfs-copy-crtime-correctly-now-that-it-s-timespec6.patch +++ /dev/null @@ -1,34 +0,0 @@ -From a93a2abe1d185eae394993f82c0280458476c597 Mon Sep 17 00:00:00 2001 -From: "Darrick J. Wong" -Date: Fri, 7 May 2021 10:42:17 -0400 -Subject: [PATCH 3/9] libxfs: copy crtime correctly now that it's timespec64 - -The incore i_mtime and di_crtime are both timespec64 now, which means -that tv_sec is a 64-bit value. Don't cast that to int32_t when we're -creating an inode, because we'll end up truncating the creation time -incorrectly, should an xfsprogs of this vintage make it to 2039. :P - -Signed-off-by: Darrick J. Wong -Reviewed-by: Christoph Hellwig -Signed-off-by: Eric Sandeen ---- - libxfs/util.c | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/libxfs/util.c b/libxfs/util.c -index 252cf91e..e63a5642 100644 ---- a/libxfs/util.c -+++ b/libxfs/util.c -@@ -310,8 +310,7 @@ libxfs_ialloc( - VFS_I(ip)->i_version = 1; - ip->i_d.di_flags2 = pip ? ip->i_mount->m_ino_geo.new_diflags2 : - xfs_flags2diflags2(ip, fsx->fsx_xflags); -- ip->i_d.di_crtime.tv_sec = (int32_t)VFS_I(ip)->i_mtime.tv_sec; -- ip->i_d.di_crtime.tv_nsec = (int32_t)VFS_I(ip)->i_mtime.tv_nsec; -+ ip->i_d.di_crtime = VFS_I(ip)->i_mtime; /* struct copy */ - ip->i_d.di_cowextsize = pip ? 0 : fsx->fsx_cowextsize; - } - --- -2.31.1 - diff --git a/xfsprogs-5.12.0-libxfs-expose-inobtcount-in-xfs-geometry.patch b/xfsprogs-5.12.0-libxfs-expose-inobtcount-in-xfs-geometry.patch deleted file mode 100644 index cc951525021bddededfb8591331073be1307fd00..0000000000000000000000000000000000000000 --- a/xfsprogs-5.12.0-libxfs-expose-inobtcount-in-xfs-geometry.patch +++ /dev/null @@ -1,48 +0,0 @@ -From cf1900135aa38c62615580c5972bd8d1d0252f61 Mon Sep 17 00:00:00 2001 -From: Zorro Lang -Date: Tue, 6 Apr 2021 16:56:32 -0400 -Subject: [PATCH 4/9] libxfs: expose inobtcount in xfs geometry - -Source kernel commit: bc41fa5321f93ecbabec177f888451cfc17ad66d - -As xfs supports the feature of inode btree block counters now, expose -this feature flag in xfs geometry, for userspace can check if the -inobtcnt is enabled or not. - -Signed-off-by: Zorro Lang -Reviewed-by: Darrick J. Wong -Signed-off-by: Darrick J. Wong -Signed-off-by: Eric Sandeen ---- - libxfs/xfs_fs.h | 1 + - libxfs/xfs_sb.c | 2 ++ - 2 files changed, 3 insertions(+) - -diff --git a/libxfs/xfs_fs.h b/libxfs/xfs_fs.h -index 2a2e3cfd..6fad140d 100644 ---- a/libxfs/xfs_fs.h -+++ b/libxfs/xfs_fs.h -@@ -250,6 +250,7 @@ typedef struct xfs_fsop_resblks { - #define XFS_FSOP_GEOM_FLAGS_RMAPBT (1 << 19) /* reverse mapping btree */ - #define XFS_FSOP_GEOM_FLAGS_REFLINK (1 << 20) /* files can share blocks */ - #define XFS_FSOP_GEOM_FLAGS_BIGTIME (1 << 21) /* 64-bit nsec timestamps */ -+#define XFS_FSOP_GEOM_FLAGS_INOBTCNT (1 << 22) /* inobt btree counter */ - - /* - * Minimum and maximum sizes need for growth checks. -diff --git a/libxfs/xfs_sb.c b/libxfs/xfs_sb.c -index fb2212b8..a5ab0211 100644 ---- a/libxfs/xfs_sb.c -+++ b/libxfs/xfs_sb.c -@@ -1145,6 +1145,8 @@ xfs_fs_geometry( - geo->flags |= XFS_FSOP_GEOM_FLAGS_REFLINK; - if (xfs_sb_version_hasbigtime(sbp)) - geo->flags |= XFS_FSOP_GEOM_FLAGS_BIGTIME; -+ if (xfs_sb_version_hasinobtcounts(sbp)) -+ geo->flags |= XFS_FSOP_GEOM_FLAGS_INOBTCNT; - if (xfs_sb_version_hassector(sbp)) - geo->logsectsize = sbp->sb_logsectsize; - else --- -2.31.1 - diff --git a/xfsprogs-5.13.0-xfs-remove-the-unused-xfs_icdinode_has_bigtime-helpe.patch b/xfsprogs-5.13.0-xfs-remove-the-unused-xfs_icdinode_has_bigtime-helpe.patch deleted file mode 100644 index 9433eadbdc0efd3271f140706dd055aee36fe973..0000000000000000000000000000000000000000 --- a/xfsprogs-5.13.0-xfs-remove-the-unused-xfs_icdinode_has_bigtime-helpe.patch +++ /dev/null @@ -1,34 +0,0 @@ -From a7f8000c449bef5ac545ef7a31a5cae4032359c5 Mon Sep 17 00:00:00 2001 -From: Christoph Hellwig -Date: Wed, 30 Jun 2021 18:29:41 -0400 -Subject: [PATCH 5/9] xfs: remove the unused xfs_icdinode_has_bigtime helper - -Source kernel commit: 55f773380e922d3b975a7acb24331c76611cce30 - -Signed-off-by: Christoph Hellwig -Reviewed-by: Darrick J. Wong -Signed-off-by: Darrick J. Wong -Signed-off-by: Eric Sandeen ---- - libxfs/xfs_inode_buf.h | 5 ----- - 1 file changed, 5 deletions(-) - -diff --git a/libxfs/xfs_inode_buf.h b/libxfs/xfs_inode_buf.h -index ef5eaf33..3888a7e9 100644 ---- a/libxfs/xfs_inode_buf.h -+++ b/libxfs/xfs_inode_buf.h -@@ -32,11 +32,6 @@ struct xfs_icdinode { - struct timespec64 di_crtime; /* time created */ - }; - --static inline bool xfs_icdinode_has_bigtime(const struct xfs_icdinode *icd) --{ -- return icd->di_flags2 & XFS_DIFLAG2_BIGTIME; --} -- - /* - * Inode location information. Stored in the inode and passed to - * xfs_imap_to_bp() to get a buffer and dinode for a given inode. --- -2.31.1 - diff --git a/xfsprogs-5.13.0-xfs-rename-struct-xfs_legacy_ictimestamp.patch b/xfsprogs-5.13.0-xfs-rename-struct-xfs_legacy_ictimestamp.patch deleted file mode 100644 index 59b033f14176672416be16135faa93a08dd1a18a..0000000000000000000000000000000000000000 --- a/xfsprogs-5.13.0-xfs-rename-struct-xfs_legacy_ictimestamp.patch +++ /dev/null @@ -1,52 +0,0 @@ -From e5b8c29a68484db709218d33756c7839e979a5d8 Mon Sep 17 00:00:00 2001 -From: Christoph Hellwig -Date: Wed, 30 Jun 2021 18:38:58 -0400 -Subject: [PATCH 6/9] xfs: rename struct xfs_legacy_ictimestamp - -Source kernel commit: 732de7dbdbd30df40a6d260a8da6fc5262039439 - -Rename struct xfs_legacy_ictimestamp to struct xfs_log_legacy_timestamp -as it is a type used for logging timestamps with no relationship to the -in-core inode. - -Signed-off-by: Christoph Hellwig -Reviewed-by: Darrick J. Wong -Signed-off-by: Darrick J. Wong -Signed-off-by: Eric Sandeen ---- - libxfs/xfs_log_format.h | 2 +- - logprint/log_misc.c | 4 ++-- - 2 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/libxfs/xfs_log_format.h b/libxfs/xfs_log_format.h -index 8bd00da6..101b9730 100644 ---- a/libxfs/xfs_log_format.h -+++ b/libxfs/xfs_log_format.h -@@ -371,7 +371,7 @@ static inline int xfs_ilog_fdata(int w) - typedef uint64_t xfs_ictimestamp_t; - - /* Legacy timestamp encoding format. */ --struct xfs_legacy_ictimestamp { -+struct xfs_log_legacy_timestamp { - int32_t t_sec; /* timestamp seconds */ - int32_t t_nsec; /* timestamp nanoseconds */ - }; -diff --git a/logprint/log_misc.c b/logprint/log_misc.c -index afcd2cee..5a145f94 100644 ---- a/logprint/log_misc.c -+++ b/logprint/log_misc.c -@@ -745,9 +745,9 @@ time64_t - xlog_extract_dinode_ts( - const xfs_ictimestamp_t its) - { -- struct xfs_legacy_ictimestamp *lits; -+ struct xfs_log_legacy_timestamp *lits; - -- lits = (struct xfs_legacy_ictimestamp *)&its; -+ lits = (struct xfs_log_legacy_timestamp *)&its; - return (time64_t)lits->t_sec; - } - --- -2.31.1 - diff --git a/xfsprogs-5.13.0-xfs-rename-xfs_ictimestamp_t.patch b/xfsprogs-5.13.0-xfs-rename-xfs_ictimestamp_t.patch deleted file mode 100644 index b02c037bc7d71ccbc8b10286057a989a3bed29eb..0000000000000000000000000000000000000000 --- a/xfsprogs-5.13.0-xfs-rename-xfs_ictimestamp_t.patch +++ /dev/null @@ -1,84 +0,0 @@ -From 6bdc300abe56ae82ebd640b2b26c696032045d82 Mon Sep 17 00:00:00 2001 -From: Christoph Hellwig -Date: Wed, 30 Jun 2021 18:38:58 -0400 -Subject: [PATCH 7/9] xfs: rename xfs_ictimestamp_t - -Source kernel commit: 6fc277c7c935c7e1fdee23e82da988d9d3cb6bef - -Rename xfs_ictimestamp_t to xfs_log_timestamp_t as it is a type used -for logging timestamps with no relationship to the in-core inode. - -Signed-off-by: Christoph Hellwig -Reviewed-by: Darrick J. Wong -Signed-off-by: Darrick J. Wong -Signed-off-by: Eric Sandeen ---- - libxfs/xfs_log_format.h | 10 +++++----- - logprint/log_misc.c | 2 +- - logprint/logprint.h | 2 +- - 3 files changed, 7 insertions(+), 7 deletions(-) - -diff --git a/libxfs/xfs_log_format.h b/libxfs/xfs_log_format.h -index 101b9730..3e15ea29 100644 ---- a/libxfs/xfs_log_format.h -+++ b/libxfs/xfs_log_format.h -@@ -368,7 +368,7 @@ static inline int xfs_ilog_fdata(int w) - * directly mirrors the xfs_dinode structure as it must contain all the same - * information. - */ --typedef uint64_t xfs_ictimestamp_t; -+typedef uint64_t xfs_log_timestamp_t; - - /* Legacy timestamp encoding format. */ - struct xfs_log_legacy_timestamp { -@@ -393,9 +393,9 @@ struct xfs_log_dinode { - uint16_t di_projid_hi; /* higher part of owner's project id */ - uint8_t di_pad[6]; /* unused, zeroed space */ - uint16_t di_flushiter; /* incremented on flush */ -- xfs_ictimestamp_t di_atime; /* time last accessed */ -- xfs_ictimestamp_t di_mtime; /* time last modified */ -- xfs_ictimestamp_t di_ctime; /* time created/inode modified */ -+ xfs_log_timestamp_t di_atime; /* time last accessed */ -+ xfs_log_timestamp_t di_mtime; /* time last modified */ -+ xfs_log_timestamp_t di_ctime; /* time created/inode modified */ - xfs_fsize_t di_size; /* number of bytes in file */ - xfs_rfsblock_t di_nblocks; /* # of direct & btree blocks used */ - xfs_extlen_t di_extsize; /* basic/minimum extent size for file */ -@@ -420,7 +420,7 @@ struct xfs_log_dinode { - uint8_t di_pad2[12]; /* more padding for future expansion */ - - /* fields only written to during inode creation */ -- xfs_ictimestamp_t di_crtime; /* time created */ -+ xfs_log_timestamp_t di_crtime; /* time created */ - xfs_ino_t di_ino; /* inode number */ - uuid_t di_uuid; /* UUID of the filesystem */ - -diff --git a/logprint/log_misc.c b/logprint/log_misc.c -index 5a145f94..35e926a3 100644 ---- a/logprint/log_misc.c -+++ b/logprint/log_misc.c -@@ -743,7 +743,7 @@ xlog_print_trans_icreate( - - time64_t - xlog_extract_dinode_ts( -- const xfs_ictimestamp_t its) -+ const xfs_log_timestamp_t its) - { - struct xfs_log_legacy_timestamp *lits; - -diff --git a/logprint/logprint.h b/logprint/logprint.h -index 248fe7bf..38a7d3fa 100644 ---- a/logprint/logprint.h -+++ b/logprint/logprint.h -@@ -18,7 +18,7 @@ extern int print_no_data; - extern int print_no_print; - - /* exports */ --extern time64_t xlog_extract_dinode_ts(const xfs_ictimestamp_t); -+extern time64_t xlog_extract_dinode_ts(const xfs_log_timestamp_t); - extern void xlog_print_lseek(struct xlog *, int, xfs_daddr_t, int); - - extern void xfs_log_copy(struct xlog *, int, char *); --- -2.31.1 - diff --git a/xfsprogs-5.18.0-mkfs-don-t-let-internal-logs-bump-the-root-dir-inode.patch b/xfsprogs-5.18.0-mkfs-don-t-let-internal-logs-bump-the-root-dir-inode.patch deleted file mode 100644 index 7725b60bf1b4dee17a71f70aaca5f0083c11ead0..0000000000000000000000000000000000000000 --- a/xfsprogs-5.18.0-mkfs-don-t-let-internal-logs-bump-the-root-dir-inode.patch +++ /dev/null @@ -1,105 +0,0 @@ -From fd421160515ed875f8221e52dfebebf06c1c4659 Mon Sep 17 00:00:00 2001 -From: "Darrick J. Wong" -Date: Fri, 11 Mar 2022 17:32:02 -0800 -Subject: [PATCH] mkfs: don't let internal logs bump the root dir inode chunk - to AG 1 - -Currently, we don't let an internal log consume every last block in an -AG. According to the comment, we're doing this to avoid tripping AGF -verifiers if freeblks==0, but on a modern filesystem this isn't -sufficient to avoid problems because we need to have enough space in the -AG to allocate an aligned root inode chunk, if it should be the case -that the log also ends up in AG 0: - -$ truncate -s 6366g /tmp/a ; mkfs.xfs -f /tmp/a -d agcount=3200 -l agnum=0 -meta-data=/tmp/a isize=512 agcount=3200, agsize=521503 blks - = sectsz=512 attr=2, projid32bit=1 - = crc=1 finobt=1, sparse=1, rmapbt=0 - = reflink=1 bigtime=0 inobtcount=0 -data = bsize=4096 blocks=1668808704, imaxpct=5 - = sunit=0 swidth=0 blks -naming =version 2 bsize=4096 ascii-ci=0, ftype=1 -log =internal log bsize=4096 blocks=521492, version=2 - = sectsz=512 sunit=0 blks, lazy-count=1 -realtime =none extsz=4096 blocks=0, rtextents=0 -mkfs.xfs: root inode created in AG 1, not AG 0 - -Therefore, modify the maximum internal log size calculation to constrain -the maximum internal log size so that the aligned inode chunk allocation -will always succeed. - -Signed-off-by: Darrick J. Wong -Reviewed-by: Christoph Hellwig -Signed-off-by: Ferry Meng -Reviewed-by: Joseph Qi ---- - mkfs/xfs_mkfs.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 47 insertions(+) - -diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c -index 64a19490..3c5b6f3c 100644 ---- a/mkfs/xfs_mkfs.c -+++ b/mkfs/xfs_mkfs.c -@@ -3241,6 +3241,49 @@ validate_log_size(uint64_t logblocks, int blocklog, int min_logblocks) - } - } - -+static void -+adjust_ag0_internal_logblocks( -+ struct mkfs_params *cfg, -+ struct xfs_mount *mp, -+ int min_logblocks, -+ int *max_logblocks) -+{ -+ int backoff = 0; -+ int ichunk_blocks; -+ -+ /* -+ * mkfs will trip over the write verifiers if the log is allocated in -+ * AG 0 and consumes enough space that we cannot allocate a non-sparse -+ * inode chunk for the root directory. The inode allocator requires -+ * that the AG have enough free space for the chunk itself plus enough -+ * to fix up the freelist with aligned blocks if we need to fill the -+ * allocation from the AGFL. -+ */ -+ ichunk_blocks = XFS_INODES_PER_CHUNK * cfg->inodesize >> cfg->blocklog; -+ backoff = ichunk_blocks * 4; -+ -+ /* -+ * We try to align inode allocations to the data device stripe unit, -+ * so ensure there's enough space to perform an aligned allocation. -+ * The inode geometry structure isn't set up yet, so compute this by -+ * hand. -+ */ -+ backoff = max(backoff, cfg->dsunit * 2); -+ -+ *max_logblocks -= backoff; -+ -+ /* If the specified log size is too big, complain. */ -+ if (cli_opt_set(&lopts, L_SIZE) && cfg->logblocks > *max_logblocks) { -+ fprintf(stderr, -+_("internal log size %lld too large, must be less than %d\n"), -+ (long long)cfg->logblocks, -+ *max_logblocks); -+ usage(); -+ } -+ -+ cfg->logblocks = min(cfg->logblocks, *max_logblocks); -+} -+ - static void - calculate_log_size( - struct mkfs_params *cfg, -@@ -3364,6 +3407,10 @@ _("log ag number %lld too large, must be less than %lld\n"), - } else - cfg->logagno = (xfs_agnumber_t)(sbp->sb_agcount / 2); - -+ if (cfg->logagno == 0) -+ adjust_ag0_internal_logblocks(cfg, mp, min_logblocks, -+ &max_logblocks); -+ - cfg->logstart = XFS_AGB_TO_FSB(mp, cfg->logagno, - libxfs_prealloc_blocks(mp)); - --- -2.19.1.6.gb485710b diff --git a/xfsprogs-5.18.0-mkfs-don-t-trample-the-gid-set-in-the-protofile.patch b/xfsprogs-5.18.0-mkfs-don-t-trample-the-gid-set-in-the-protofile.patch deleted file mode 100644 index bc1ce723cb13223e05030c71f8addf0412794485..0000000000000000000000000000000000000000 --- a/xfsprogs-5.18.0-mkfs-don-t-trample-the-gid-set-in-the-protofile.patch +++ /dev/null @@ -1,87 +0,0 @@ -From d83d6254548ef26fec8b4605d67161a467d8e779 Mon Sep 17 00:00:00 2001 -From: "Darrick J. Wong" -Date: Tue, 17 May 2022 22:48:13 -0400 -Subject: [PATCH 8/9] mkfs: don't trample the gid set in the protofile - -Catherine's recent changes to xfs/019 exposed a bug in how libxfs -handles setgid bits. mkfs reads the desired gid in from the protofile, -but if the parent directory is setgid, it will override the user's -setting and (re)set the child's gid to the parent's gid. Overriding -user settings is (probably) not the desired mode of operation, so create -a flag to struct cred to force the gid in the protofile. - -It looks like this has been broken since ~2005. - -Cc: Catherine Hoang -Fixes: 9f064b7e ("Provide mkfs options to easily exercise all inheritable attributes, esp. the extsize allocator hint. Merge of master-melb:xfs-cmds:24370a by kenmcd.") -Signed-off-by: Darrick J. Wong -Reviewed-by: Catherine Hoang -Reviewed-by: Christoph Hellwig -Reviewed-by: Christoph Hellwig -Signed-off-by: Eric Sandeen ---- - include/xfs_inode.h | 11 +++++++---- - libxfs/util.c | 3 ++- - mkfs/proto.c | 3 ++- - 3 files changed, 11 insertions(+), 6 deletions(-) - -diff --git a/include/xfs_inode.h b/include/xfs_inode.h -index 742aebc8..506567e5 100644 ---- a/include/xfs_inode.h -+++ b/include/xfs_inode.h -@@ -151,10 +151,13 @@ static inline bool xfs_inode_has_bigtime(struct xfs_inode *ip) - return ip->i_d.di_flags2 & XFS_DIFLAG2_BIGTIME; - } - --typedef struct cred { -- uid_t cr_uid; -- gid_t cr_gid; --} cred_t; -+/* Always set the child's GID to this value, even if the parent is setgid. */ -+#define CRED_FORCE_GID (1U << 0) -+struct cred { -+ uid_t cr_uid; -+ gid_t cr_gid; -+ unsigned int cr_flags; -+}; - - extern int libxfs_inode_alloc (struct xfs_trans **, struct xfs_inode *, - mode_t, nlink_t, xfs_dev_t, struct cred *, -diff --git a/libxfs/util.c b/libxfs/util.c -index e63a5642..d151c514 100644 ---- a/libxfs/util.c -+++ b/libxfs/util.c -@@ -291,7 +291,8 @@ libxfs_ialloc( - xfs_trans_ichgtime(tp, ip, XFS_ICHGTIME_CHG | XFS_ICHGTIME_MOD); - - if (pip && (VFS_I(pip)->i_mode & S_ISGID)) { -- VFS_I(ip)->i_gid = VFS_I(pip)->i_gid; -+ if (!(cr->cr_flags & CRED_FORCE_GID)) -+ VFS_I(ip)->i_gid = VFS_I(pip)->i_gid; - if ((VFS_I(pip)->i_mode & S_ISGID) && (mode & S_IFMT) == S_IFDIR) - VFS_I(ip)->i_mode |= S_ISGID; - } -diff --git a/mkfs/proto.c b/mkfs/proto.c -index 0fa6ffb0..85e4bb3b 100644 ---- a/mkfs/proto.c -+++ b/mkfs/proto.c -@@ -377,7 +377,7 @@ parseproto( - xfs_trans_t *tp; - int val; - int isroot = 0; -- cred_t creds; -+ struct cred creds; - char *value; - struct xfs_name xname; - -@@ -445,6 +445,7 @@ parseproto( - mode |= val; - creds.cr_uid = (int)getnum(getstr(pp), 0, 0, false); - creds.cr_gid = (int)getnum(getstr(pp), 0, 0, false); -+ creds.cr_flags = CRED_FORCE_GID; - xname.name = (unsigned char *)name; - xname.len = name ? strlen(name) : 0; - xname.type = 0; --- -2.31.1 - diff --git a/xfsprogs-5.18.0-mkfs-fix-missing-validation-of-l-size-against-maximu.patch b/xfsprogs-5.18.0-mkfs-fix-missing-validation-of-l-size-against-maximu.patch deleted file mode 100644 index b5ec33fdb15fed34f059d646df5b7c7334ac657c..0000000000000000000000000000000000000000 --- a/xfsprogs-5.18.0-mkfs-fix-missing-validation-of-l-size-against-maximu.patch +++ /dev/null @@ -1,91 +0,0 @@ -From 5e779a76d0a627b4e8e7c897d8ee31d7699b2ce7 Mon Sep 17 00:00:00 2001 -From: "Darrick J. Wong" -Date: Mon, 4 Apr 2022 11:29:34 -0700 -Subject: [PATCH] mkfs: fix missing validation of -l size against maximum - internal log size - -If a sysadmin specifies a log size explicitly, we don't actually check -that against the maximum internal log size that we compute for the -default log size computation. We're going to add more validation soon, -so refactor the max internal log blocks into a common variable and -add a check. - -Signed-off-by: Darrick J. Wong -Reviewed-by: Christoph Hellwig -Signed-off-by: Ferry Meng -Reviewed-by: Joseph Qi ---- - mkfs/xfs_mkfs.c | 36 ++++++++++++++++++++++-------------- - 1 file changed, 22 insertions(+), 14 deletions(-) - -diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c -index 0581843f..8c94bdf8 100644 ---- a/mkfs/xfs_mkfs.c -+++ b/mkfs/xfs_mkfs.c -@@ -3246,6 +3246,7 @@ calculate_log_size( - { - struct xfs_sb *sbp = &mp->m_sb; - int min_logblocks; -+ int max_logblocks; /* absolute max for this AG */ - struct xfs_mount mount; - - /* we need a temporary mount to calculate the minimum log size. */ -@@ -3285,6 +3286,18 @@ _("external log device size %lld blocks too small, must be at least %lld blocks\ - return; - } - -+ /* -+ * Make sure the log fits wholly within an AG -+ * -+ * XXX: If agf->freeblks ends up as 0 because the log uses all -+ * the free space, it causes the kernel all sorts of problems -+ * with per-ag reservations. Right now just back it off one -+ * block, but there's a whole can of worms here that needs to be -+ * opened to decide what is the valid maximum size of a log in -+ * an AG. -+ */ -+ max_logblocks = libxfs_alloc_ag_max_usable(mp) - 1; -+ - /* internal log - if no size specified, calculate automatically */ - if (!cfg->logblocks) { - if (cfg->dblocks < GIGABYTES(1, cfg->blocklog)) { -@@ -3310,21 +3323,9 @@ _("external log device size %lld blocks too small, must be at least %lld blocks\ - cfg->logblocks = cfg->logblocks >> cfg->blocklog; - } - -- /* Ensure the chosen size meets minimum log size requirements */ -+ /* Ensure the chosen size fits within log size requirements */ - cfg->logblocks = max(min_logblocks, cfg->logblocks); -- -- /* -- * Make sure the log fits wholly within an AG -- * -- * XXX: If agf->freeblks ends up as 0 because the log uses all -- * the free space, it causes the kernel all sorts of problems -- * with per-ag reservations. Right now just back it off one -- * block, but there's a whole can of worms here that needs to be -- * opened to decide what is the valid maximum size of a log in -- * an AG. -- */ -- cfg->logblocks = min(cfg->logblocks, -- libxfs_alloc_ag_max_usable(mp) - 1); -+ cfg->logblocks = min(cfg->logblocks, max_logblocks); - - /* and now clamp the size to the maximum supported size */ - cfg->logblocks = min(cfg->logblocks, XFS_MAX_LOG_BLOCKS); -@@ -3332,6 +3333,13 @@ _("external log device size %lld blocks too small, must be at least %lld blocks\ - cfg->logblocks = XFS_MAX_LOG_BYTES >> cfg->blocklog; - - validate_log_size(cfg->logblocks, cfg->blocklog, min_logblocks); -+ } else if (cfg->logblocks > max_logblocks) { -+ /* check specified log size */ -+ fprintf(stderr, -+_("internal log size %lld too large, must be less than %d\n"), -+ (long long)cfg->logblocks, -+ max_logblocks); -+ usage(); - } - - if (cfg->logblocks > sbp->sb_agblocks - libxfs_prealloc_blocks(mp)) { --- -2.19.1.6.gb485710b diff --git a/xfsprogs-5.18.0-mkfs-improve-log-extent-validation.patch b/xfsprogs-5.18.0-mkfs-improve-log-extent-validation.patch deleted file mode 100644 index 1adbbf4e592ad06bcbede10324712ded632d4789..0000000000000000000000000000000000000000 --- a/xfsprogs-5.18.0-mkfs-improve-log-extent-validation.patch +++ /dev/null @@ -1,72 +0,0 @@ -From 7374106f0474657636ab061dd68cd6bacfdd2baf Mon Sep 17 00:00:00 2001 -From: "Darrick J. Wong" -Date: Thu, 14 Apr 2022 13:29:37 -0700 -Subject: [PATCH] mkfs: improve log extent validation - -Use the standard libxfs fsblock verifiers to check the start and end of -the internal log. The current code does not catch the case of a -(segmented) fsblock that is beyond agf_blocks but not so large to change -the agno part of the segmented fsblock. - -Signed-off-by: Darrick J. Wong -Reviewed-by: Christoph Hellwig -Signed-off-by: Ferry Meng ---- - libxfs/libxfs_api_defs.h | 1 + - mkfs/xfs_mkfs.c | 10 ++++------ - 2 files changed, 5 insertions(+), 6 deletions(-) - -diff --git a/libxfs/libxfs_api_defs.h b/libxfs/libxfs_api_defs.h -index 9492955d..a0cb756a 100644 ---- a/libxfs/libxfs_api_defs.h -+++ b/libxfs/libxfs_api_defs.h -@@ -195,6 +195,7 @@ - #define xfs_verify_agino libxfs_verify_agino - #define xfs_verify_cksum libxfs_verify_cksum - #define xfs_verify_dir_ino libxfs_verify_dir_ino -+#define xfs_verify_fsbext libxfs_verify_fsbext - #define xfs_verify_fsbno libxfs_verify_fsbno - #define xfs_verify_ino libxfs_verify_ino - #define xfs_verify_rtbno libxfs_verify_rtbno -diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c -index 3c5b6f3c..370c0dcb 100644 ---- a/mkfs/xfs_mkfs.c -+++ b/mkfs/xfs_mkfs.c -@@ -3189,15 +3189,13 @@ align_internal_log( - int sunit, - int max_logblocks) - { -- uint64_t logend; -- - /* round up log start if necessary */ - if ((cfg->logstart % sunit) != 0) - cfg->logstart = ((cfg->logstart + (sunit - 1)) / sunit) * sunit; - - /* If our log start overlaps the next AG's metadata, fail. */ -- if (XFS_FSB_TO_AGBNO(mp, cfg->logstart) <= XFS_AGFL_BLOCK(mp)) { -- fprintf(stderr, -+ if (!libxfs_verify_fsbno(mp, cfg->logstart)) { -+ fprintf(stderr, - _("Due to stripe alignment, the internal log start (%lld) cannot be aligned\n" - "within an allocation group.\n"), - (long long) cfg->logstart); -@@ -3208,8 +3206,7 @@ _("Due to stripe alignment, the internal log start (%lld) cannot be aligned\n" - align_log_size(cfg, sunit, max_logblocks); - - /* check the aligned log still starts and ends in the same AG. */ -- logend = cfg->logstart + cfg->logblocks - 1; -- if (XFS_FSB_TO_AGNO(mp, cfg->logstart) != XFS_FSB_TO_AGNO(mp, logend)) { -+ if (!libxfs_verify_fsbext(mp, cfg->logstart, cfg->logblocks)) { - fprintf(stderr, - _("Due to stripe alignment, the internal log size (%lld) is too large.\n" - "Must fit within an allocation group.\n"), -@@ -3447,6 +3444,7 @@ start_superblock_setup( - sbp->sb_agblocks = (xfs_agblock_t)cfg->agsize; - sbp->sb_agblklog = (uint8_t)log2_roundup(cfg->agsize); - sbp->sb_agcount = (xfs_agnumber_t)cfg->agcount; -+ sbp->sb_dblocks = (xfs_rfsblock_t)cfg->dblocks; - - sbp->sb_inodesize = (uint16_t)cfg->inodesize; - sbp->sb_inodelog = (uint8_t)cfg->inodelog; --- -2.19.1.6.gb485710b diff --git a/xfsprogs-5.18.0-mkfs-reduce-internal-log-size-when-log-stripe-units-.patch b/xfsprogs-5.18.0-mkfs-reduce-internal-log-size-when-log-stripe-units-.patch deleted file mode 100644 index ade3b36bc801cc4043c4e9a9a2377a274d5b805c..0000000000000000000000000000000000000000 --- a/xfsprogs-5.18.0-mkfs-reduce-internal-log-size-when-log-stripe-units-.patch +++ /dev/null @@ -1,107 +0,0 @@ -From 4f977d3a3480dc301b72cf8c44861e4a3a5bd118 Mon Sep 17 00:00:00 2001 -From: "Darrick J. Wong" -Date: Mon, 4 Apr 2022 10:10:24 -0700 -Subject: [PATCH] mkfs: reduce internal log size when log stripe units are in - play - -Currently, one can feed mkfs a combination of options like this: - -$ truncate -s 6366g /tmp/a ; mkfs.xfs -f /tmp/a -d agcount=3200 -d su=256k,sw=4 -meta-data=/tmp/a isize=512 agcount=3200, agsize=521536 blks - = sectsz=512 attr=2, projid32bit=1 - = crc=1 finobt=1, sparse=1, rmapbt=0 - = reflink=1 bigtime=0 inobtcount=0 -data = bsize=4096 blocks=1668808704, imaxpct=5 - = sunit=64 swidth=256 blks -naming =version 2 bsize=4096 ascii-ci=0, ftype=1 -log =internal log bsize=4096 blocks=521536, version=2 - = sectsz=512 sunit=64 blks, lazy-count=1 -realtime =none extsz=4096 blocks=0, rtextents=0 -Metadata corruption detected at 0x55e88052c6b6, xfs_agf block 0x1/0x200 -libxfs_bwrite: write verifier failed on xfs_agf bno 0x1/0x1 -mkfs.xfs: writing AG headers failed, err=117 - -The format fails because the internal log size sizing algorithm -specifies a log size of 521492 blocks to avoid taking all the space in -the AG, but align_log_size sees the stripe unit and rounds that up to -the next stripe unit, which is 521536 blocks. - -Fix this problem by rounding the log size down if rounding up would -result in a log that consumes more space in the AG than we allow. - -Signed-off-by: Darrick J. Wong -Reviewed-by: Christoph Hellwig -Signed-off-by: Ferry Meng ---- - mkfs/xfs_mkfs.c | 19 +++++++++++-------- - 1 file changed, 11 insertions(+), 8 deletions(-) - -diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c -index 8c94bdf8..64a19490 100644 ---- a/mkfs/xfs_mkfs.c -+++ b/mkfs/xfs_mkfs.c -@@ -3151,9 +3151,10 @@ sb_set_features( - static void - align_log_size( - struct mkfs_params *cfg, -- int sunit) -+ int sunit, -+ int max_logblocks) - { -- uint64_t tmp_logblocks; -+ uint64_t tmp_logblocks; - - /* nothing to do if it's already aligned. */ - if ((cfg->logblocks % sunit) == 0) -@@ -3170,7 +3171,8 @@ _("log size %lld is not a multiple of the log stripe unit %d\n"), - - /* If the log is too large, round down instead of round up */ - if ((tmp_logblocks > XFS_MAX_LOG_BLOCKS) || -- ((tmp_logblocks << cfg->blocklog) > XFS_MAX_LOG_BYTES)) { -+ ((tmp_logblocks << cfg->blocklog) > XFS_MAX_LOG_BYTES) || -+ tmp_logblocks > max_logblocks) { - tmp_logblocks = (cfg->logblocks / sunit) * sunit; - } - cfg->logblocks = tmp_logblocks; -@@ -3184,7 +3186,8 @@ static void - align_internal_log( - struct mkfs_params *cfg, - struct xfs_mount *mp, -- int sunit) -+ int sunit, -+ int max_logblocks) - { - uint64_t logend; - -@@ -3202,7 +3205,7 @@ _("Due to stripe alignment, the internal log start (%lld) cannot be aligned\n" - } - - /* round up/down the log size now */ -- align_log_size(cfg, sunit); -+ align_log_size(cfg, sunit, max_logblocks); - - /* check the aligned log still starts and ends in the same AG. */ - logend = cfg->logstart + cfg->logblocks - 1; -@@ -3280,7 +3283,7 @@ _("external log device size %lld blocks too small, must be at least %lld blocks\ - cfg->logstart = 0; - cfg->logagno = 0; - if (cfg->lsunit) -- align_log_size(cfg, cfg->lsunit); -+ align_log_size(cfg, cfg->lsunit, XFS_MAX_LOG_BLOCKS); - - validate_log_size(cfg->logblocks, cfg->blocklog, min_logblocks); - return; -@@ -3368,9 +3371,9 @@ _("log ag number %lld too large, must be less than %lld\n"), - * Align the logstart at stripe unit boundary. - */ - if (cfg->lsunit) { -- align_internal_log(cfg, mp, cfg->lsunit); -+ align_internal_log(cfg, mp, cfg->lsunit, max_logblocks); - } else if (cfg->dsunit) { -- align_internal_log(cfg, mp, cfg->dsunit); -+ align_internal_log(cfg, mp, cfg->dsunit, max_logblocks); - } - validate_log_size(cfg->logblocks, cfg->blocklog, min_logblocks); - } --- -2.19.1.6.gb485710b diff --git a/xfsprogs-5.18.0-mkfs-round-log-size-down-if-rounding-log-start-up-ca.patch b/xfsprogs-5.18.0-mkfs-round-log-size-down-if-rounding-log-start-up-ca.patch deleted file mode 100644 index a48ff35a93239d1d7bdbde57d91943a4f10d1e2a..0000000000000000000000000000000000000000 --- a/xfsprogs-5.18.0-mkfs-round-log-size-down-if-rounding-log-start-up-ca.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 75421026425013a5601c899d2aca89d180853111 Mon Sep 17 00:00:00 2001 -From: "Darrick J. Wong" -Date: Thu, 14 Apr 2022 13:32:32 -0700 -Subject: [PATCH] mkfs: round log size down if rounding log start up causes - overflow - -If rounding the log start up to the next stripe unit would cause the log -to overrun the end of the AG, round the log size down by a stripe unit. -We already ensured that logblocks was small enough to fit inside the AG, -so the minor adjustment should suffice. - -This can be reproduced with: -mkfs.xfs -dsu=44k,sw=1,size=300m,file,name=fsfile -m rmapbt=0 -and: -mkfs.xfs -dsu=48k,sw=1,size=512m,file,name=fsfile -m rmapbt=0 - -Reported-by: Eric Sandeen -Signed-off-by: Darrick J. Wong -Reviewed-by: Christoph Hellwig -Signed-off-by: Ferry Meng ---- - mkfs/xfs_mkfs.c | 9 +++++++++ - 1 file changed, 9 insertions(+) - -diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c -index 370c0dcb..beeb70f3 100644 ---- a/mkfs/xfs_mkfs.c -+++ b/mkfs/xfs_mkfs.c -@@ -3205,6 +3205,15 @@ _("Due to stripe alignment, the internal log start (%lld) cannot be aligned\n" - /* round up/down the log size now */ - align_log_size(cfg, sunit, max_logblocks); - -+ /* -+ * If the end of the log has been rounded past the end of the AG, -+ * reduce logblocks by a stripe unit to try to get it back under EOAG. -+ */ -+ if (!libxfs_verify_fsbext(mp, cfg->logstart, cfg->logblocks) && -+ cfg->logblocks > sunit) { -+ cfg->logblocks -= sunit; -+ } -+ - /* check the aligned log still starts and ends in the same AG. */ - if (!libxfs_verify_fsbext(mp, cfg->logstart, cfg->logblocks)) { - fprintf(stderr, --- -2.19.1.6.gb485710b diff --git a/xfsprogs-5.19.0-mkfs-terminate-getsubopt-arrays-properly.patch b/xfsprogs-5.19.0-mkfs-terminate-getsubopt-arrays-properly.patch deleted file mode 100644 index e7a9e519691fdab4177b893613ca5ad771db3610..0000000000000000000000000000000000000000 --- a/xfsprogs-5.19.0-mkfs-terminate-getsubopt-arrays-properly.patch +++ /dev/null @@ -1,120 +0,0 @@ -From 4d6cd5c34b713465463ecb36455864d158a362ac Mon Sep 17 00:00:00 2001 -From: "Darrick J. Wong" -Date: Wed, 13 Jul 2022 20:58:28 -0500 -Subject: [PATCH] mkfs: terminate getsubopt arrays properly - -Having not drank any (or maybe too much) coffee this morning, I typed: - -$ mkfs.xfs -d agcount=3 -d nrext64=0 -Segmentation fault - -I traced this down to getsubopt walking off the end of the dopts.subopts -array. The manpage says you're supposed to terminate the suboptions -string array with a NULL entry, but the structure definition uses -MAX_SUBOPTS/D_MAX_OPTS directly, which means there is no terminator. - -Explicitly terminate each suboption array with a NULL entry after -making room for it. - -Signed-off-by: Darrick J. Wong -[sandeen: explicitly add NULL terminators & clarify comment] -Reviewed-by: Eric Sandeen -Signed-off-by: Eric Sandeen -Signed-off-by: Ferry Meng -Reviewed-by: Joseph Qi ---- - mkfs/xfs_mkfs.c | 16 ++++++++++++++-- - 1 file changed, 14 insertions(+), 2 deletions(-) - -diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c -index beeb70f3..ecd13fca 100644 ---- a/mkfs/xfs_mkfs.c -+++ b/mkfs/xfs_mkfs.c -@@ -130,8 +130,11 @@ enum { - M_MAX_OPTS, - }; - --/* Just define the max options array size manually right now */ --#define MAX_SUBOPTS D_MAX_OPTS -+/* -+ * Just define the max options array size manually to the largest -+ * enum right now, leaving room for a NULL terminator at the end -+ */ -+#define MAX_SUBOPTS (D_MAX_OPTS + 1) - - #define SUBOPT_NEEDS_VAL (-1LL) - #define MAX_CONFLICTS 8 -@@ -241,6 +244,7 @@ static struct opt_params bopts = { - .ini_section = "block", - .subopts = { - [B_SIZE] = "size", -+ [B_MAX_OPTS] = NULL, - }, - .subopt_params = { - { .index = B_SIZE, -@@ -267,6 +271,7 @@ static struct opt_params copts = { - .name = 'c', - .subopts = { - [C_OPTFILE] = "options", -+ [C_MAX_OPTS] = NULL, - }, - .subopt_params = { - { .index = C_OPTFILE, -@@ -296,6 +301,7 @@ static struct opt_params dopts = { - [D_EXTSZINHERIT] = "extszinherit", - [D_COWEXTSIZE] = "cowextsize", - [D_DAXINHERIT] = "daxinherit", -+ [D_MAX_OPTS] = NULL, - }, - .subopt_params = { - { .index = D_AGCOUNT, -@@ -432,6 +438,7 @@ static struct opt_params iopts = { - [I_ATTR] = "attr", - [I_PROJID32BIT] = "projid32bit", - [I_SPINODES] = "sparse", -+ [I_MAX_OPTS] = NULL, - }, - .subopt_params = { - { .index = I_ALIGN, -@@ -498,6 +505,7 @@ static struct opt_params lopts = { - [L_FILE] = "file", - [L_NAME] = "name", - [L_LAZYSBCNTR] = "lazy-count", -+ [L_MAX_OPTS] = NULL, - }, - .subopt_params = { - { .index = L_AGNUM, -@@ -590,6 +598,7 @@ static struct opt_params nopts = { - [N_SIZE] = "size", - [N_VERSION] = "version", - [N_FTYPE] = "ftype", -+ [N_MAX_OPTS] = NULL, - }, - .subopt_params = { - { .index = N_SIZE, -@@ -625,6 +634,7 @@ static struct opt_params ropts = { - [R_FILE] = "file", - [R_NAME] = "name", - [R_NOALIGN] = "noalign", -+ [R_MAX_OPTS] = NULL, - }, - .subopt_params = { - { .index = R_EXTSIZE, -@@ -672,6 +682,7 @@ static struct opt_params sopts = { - .subopts = { - [S_SIZE] = "size", - [S_SECTSIZE] = "sectsize", -+ [S_MAX_OPTS] = NULL, - }, - .subopt_params = { - { .index = S_SIZE, -@@ -708,6 +719,7 @@ static struct opt_params mopts = { - [M_REFLINK] = "reflink", - [M_INOBTCNT] = "inobtcount", - [M_BIGTIME] = "bigtime", -+ [M_MAX_OPTS] = NULL, - }, - .subopt_params = { - { .index = M_CRC, --- -2.19.1.6.gb485710b diff --git a/xfsprogs-5.19.0-xfs_repair-ignore-empty-xattr-leaf-blocks.patch b/xfsprogs-5.19.0-xfs_repair-ignore-empty-xattr-leaf-blocks.patch deleted file mode 100644 index 5146f7c0ccf2ab8a9c29b3f564651ae581f14d1b..0000000000000000000000000000000000000000 --- a/xfsprogs-5.19.0-xfs_repair-ignore-empty-xattr-leaf-blocks.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 768a8c511e1f2e43a5da7fe9e3ccf75aec836178 Mon Sep 17 00:00:00 2001 -From: "Darrick J. Wong" -Date: Wed, 13 Jul 2022 20:58:25 -0500 -Subject: [PATCH] xfs_repair: ignore empty xattr leaf blocks - -As detailed in the commit: - -5e572d1a xfs: empty xattr leaf header blocks are not corruption - -empty xattr leaf blocks can be the benign byproduct of the system -going down during the multi-step process of adding a large xattr -to a file that has no xattrs. If we find one at attr fork offset 0, -we should clear it, but this isn't a corruption. - -Signed-off-by: Darrick J. Wong -Reviewed-by: Dave Chinner -Signed-off-by: Eric Sandeen -Signed-off-by: Ferry Meng -Reviewed-by: Joseph Qi ---- - repair/attr_repair.c | 20 ++++++++++++++++++++ - 1 file changed, 20 insertions(+) - -diff --git a/repair/attr_repair.c b/repair/attr_repair.c -index ba39c2b5..090b5cae 100644 ---- a/repair/attr_repair.c -+++ b/repair/attr_repair.c -@@ -579,6 +579,26 @@ process_leaf_attr_block( - firstb = mp->m_sb.sb_blocksize; - stop = xfs_attr3_leaf_hdr_size(leaf); - -+ /* -+ * Empty leaf blocks at offset zero can occur as a race between -+ * setxattr and the system going down, so we only take action if we're -+ * running in modify mode. See xfs_attr3_leaf_verify for details of -+ * how we've screwed this up many times. -+ */ -+ if (!leafhdr.count && da_bno == 0) { -+ if (no_modify) { -+ do_log( -+ _("would clear empty leaf attr block 0, inode %" PRIu64 "\n"), -+ ino); -+ return 0; -+ } -+ -+ do_warn( -+ _("will clear empty leaf attr block 0, inode %" PRIu64 "\n"), -+ ino); -+ return 1; -+ } -+ - /* does the count look sorta valid? */ - if (!leafhdr.count || - leafhdr.count * sizeof(xfs_attr_leaf_entry_t) + stop > --- -2.19.1.6.gb485710b diff --git a/xfsprogs-6.6.0.tar.xz b/xfsprogs-6.6.0.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..eda213bc8c132acd98c8818bff6e07c837ec3f53 Binary files /dev/null and b/xfsprogs-6.6.0.tar.xz differ diff --git a/xfsprogs.spec b/xfsprogs.spec index 4d004e439820b3e4b6f96a982ba21dc086bdd73b..5299095ff763f3952cbeab15e11e19c95491e825 100644 --- a/xfsprogs.spec +++ b/xfsprogs.spec @@ -1,7 +1,8 @@ -%define anolis_release 2 +%define anolis_release 1 +%define lib_dir /usr/lib Name: xfsprogs -Version: 5.10.0 +Version: 6.6.0 Release: %{anolis_release}%{?dist} Summary: Userspace utilities that manage XFS filesystems @@ -21,6 +22,7 @@ BuildRequires: libicu BuildRequires: lvm2-devel BuildRequires: xz BuildRequires: inih-devel +BuildRequires: userspace-rcu-devel Provides: xfs-cmds Provides: xfsprogs-qa-devel Suggests: xfsprogs-xfs_scrub @@ -28,23 +30,6 @@ Obsoletes: xfs-cmds <= %{version} Obsoletes: xfsprogs-qa-devel <= %{version} Conflicts: xfsdump < 3.0.1 -# backport patch from upstream -Patch01: xfsprogs-5.11.0-mkfs-fix-wrong-inobtcount-usage-error-output.patch -Patch02: xfsprogs-5.12.0-libxfs-copy-crtime-correctly-now-that-it-s-timespec6.patch -Patch03: xfsprogs-5.12.0-libxfs-expose-inobtcount-in-xfs-geometry.patch -Patch04: xfsprogs-5.12.0-libfrog-report-inobtcount-in-geometry.patch -Patch05: xfsprogs-5.13.0-xfs-remove-the-unused-xfs_icdinode_has_bigtime-helpe.patch -Patch06: xfsprogs-5.13.0-xfs-rename-struct-xfs_legacy_ictimestamp.patch -Patch07: xfsprogs-5.13.0-xfs-rename-xfs_ictimestamp_t.patch -Patch08: xfsprogs-5.18.0-mkfs-don-t-trample-the-gid-set-in-the-protofile.patch -Patch09: xfsprogs-5.11.0-xfs-refactor-data-device-extent-validation.patch -Patch10: xfsprogs-5.18.0-mkfs-fix-missing-validation-of-l-size-against-maximu.patch -Patch11: xfsprogs-5.18.0-mkfs-reduce-internal-log-size-when-log-stripe-units-.patch -Patch12: xfsprogs-5.18.0-mkfs-don-t-let-internal-logs-bump-the-root-dir-inode.patch -Patch13: xfsprogs-5.18.0-mkfs-improve-log-extent-validation.patch -Patch14: xfsprogs-5.18.0-mkfs-round-log-size-down-if-rounding-log-start-up-ca.patch -Patch15: xfsprogs-5.19.0-mkfs-terminate-getsubopt-arrays-properly.patch -Patch16: xfsprogs-5.19.0-xfs_repair-ignore-empty-xattr-leaf-blocks.patch # Begin: Anolis customized patches Patch1001: 1001-xfsprogs-add-atomic-write-support.patch @@ -121,8 +106,6 @@ rm -rf %{buildroot}/%{abidir}/help %dir %{abidir} %{_libdir}/*.so.* %{abidir}/*.dump -%dir %{_usr}/%{_lib}/xfsprogs -%{_usr}/%{_lib}/xfsprogs/* %{_mandir}/man5/* %{_mandir}/man8/* %{_sbindir}/* @@ -130,18 +113,30 @@ rm -rf %{buildroot}/%{abidir}/help %{abidir}/*-option.list %exclude %{_sbindir}/xfs_scrub* %exclude %{_mandir}/man8/xfs_scrub* -%exclude %{_usr}/%{_lib}/xfsprogs/xfs_scrub* %exclude %{_mandir}/man8/xfs_scrub_all* %exclude %{_unitdir}/xfs_scrub* %exclude %{abidir}/xfs_scrub*-option.list +%{lib_dir}/udev/rules.d/64-xfs.rules +%{_libexecdir}/xfsprogs/xfs_scrub_fail +%dir %{_datadir}/xfsprogs +%dir %{_datadir}/xfsprogs/mkfs +%{_datadir}/xfsprogs/mkfs/dax_x86_64.conf +%{_datadir}/xfsprogs/mkfs/lts_4.19.conf +%{_datadir}/xfsprogs/mkfs/lts_5.10.conf +%{_datadir}/xfsprogs/mkfs/lts_5.15.conf +%{_datadir}/xfsprogs/mkfs/lts_5.4.conf +%{_datadir}/xfsprogs/mkfs/lts_6.1.conf +%{_datadir}/xfsprogs/mkfs/lts_6.6.conf +%{_datadir}/xfsprogs/xfs_scrub_all.cron +%exclude %{lib_dir}/.build-id/* + %files doc %doc doc/CHANGES README %files xfs_scrub %{_sbindir}/xfs_scrub* %{_mandir}/man8/xfs_scrub* -%{_usr}/%{_lib}/xfsprogs/xfs_scrub* %{_mandir}/man8/xfs_scrub_all* %{_unitdir}/xfs_scrub* %{abidir}/xfs_scrub*-option.list @@ -162,10 +157,12 @@ rm -rf %{buildroot}/%{abidir}/help %{_includedir}/xfs/xfs_da_format.h %{_includedir}/xfs/xfs_log_format.h %{_includedir}/xfs/xqm.h - %{_libdir}/*.so %changelog +* Wed Mar 13 2024 Yangxinyu - 6.6.0-1 +- update to 6.6.0 + * Tue May 16 2023 Ferry Meng - 5.10.0-2 - Add mkfs.xfs fixed patches from upstream - xfs_repair: ignore empty xattr leaf blocks