From b3da2b8fea22646abe0d49de003906c8ab47a4fb Mon Sep 17 00:00:00 2001 From: liuzhilin Date: Mon, 11 Dec 2023 15:31:54 +0800 Subject: [PATCH] update to xfsprogs-5.0.0-12 --- ...-validation-of-l-size-against-maximu.patch | 117 ++++++------ ...nternal-logs-bump-the-root-dir-inode.patch | 135 ++++++------- ....0-xfs_repair-fix-progress-reporting.patch | 177 ++++++++++++++++++ ...-terminate-getsubopt-arrays-properly.patch | 130 ++++++------- ...epair-ignore-empty-xattr-leaf-blocks.patch | 28 +-- ...an-s-default-value-for-sparse-option.patch | 28 +++ xfsprogs.spec | 82 ++++---- 7 files changed, 435 insertions(+), 262 deletions(-) create mode 100644 xfsprogs-5.10.0-xfs_repair-fix-progress-reporting.patch rename 1005-mkfs-terminate-getsubopt-arrays-properly.patch => xfsprogs-5.19.0-mkfs-terminate-getsubopt-arrays-properly.patch (47%) rename 1006-xfs_repair-ignore-empty-xattr-leaf-blocks.patch => xfsprogs-5.19.0-xfs_repair-ignore-empty-xattr-leaf-blocks.patch (71%) create mode 100644 xfsprogs-rhelonly-mkfs-fix-man-s-default-value-for-sparse-option.patch diff --git a/1007-mkfs-fix-missing-validation-of-l-size-against-maximu.patch b/1007-mkfs-fix-missing-validation-of-l-size-against-maximu.patch index 68260d2..e6b7f50 100644 --- a/1007-mkfs-fix-missing-validation-of-l-size-against-maximu.patch +++ b/1007-mkfs-fix-missing-validation-of-l-size-against-maximu.patch @@ -1,63 +1,51 @@ -From 65e52d802372dc59d64c719997a7cc05782934e9 Mon Sep 17 00:00:00 2001 -From: "Darrick J. Wong" -Date: Mon, 4 Apr 2022 11:29:34 -0700 -Subject: [PATCH 1007/1008] mkfs: fix missing validation of -l size against - maximum internal log size +From 8b68eabba9264fb25a49a00e9edae452dd2c6ddd Mon Sep 17 00:00:00 2001 +From: liuzhilin +Date: Mon, 11 Dec 2023 15:23:24 +0800 +Subject: [PATCH] mkfs-fix-missing-validation-of-l-size-against-maximu -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, 23 insertions(+), 13 deletions(-) + mkfs/xfs_mkfs.c | 35 ++++++++++++++++++++++------------- + 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c -index 37747698..c9130805 100644 +index 3774769..a64a918 100644 --- a/mkfs/xfs_mkfs.c +++ b/mkfs/xfs_mkfs.c @@ -3184,6 +3184,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. */ -@@ -3223,6 +3224,19 @@ _("external log device %lld too small, must be at least %lld blocks\n"), - return; - } - + 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. */ +@@ -3223,6 +3224,18 @@ _("external log device %lld too small, must be at least %lld blocks\n"), + 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; -+ ++ * 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)) { -@@ -3248,21 +3262,10 @@ _("external log device %lld too small, must be at least %lld blocks\n"), - cfg->logblocks = cfg->logblocks >> cfg->blocklog; - } - + /* internal log - if no size specified, calculate automatically */ + if (!cfg->logblocks) { + if (cfg->dblocks < GIGABYTES(1, cfg->blocklog)) { +@@ -3248,21 +3261,10 @@ _("external log device %lld too small, must be at least %lld blocks\n"), + 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); - + cfg->logblocks = max(min_logblocks, cfg->logblocks); + - /* - * Make sure the log fits wholly within an AG - * @@ -71,22 +59,23 @@ index 37747698..c9130805 100644 - 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); -@@ -3270,6 +3273,13 @@ _("external log device %lld too small, must be at least %lld blocks\n"), - cfg->logblocks = XFS_MAX_LOG_BYTES >> cfg->blocklog; - - validate_log_size(cfg->logblocks, cfg->blocklog, min_logblocks); + + /* and now clamp the size to the maximum supported size */ + cfg->logblocks = min(cfg->logblocks, XFS_MAX_LOG_BLOCKS); +@@ -3270,6 +3272,13 @@ _("external log device %lld too small, must be at least %lld blocks\n"), + 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, ++ /* 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(); - } ++ (long long)cfg->logblocks, ++ max_logblocks); ++ usage(); + } + + if (cfg->logblocks > sbp->sb_agblocks - libxfs_prealloc_blocks(mp)) { +-- +2.39.3 - if (cfg->logblocks > sbp->sb_agblocks - libxfs_prealloc_blocks(mp)) { --- -2.19.1.6.gb485710b diff --git a/1008-mkfs-don-t-let-internal-logs-bump-the-root-dir-inode.patch b/1008-mkfs-don-t-let-internal-logs-bump-the-root-dir-inode.patch index dcc2c3b..b5ec7f5 100644 --- a/1008-mkfs-don-t-let-internal-logs-bump-the-root-dir-inode.patch +++ b/1008-mkfs-don-t-let-internal-logs-bump-the-root-dir-inode.patch @@ -1,105 +1,76 @@ -From 92f6722af80cee37ddc5aca6955c5fd31ed81322 Mon Sep 17 00:00:00 2001 -From: "Darrick J. Wong" -Date: Fri, 11 Mar 2022 17:32:02 -0800 -Subject: [PATCH 1008/1008] mkfs: don't let internal logs bump the root dir - inode chunk to AG 1 +From 07608c4969ea5ee964ada6c22f692c7474ce555f Mon Sep 17 00:00:00 2001 +From: liuzhilin +Date: Mon, 11 Dec 2023 15:28:24 +0800 +Subject: [PATCH] mkfs-don-t-let-internal-logs-bump-the-root-dir-inode -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(+) + mkfs/xfs_mkfs.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 46 insertions(+) diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c -index c9130805..6d0109a8 100644 +index a64a918..6e645cc 100644 --- a/mkfs/xfs_mkfs.c +++ b/mkfs/xfs_mkfs.c @@ -3176,6 +3176,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) ++ struct mkfs_params *cfg, ++ struct xfs_mount *mp, ++ int min_logblocks, ++ int *max_logblocks) +{ -+ int backoff = 0; -+ int ichunk_blocks; ++ 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; ++ /* ++ * 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); ++ /* ++ * 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; ++ *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, ++ /* 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(); -+ } ++ (long long)cfg->logblocks, ++ *max_logblocks); ++ usage(); ++ } + -+ cfg->logblocks = min(cfg->logblocks, *max_logblocks); ++ cfg->logblocks = min(cfg->logblocks, *max_logblocks); +} + static void calculate_log_size( - struct mkfs_params *cfg, -@@ -3301,6 +3344,10 @@ _("log ag number %lld too large, must be less than %lld\n"), - } else - cfg->logagno = (xfs_agnumber_t)(sbp->sb_agcount / 2); - + struct mkfs_params *cfg, +@@ -3299,6 +3342,9 @@ _("log ag number %lld too large, must be less than %lld\n"), + cfg->logagno = cli->logagno; + } 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)); ++ adjust_ag0_internal_logblocks(cfg, mp, min_logblocks, ++ &max_logblocks); + + cfg->logstart = XFS_AGB_TO_FSB(mp, cfg->logagno, + libxfs_prealloc_blocks(mp)); +-- +2.39.3 --- -2.19.1.6.gb485710b diff --git a/xfsprogs-5.10.0-xfs_repair-fix-progress-reporting.patch b/xfsprogs-5.10.0-xfs_repair-fix-progress-reporting.patch new file mode 100644 index 0000000..409a798 --- /dev/null +++ b/xfsprogs-5.10.0-xfs_repair-fix-progress-reporting.patch @@ -0,0 +1,177 @@ +From a4d94d6c30acac66ff82e740e2dcb95736d7d195 Mon Sep 17 00:00:00 2001 +From: Eric Sandeen +Date: Tue, 26 May 2020 14:36:04 -0400 +Subject: [PATCH] xfs_repair: fix progress reporting + +The Fixes: commit tried to avoid a segfault in case the progress timer +went off before the first message type had been set up, but this +had the net effect of short-circuiting the pthread start routine, +and so the timer didn't get set up at all and we lost all fine-grained +progress reporting. + +The initial problem occurred when log zeroing took more time than the +timer interval. + +So, make a new log zeroing progress item and initialize it when we first +set up the timer thread, to be sure that if the timer goes off while we +are still zeroing the log, it will be initialized and correct. + +(We can't offer fine-grained status on log zeroing, so it'll go from +zero to $LOGBLOCKS with nothing in between, but it's unlikely that log +zeroing will take so long that this really matters.) + +Reported-by: Leonardo Vaz +Fixes: 7f2d6b811755 ("xfs_repair: avoid segfault if reporting progre...") +Signed-off-by: Eric Sandeen +Reviewed-by: Darrick J. Wong +Reviewed-by: Donald Douwsma +Signed-off-by: Eric Sandeen +Signed-off-by: Pavel Reichl +--- + repair/phase2.c | 6 ++++++ + repair/progress.c | 35 +++++++++++++++++++---------------- + repair/progress.h | 31 ++++++++++++++++--------------- + 3 files changed, 41 insertions(+), 31 deletions(-) + +diff --git a/repair/phase2.c b/repair/phase2.c +index 40ea2f84..952ac4a5 100644 +--- a/repair/phase2.c ++++ b/repair/phase2.c +@@ -120,6 +120,9 @@ zero_log( + do_error(_("failed to clear log")); + } + ++ /* And we are now magically complete! */ ++ PROG_RPT_INC(prog_rpt_done[0], mp->m_sb.sb_logblocks); ++ + /* + * Finally, seed the max LSN from the current state of the log if this + * is a v5 filesystem. +@@ -160,7 +163,10 @@ phase2( + + /* Zero log if applicable */ + do_log(_(" - zero log...\n")); ++ ++ set_progress_msg(PROG_FMT_ZERO_LOG, (uint64_t)mp->m_sb.sb_logblocks); + zero_log(mp); ++ print_final_rpt(); + + do_log(_(" - scan filesystem freespace and inode maps...\n")); + +diff --git a/repair/progress.c b/repair/progress.c +index 5ee08229..e5a9c1ef 100644 +--- a/repair/progress.c ++++ b/repair/progress.c +@@ -49,35 +49,37 @@ typedef struct progress_rpt_s { + + static + progress_rpt_t progress_rpt_reports[] = { +-{FMT1, N_("scanning filesystem freespace"), /* 0 */ ++{FMT1, N_("zeroing log"), /* 0 */ ++ &rpt_fmts[FMT1], &rpt_types[TYPE_BLOCK]}, ++{FMT1, N_("scanning filesystem freespace"), /* 1 */ + &rpt_fmts[FMT1], &rpt_types[TYPE_AG]}, +-{FMT1, N_("scanning agi unlinked lists"), /* 1 */ ++{FMT1, N_("scanning agi unlinked lists"), /* 2 */ + &rpt_fmts[FMT1], &rpt_types[TYPE_AG]}, +-{FMT2, N_("check uncertain AG inodes"), /* 2 */ ++{FMT2, N_("check uncertain AG inodes"), /* 3 */ + &rpt_fmts[FMT2], &rpt_types[TYPE_AGI_BUCKET]}, +-{FMT1, N_("process known inodes and inode discovery"), /* 3 */ ++{FMT1, N_("process known inodes and inode discovery"), /* 4 */ + &rpt_fmts[FMT1], &rpt_types[TYPE_INODE]}, +-{FMT1, N_("process newly discovered inodes"), /* 4 */ ++{FMT1, N_("process newly discovered inodes"), /* 5 */ + &rpt_fmts[FMT1], &rpt_types[TYPE_AG]}, +-{FMT1, N_("setting up duplicate extent list"), /* 5 */ ++{FMT1, N_("setting up duplicate extent list"), /* 6 */ + &rpt_fmts[FMT1], &rpt_types[TYPE_AG]}, +-{FMT1, N_("initialize realtime bitmap"), /* 6 */ ++{FMT1, N_("initialize realtime bitmap"), /* 7 */ + &rpt_fmts[FMT1], &rpt_types[TYPE_BLOCK]}, +-{FMT1, N_("reset realtime bitmaps"), /* 7 */ ++{FMT1, N_("reset realtime bitmaps"), /* 8 */ + &rpt_fmts[FMT1], &rpt_types[TYPE_AG]}, +-{FMT1, N_("check for inodes claiming duplicate blocks"), /* 8 */ ++{FMT1, N_("check for inodes claiming duplicate blocks"), /* 9 */ + &rpt_fmts[FMT1], &rpt_types[TYPE_INODE]}, +-{FMT1, N_("rebuild AG headers and trees"), /* 9 */ ++{FMT1, N_("rebuild AG headers and trees"), /* 10 */ + &rpt_fmts[FMT1], &rpt_types[TYPE_AG]}, +-{FMT1, N_("traversing filesystem"), /* 10 */ ++{FMT1, N_("traversing filesystem"), /* 12 */ + &rpt_fmts[FMT1], &rpt_types[TYPE_AG]}, +-{FMT2, N_("traversing all unattached subtrees"), /* 11 */ ++{FMT2, N_("traversing all unattached subtrees"), /* 12 */ + &rpt_fmts[FMT2], &rpt_types[TYPE_DIR]}, +-{FMT2, N_("moving disconnected inodes to lost+found"), /* 12 */ ++{FMT2, N_("moving disconnected inodes to lost+found"), /* 13 */ + &rpt_fmts[FMT2], &rpt_types[TYPE_INODE]}, +-{FMT1, N_("verify and correct link counts"), /* 13 */ ++{FMT1, N_("verify and correct link counts"), /* 14 */ + &rpt_fmts[FMT1], &rpt_types[TYPE_AG]}, +-{FMT1, N_("verify link counts"), /* 14 */ ++{FMT1, N_("verify link counts"), /* 15 */ + &rpt_fmts[FMT1], &rpt_types[TYPE_AG]} + }; + +@@ -125,7 +127,8 @@ init_progress_rpt (void) + */ + + pthread_mutex_init(&global_msgs.mutex, NULL); +- global_msgs.format = NULL; ++ /* Make sure the format is set to the first phase and not NULL */ ++ global_msgs.format = &progress_rpt_reports[PROG_FMT_ZERO_LOG]; + global_msgs.count = glob_agcount; + global_msgs.interval = report_interval; + global_msgs.done = prog_rpt_done; +diff --git a/repair/progress.h b/repair/progress.h +index 9de9eb72..2c1690db 100644 +--- a/repair/progress.h ++++ b/repair/progress.h +@@ -8,26 +8,27 @@ + #define PHASE_END 1 + + +-#define PROG_FMT_SCAN_AG 0 /* Phase 2 */ ++#define PROG_FMT_ZERO_LOG 0 /* Phase 2 */ ++#define PROG_FMT_SCAN_AG 1 + +-#define PROG_FMT_AGI_UNLINKED 1 /* Phase 3 */ +-#define PROG_FMT_UNCERTAIN 2 +-#define PROG_FMT_PROCESS_INO 3 +-#define PROG_FMT_NEW_INODES 4 ++#define PROG_FMT_AGI_UNLINKED 2 /* Phase 3 */ ++#define PROG_FMT_UNCERTAIN 3 ++#define PROG_FMT_PROCESS_INO 4 ++#define PROG_FMT_NEW_INODES 5 + +-#define PROG_FMT_DUP_EXTENT 5 /* Phase 4 */ +-#define PROG_FMT_INIT_RTEXT 6 +-#define PROG_FMT_RESET_RTBM 7 +-#define PROG_FMT_DUP_BLOCKS 8 ++#define PROG_FMT_DUP_EXTENT 6 /* Phase 4 */ ++#define PROG_FMT_INIT_RTEXT 7 ++#define PROG_FMT_RESET_RTBM 8 ++#define PROG_FMT_DUP_BLOCKS 9 + +-#define PROG_FMT_REBUILD_AG 9 /* Phase 5 */ ++#define PROG_FMT_REBUILD_AG 10 /* Phase 5 */ + +-#define PROG_FMT_TRAVERSAL 10 /* Phase 6 */ +-#define PROG_FMT_TRAVERSSUB 11 +-#define PROG_FMT_DISCONINODE 12 ++#define PROG_FMT_TRAVERSAL 11 /* Phase 6 */ ++#define PROG_FMT_TRAVERSSUB 12 ++#define PROG_FMT_DISCONINODE 13 + +-#define PROGRESS_FMT_CORR_LINK 13 /* Phase 7 */ +-#define PROGRESS_FMT_VRFY_LINK 14 ++#define PROGRESS_FMT_CORR_LINK 14 /* Phase 7 */ ++#define PROGRESS_FMT_VRFY_LINK 15 + + #define DURATION_BUF_SIZE 512 + +-- +2.40.1 + diff --git a/1005-mkfs-terminate-getsubopt-arrays-properly.patch b/xfsprogs-5.19.0-mkfs-terminate-getsubopt-arrays-properly.patch similarity index 47% rename from 1005-mkfs-terminate-getsubopt-arrays-properly.patch rename to xfsprogs-5.19.0-mkfs-terminate-getsubopt-arrays-properly.patch index 7d0daa7..e3f512a 100644 --- a/1005-mkfs-terminate-getsubopt-arrays-properly.patch +++ b/xfsprogs-5.19.0-mkfs-terminate-getsubopt-arrays-properly.patch @@ -1,7 +1,7 @@ -From e3f705d0c461689fcfd36e405c61df39d9a83e0b Mon Sep 17 00:00:00 2001 +From 50dba8189b1f628073eb61d824ae8a8a1b43cefb Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Wed, 13 Jul 2022 20:58:28 -0500 -Subject: [PATCH 1005/1008] mkfs: terminate getsubopt arrays properly +Subject: [PATCH] mkfs: terminate getsubopt arrays properly Having not drank any (or maybe too much) coffee this morning, I typed: @@ -20,20 +20,19 @@ 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 +Signed-off-by: Pavel Reichl --- - mkfs/xfs_mkfs.c | 15 +++++++++++++-- - 1 file changed, 13 insertions(+), 2 deletions(-) + 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 36360ba7..37747698 100644 +index db322b3a..b140b815 100644 --- a/mkfs/xfs_mkfs.c +++ b/mkfs/xfs_mkfs.c -@@ -122,8 +122,11 @@ enum { - M_MAX_OPTS, +@@ -140,8 +140,11 @@ enum { + M_MAX_OPTS, }; - + -/* Just define the max options array size manually right now */ -#define MAX_SUBOPTS D_MAX_OPTS +/* @@ -41,72 +40,73 @@ index 36360ba7..37747698 100644 + * 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 -@@ -224,6 +227,7 @@ static struct opt_params bopts = { - .name = 'b', - .subopts = { - [B_SIZE] = "size", +@@ -251,6 +254,7 @@ static struct opt_params bopts = { + .name = 'b', + .subopts = { + [B_SIZE] = "size", + [B_MAX_OPTS] = NULL, - }, - .subopt_params = { - { .index = B_SIZE, -@@ -255,6 +259,7 @@ static struct opt_params dopts = { + }, + .subopt_params = { + { .index = B_SIZE, +@@ -306,6 +311,7 @@ static struct opt_params dopts = { [D_PROJINHERIT] = "projinherit", - [D_EXTSZINHERIT] = "extszinherit", - [D_COWEXTSIZE] = "cowextsize", + [D_EXTSZINHERIT] = "extszinherit", + [D_COWEXTSIZE] = "cowextsize", + [D_MAX_OPTS] = NULL, - }, - .subopt_params = { - { .index = D_AGCOUNT, -@@ -384,6 +389,7 @@ static struct opt_params iopts = { + }, + .subopt_params = { + { .index = D_AGCOUNT, +@@ -443,6 +449,7 @@ static struct opt_params iopts = { [I_ATTR] = "attr", [I_PROJID32BIT] = "projid32bit", [I_SPINODES] = "sparse", + [I_MAX_OPTS] = NULL, - }, - .subopt_params = { - { .index = I_ALIGN, -@@ -449,6 +455,7 @@ static struct opt_params lopts = { - [L_FILE] = "file", - [L_NAME] = "name", - [L_LAZYSBCNTR] = "lazy-count", + }, + .subopt_params = { + { .index = I_ALIGN, +@@ -515,6 +522,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, -@@ -540,6 +547,7 @@ static struct opt_params nopts = { - [N_SIZE] = "size", - [N_VERSION] = "version", - [N_FTYPE] = "ftype", + }, + .subopt_params = { + { .index = L_AGNUM, +@@ -607,6 +615,7 @@ static struct opt_params nopts = { + [N_SIZE] = "size", + [N_VERSION] = "version", + [N_FTYPE] = "ftype", + [N_MAX_OPTS] = NULL, - }, - .subopt_params = { - { .index = N_SIZE, -@@ -574,6 +582,7 @@ static struct opt_params ropts = { - [R_FILE] = "file", - [R_NAME] = "name", - [R_NOALIGN] = "noalign", + }, + .subopt_params = { + { .index = N_SIZE, +@@ -642,6 +651,7 @@ static struct opt_params ropts = { + [R_FILE] = "file", + [R_NAME] = "name", + [R_NOALIGN] = "noalign", + [R_MAX_OPTS] = NULL, - }, - .subopt_params = { - { .index = R_EXTSIZE, -@@ -620,6 +629,7 @@ static struct opt_params sopts = { - .subopts = { - [S_SIZE] = "size", - [S_SECTSIZE] = "sectsize", + }, + .subopt_params = { + { .index = R_EXTSIZE, +@@ -689,6 +699,7 @@ static struct opt_params sopts = { + .subopts = { + [S_SIZE] = "size", + [S_SECTSIZE] = "sectsize", + [S_MAX_OPTS] = NULL, - }, - .subopt_params = { - { .index = S_SIZE, -@@ -655,6 +665,7 @@ static struct opt_params mopts = { - [M_REFLINK] = "reflink", - [M_INOBTCNT] = "inobtcount", - [M_BIGTIME] = "bigtime", + }, + .subopt_params = { + { .index = S_SIZE, +@@ -725,6 +736,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 + }, + .subopt_params = { + { .index = M_CRC, +-- +2.40.1 + diff --git a/1006-xfs_repair-ignore-empty-xattr-leaf-blocks.patch b/xfsprogs-5.19.0-xfs_repair-ignore-empty-xattr-leaf-blocks.patch similarity index 71% rename from 1006-xfs_repair-ignore-empty-xattr-leaf-blocks.patch rename to xfsprogs-5.19.0-xfs_repair-ignore-empty-xattr-leaf-blocks.patch index de7f811..fd9b3b0 100644 --- a/1006-xfs_repair-ignore-empty-xattr-leaf-blocks.patch +++ b/xfsprogs-5.19.0-xfs_repair-ignore-empty-xattr-leaf-blocks.patch @@ -1,7 +1,7 @@ -From a4b3ccd82a079b63df1630482eaf26c0d4bdf4bc Mon Sep 17 00:00:00 2001 +From f50d3462c654acc484ab3ea68e75e8252b77e262 Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Wed, 13 Jul 2022 20:58:25 -0500 -Subject: [PATCH 1006/1008] xfs_repair: ignore empty xattr leaf blocks +Subject: [PATCH] xfs_repair: ignore empty xattr leaf blocks As detailed in the commit: @@ -15,20 +15,19 @@ 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 +Signed-off-by: Pavel Reichl --- repair/attr_repair.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/repair/attr_repair.c b/repair/attr_repair.c -index 5ad81c09..8cd9e2de 100644 +index 2055d96e..c3a6d502 100644 --- a/repair/attr_repair.c +++ b/repair/attr_repair.c -@@ -584,6 +584,26 @@ process_leaf_attr_block( - firstb = mp->m_sb.sb_blocksize; - stop = xfs_attr3_leaf_hdr_size(leaf); - +@@ -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 @@ -49,8 +48,9 @@ index 5ad81c09..8cd9e2de 100644 + 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 + /* does the count look sorta valid? */ + if (!leafhdr.count || + leafhdr.count * sizeof(xfs_attr_leaf_entry_t) + stop > +-- +2.40.1 + diff --git a/xfsprogs-rhelonly-mkfs-fix-man-s-default-value-for-sparse-option.patch b/xfsprogs-rhelonly-mkfs-fix-man-s-default-value-for-sparse-option.patch new file mode 100644 index 0000000..54c162f --- /dev/null +++ b/xfsprogs-rhelonly-mkfs-fix-man-s-default-value-for-sparse-option.patch @@ -0,0 +1,28 @@ +From 31980fef484df925b23824244de8ef353e436cef Mon Sep 17 00:00:00 2001 +From: Pavel Reichl +Date: Thu, 8 Jun 2023 10:57:52 +0200 +Subject: [PATCH] mkfs: fix man's default value for sparse option + +Fixes: 9cf846b51 ("mkfs: enable sparse inodes by default") +Suggested-by: Lukas Herbolt +Signed-off-by: Pavel Reichl +--- + man/man8/mkfs.xfs.8 | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/man/man8/mkfs.xfs.8 b/man/man8/mkfs.xfs.8 +index 49e64d47a..48e26ece7 100644 +--- a/man/man8/mkfs.xfs.8 ++++ b/man/man8/mkfs.xfs.8 +@@ -631,7 +631,7 @@ Enable sparse inode chunk allocation. The + .I value + is either 0 or 1, with 1 signifying that sparse allocation is enabled. + If the value is omitted, 1 is assumed. Sparse inode allocation is +-disabled by default. This feature is only available for filesystems ++enabled by default. This feature is only available for filesystems + formatted with + .B \-m crc=1. + .IP +-- +2.40.1 + diff --git a/xfsprogs.spec b/xfsprogs.spec index 0d81bed..8e9d479 100644 --- a/xfsprogs.spec +++ b/xfsprogs.spec @@ -2,7 +2,7 @@ Summary: Utilities for managing the XFS filesystem Name: xfsprogs Version: 5.0.0 -Release: 11%{anolis_release}%{?dist} +Release: 12%{anolis_release}%{?dist} License: GPL+ and LGPLv2+ Group: System Environment/Base URL: https://xfs.wiki.kernel.org @@ -13,27 +13,27 @@ BuildRequires: readline-devel, libblkid-devel >= 2.17-0.1.git5e51568 BuildRequires: lvm2-devel, libicu-devel >= 4.6 Requires: glibc Provides: xfs-cmds -Provides: /usr/sbin/fsck.xfs -Provides: /usr/sbin/mkfs.xfs -Provides: /usr/sbin/xfs_admin -Provides: /usr/sbin/xfs_bmap -Provides: /usr/sbin/xfs_copy -Provides: /usr/sbin/xfs_db -Provides: /usr/sbin/xfs_estimate -Provides: /usr/sbin/xfs_freeze -Provides: /usr/sbin/xfs_fsr -Provides: /usr/sbin/xfs_growfs -Provides: /usr/sbin/xfs_info -Provides: /usr/sbin/xfs_io -Provides: /usr/sbin/xfs_logprint -Provides: /usr/sbin/xfs_mdrestore -Provides: /usr/sbin/xfs_metadump -Provides: /usr/sbin/xfs_mkfile -Provides: /usr/sbin/xfs_ncheck -Provides: /usr/sbin/xfs_quota -Provides: /usr/sbin/xfs_repair -Provides: /usr/sbin/xfs_rtcp -Provides: /usr/sbin/xfs_spaceman +Provides: /usr/sbin/fsck.xfs +Provides: /usr/sbin/mkfs.xfs +Provides: /usr/sbin/xfs_admin +Provides: /usr/sbin/xfs_bmap +Provides: /usr/sbin/xfs_copy +Provides: /usr/sbin/xfs_db +Provides: /usr/sbin/xfs_estimate +Provides: /usr/sbin/xfs_freeze +Provides: /usr/sbin/xfs_fsr +Provides: /usr/sbin/xfs_growfs +Provides: /usr/sbin/xfs_info +Provides: /usr/sbin/xfs_io +Provides: /usr/sbin/xfs_logprint +Provides: /usr/sbin/xfs_mdrestore +Provides: /usr/sbin/xfs_metadump +Provides: /usr/sbin/xfs_mkfile +Provides: /usr/sbin/xfs_ncheck +Provides: /usr/sbin/xfs_quota +Provides: /usr/sbin/xfs_repair +Provides: /usr/sbin/xfs_rtcp +Provides: /usr/sbin/xfs_spaceman Obsoletes: xfs-cmds <= %{version} Provides: xfsprogs-qa-devel Obsoletes: xfsprogs-qa-devel <= %{version} @@ -103,18 +103,19 @@ Patch59: xfsprogs-5.13.0-xfs-rename-struct-xfs_legacy_ictimestamp.patch Patch60: xfsprogs-5.11.0-mkfs-fix-wrong-inobtcount-usage-error-output.patch Patch61: xfsprogs-5.12.0-libxfs-expose-inobtcount-in-xfs-geometry.patch Patch62: xfsprogs-5.12.0-libfrog-report-inobtcount-in-geometry.patch -Patch63: xfsprogs-5.9.0-xfs-ignore-autofs-mount-table-entries.patch - +Patch63: xfsprogs-5.19.0-xfs_repair-ignore-empty-xattr-leaf-blocks.patch +Patch64: xfsprogs-5.19.0-mkfs-terminate-getsubopt-arrays-properly.patch +Patch65: xfsprogs-5.9.0-xfs-ignore-autofs-mount-table-entries.patch +Patch66: xfsprogs-5.10.0-xfs_repair-fix-progress-reporting.patch +Patch67: xfsprogs-rhelonly-mkfs-fix-man-s-default-value-for-sparse-option.patch # Begin: Anolis customized patches # backport patch from upstream -Patch1001: 1001-xfsprogs-gcc10.patch -Patch1002: 1002-xfsprogs-add-atomic-write-support.patch -Patch1003: 1003-mkfs-don-t-trample-the-gid-set-in-the-protofile.patch -Patch1004: 1004-fsck.xfs-try-to-replay-log-if-dirty-during-xfs_repai.patch -Patch1005: 1005-mkfs-terminate-getsubopt-arrays-properly.patch -Patch1006: 1006-xfs_repair-ignore-empty-xattr-leaf-blocks.patch -Patch1007: 1007-mkfs-fix-missing-validation-of-l-size-against-maximu.patch -Patch1008: 1008-mkfs-don-t-let-internal-logs-bump-the-root-dir-inode.patch +Patch1001: 1001-xfsprogs-gcc10.patch +Patch1002: 1002-xfsprogs-add-atomic-write-support.patch +Patch1003: 1003-mkfs-don-t-trample-the-gid-set-in-the-protofile.patch +Patch1004: 1004-fsck.xfs-try-to-replay-log-if-dirty-during-xfs_repai.patch +Patch1007: 1007-mkfs-fix-missing-validation-of-l-size-against-maximu.patch +Patch1008: 1008-mkfs-don-t-let-internal-logs-bump-the-root-dir-inode.patch # End: Anolis customized patches %description @@ -218,12 +219,14 @@ Doc pages for %{name}. %patch61 -p1 %patch62 -p1 %patch63 -p1 +%patch64 -p1 +%patch65 -p1 +%patch66 -p1 +%patch67 -p1 %patch1001 -p1 %patch1002 -p1 %patch1003 -p1 %patch1004 -p1 -%patch1005 -p1 -%patch1006 -p1 %patch1007 -p1 %patch1008 -p1 @@ -287,7 +290,7 @@ rm -rf $RPM_BUILD_ROOT/%{_mandir}/man8/xfs_scrub* %doc doc/CHANGES README %changelog -* Thu Jul 27 2023 Weitao Zhou - 5.0.0-11.0.1 +* Mon Dec 11 2023 liuzhilin - 5.0.0-12.0.1 - Fix gcc10 -fno-common compile issue for compatible with gcc10 build - Add atomic write support (joseph.qi@linux.aliabba.com) - mkfs: don't trample the gid set in the protofile (hongnan.li@linux.alibaba.com) @@ -297,8 +300,13 @@ rm -rf $RPM_BUILD_ROOT/%{_mandir}/man8/xfs_scrub* - mkfs.xfs: fix internal logs' size (mengferry@linux.alibaba.com) - xfs_repair: ignore empty xattr leaf blocks (mengferry@linux.alibaba.com) -* Fri May 19 2023 Pavel Reichl - 5.0.0-11 -- Fix ignore autofs mount table entries (#2208391) +* Thu Jun 08 2023 Pavel Reichl - 5.0.0-12 +- Fix xfs_repair progress reporting is not working (#2183398) +- Fix man page default for sparse mkfs option (#2118564) + +* Tue May 02 2023 Pavel Reichl - 5.0.0-11 +- Fix xfstest fails with error "missing xfsprogs fix patch"(#2161936,#2160746) +- Fix ignore autofs mount table entries (#2182361) * Thu Dec 09 2021 Bill O'Donnell 5.0.0-10 - xfsprogs: enable bigtime and inode btree counter features in RHEL8 (#2024201)) -- Gitee