* [PATCH v2 0/34] xfsprogs: libxfs sync v6.18
@ 2025-12-05 15:01 Andrey Albershteyn
2025-12-05 15:01 ` [PATCH v2 1/33] xfs: remove deprecated mount options Andrey Albershteyn
` (33 more replies)
0 siblings, 34 replies; 35+ messages in thread
From: Andrey Albershteyn @ 2025-12-05 15:01 UTC (permalink / raw)
To: linux-xfs, aalbersh, cem, cmaiolino, djwong, dlemoal,
hans.holmberg, hch, preichl
Hi all,
This is libxfs sync for v6.18. A lot of typedef cleanups mostly.
I replaced removed typedefs throughout xfsprogs and adjusted formating a
bit around these changes, and updated XFS_TEST_ERROR() macro in the
original commit to ignore expr argument. Nothing else changed.
v2:
- Moved all newly added "convert ... typedef to struct" before typedef
removal commits
- Remove some retabs to not interfere with futher typedef cleanups
Andrey Albershteyn <aalbersh@kernel.org>:
xfs: remove deprecated mount options
xfs: remove deprecated sysctl knobs
xfs: convert xfs_buf_log_format_t typedef to struct
xfs: convert xlog_op_header_t typedef to struct
xfs: convert xfs_trans_header_t typdef to struct
xfs: convert xfs_log_iovec_t typedef to struct
xfs: convert xfs_qoff_logformat_t typedef to struct
xfs: convert xfs_dq_logformat_t typedef to struct
xfs: convert xfs_efi_log_format typedef to struct
xfs: convert xfs_efd_log_format_t typedef to struct
xfs: convert xfs_efi_log_format_32_t typedef to struct
xfs: convert xfs_extent_t typedef to struct
xfs: convert xfs_efi_log_format_64_t typedef to struct
xfs: remove the xlog_op_header_t typedef
xfs: remove the xfs_trans_header_t typedef
xfs: remove the xfs_extent_t typedef
xfs: remove the xfs_extent32_t typedef
xfs: remove the xfs_extent64_t typedef
xfs: remove the xfs_efi_log_format_t typedef
xfs: remove the xfs_efi_log_format_32_t typedef
xfs: remove the xfs_efi_log_format_64_t typedef
xfs: remove the xfs_efd_log_format_t typedef
xfs: remove the unused xfs_efd_log_format_32_t typedef
xfs: remove the unused xfs_efd_log_format_64_t typedef
xfs: remove the unused xfs_buf_log_format_t typedef
xfs: remove the unused xfs_dq_logformat_t typedef
xfs: remove the unused xfs_qoff_logformat_t typedef
xfs: remove the unused xfs_log_iovec_t typedef
xfs: fix log CRC mismatches between i386 and other architectures
xfs: move the XLOG_REG_ constants out of xfs_log_format.h
xfs: remove the expr argument to XFS_TEST_ERROR
xfs: improve default maximum number of open zones
xfs: prevent gc from picking the same zone twice
Diffstat:
include/xfs_trans.h | 2 +-
libxfs/defer_item.c | 2 +-
libxfs/libxfs_priv.h | 2 +-
libxfs/rdwr.c | 4 ++--
libxfs/util.c | 10 +++++-----
libxfs/xfs_ag_resv.c | 7 +++----
libxfs/xfs_alloc.c | 5 ++---
libxfs/xfs_attr_leaf.c | 25 ++++++-------------------
libxfs/xfs_bmap.c | 31 +++++++++++--------------------
libxfs/xfs_btree.c | 2 +-
libxfs/xfs_da_btree.c | 2 +-
libxfs/xfs_dir2.c | 2 +-
libxfs/xfs_exchmaps.c | 4 ++--
libxfs/xfs_ialloc.c | 6 +++---
libxfs/xfs_inode_buf.c | 4 ++--
libxfs/xfs_inode_fork.c | 3 +--
libxfs/xfs_inode_util.c | 11 -----------
libxfs/xfs_log_format.h | 150 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------------------------------------------------
libxfs/xfs_log_recover.h | 2 +-
libxfs/xfs_metafile.c | 2 +-
libxfs/xfs_ondisk.h | 2 ++
libxfs/xfs_refcount.c | 7 +++----
libxfs/xfs_rmap.c | 2 +-
libxfs/xfs_rtbitmap.c | 2 +-
libxfs/xfs_rtgroup.h | 6 ++++++
libxfs/xfs_sb.c | 9 +++------
libxfs/xfs_zones.h | 7 +++++++
libxlog/xfs_log_recover.c | 20 ++++++++++----------
logprint/log_print_all.c | 14 +++++++-------
logprint/log_redo.c | 89 +++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------
logprint/logprint.h | 2 +-
31 files changed, 203 insertions(+), 233 deletions(-)
--
- Andrey
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH v2 1/33] xfs: remove deprecated mount options
2025-12-05 15:01 [PATCH v2 0/34] xfsprogs: libxfs sync v6.18 Andrey Albershteyn
@ 2025-12-05 15:01 ` Andrey Albershteyn
2025-12-05 15:01 ` [PATCH v2 2/33] xfs: remove deprecated sysctl knobs Andrey Albershteyn
` (32 subsequent siblings)
33 siblings, 0 replies; 35+ messages in thread
From: Andrey Albershteyn @ 2025-12-05 15:01 UTC (permalink / raw)
To: linux-xfs, aalbersh, cem, cmaiolino, djwong, dlemoal,
hans.holmberg, hch, preichl
From: Darrick J. Wong <djwong@kernel.org>
Source kernel commit: b9a176e54162f890aaf50ac8a467d725ed2f00df
These four mount options were scheduled for removal in September 2025,
so remove them now.
Cc: preichl@redhat.com
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
---
libxfs/xfs_attr_leaf.c | 23 +++++------------------
libxfs/xfs_bmap.c | 14 +++-----------
libxfs/xfs_ialloc.c | 4 ++--
libxfs/xfs_sb.c | 9 +++------
4 files changed, 13 insertions(+), 37 deletions(-)
diff --git a/libxfs/xfs_attr_leaf.c b/libxfs/xfs_attr_leaf.c
index 01a87b45a6..cfb8d40e51 100644
--- a/libxfs/xfs_attr_leaf.c
+++ b/libxfs/xfs_attr_leaf.c
@@ -664,12 +664,8 @@
/*
* For attr2 we can try to move the forkoff if there is space in the
- * literal area, but for the old format we are done if there is no
- * space in the fixed attribute fork.
+ * literal area
*/
- if (!xfs_has_attr2(mp))
- return 0;
-
dsize = dp->i_df.if_bytes;
switch (dp->i_df.if_format) {
@@ -720,22 +716,16 @@
}
/*
- * Switch on the ATTR2 superblock bit (implies also FEATURES2) unless:
- * - noattr2 mount option is set,
- * - on-disk version bit says it is already set, or
- * - the attr2 mount option is not set to enable automatic upgrade from attr1.
+ * Switch on the ATTR2 superblock bit (implies also FEATURES2) unless
+ * on-disk version bit says it is already set
*/
STATIC void
xfs_sbversion_add_attr2(
struct xfs_mount *mp,
struct xfs_trans *tp)
{
- if (xfs_has_noattr2(mp))
- return;
if (mp->m_sb.sb_features2 & XFS_SB_VERSION2_ATTR2BIT)
return;
- if (!xfs_has_attr2(mp))
- return;
spin_lock(&mp->m_sb_lock);
xfs_add_attr2(mp);
@@ -886,7 +876,7 @@
/*
* Fix up the start offset of the attribute fork
*/
- if (totsize == sizeof(struct xfs_attr_sf_hdr) && xfs_has_attr2(mp) &&
+ if (totsize == sizeof(struct xfs_attr_sf_hdr) &&
(dp->i_df.if_format != XFS_DINODE_FMT_BTREE) &&
!(args->op_flags & (XFS_DA_OP_ADDNAME | XFS_DA_OP_REPLACE)) &&
!xfs_has_parent(mp)) {
@@ -897,7 +887,6 @@
ASSERT(dp->i_forkoff);
ASSERT(totsize > sizeof(struct xfs_attr_sf_hdr) ||
(args->op_flags & XFS_DA_OP_ADDNAME) ||
- !xfs_has_attr2(mp) ||
dp->i_df.if_format == XFS_DINODE_FMT_BTREE ||
xfs_has_parent(mp));
xfs_trans_log_inode(args->trans, dp,
@@ -1037,8 +1026,7 @@
bytes += xfs_attr_sf_entsize_byname(name_loc->namelen,
be16_to_cpu(name_loc->valuelen));
}
- if (xfs_has_attr2(dp->i_mount) &&
- (dp->i_df.if_format != XFS_DINODE_FMT_BTREE) &&
+ if ((dp->i_df.if_format != XFS_DINODE_FMT_BTREE) &&
(bytes == sizeof(struct xfs_attr_sf_hdr)))
return -1;
return xfs_attr_shortform_bytesfit(dp, bytes);
@@ -1158,7 +1146,6 @@
* this case.
*/
if (!(args->op_flags & XFS_DA_OP_REPLACE)) {
- ASSERT(xfs_has_attr2(dp->i_mount));
ASSERT(dp->i_df.if_format != XFS_DINODE_FMT_BTREE);
xfs_attr_fork_remove(dp, args->trans);
}
diff --git a/libxfs/xfs_bmap.c b/libxfs/xfs_bmap.c
index 99f5e6f9d5..e6a1922abb 100644
--- a/libxfs/xfs_bmap.c
+++ b/libxfs/xfs_bmap.c
@@ -991,8 +991,7 @@
static int
xfs_bmap_set_attrforkoff(
struct xfs_inode *ip,
- int size,
- int *version)
+ int size)
{
int default_size = xfs_default_attroffset(ip) >> 3;
@@ -1006,8 +1005,6 @@
ip->i_forkoff = xfs_attr_shortform_bytesfit(ip, size);
if (!ip->i_forkoff)
ip->i_forkoff = default_size;
- else if (xfs_has_attr2(ip->i_mount) && version)
- *version = 2;
break;
default:
ASSERT(0);
@@ -1029,7 +1026,6 @@
int rsvd) /* xact may use reserved blks */
{
struct xfs_mount *mp = tp->t_mountp;
- int version = 1; /* superblock attr version */
int logflags; /* logging flags */
int error; /* error return value */
@@ -1039,7 +1035,7 @@
ASSERT(!xfs_inode_has_attr_fork(ip));
xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
- error = xfs_bmap_set_attrforkoff(ip, size, &version);
+ error = xfs_bmap_set_attrforkoff(ip, size);
if (error)
return error;
@@ -1063,16 +1059,12 @@
xfs_trans_log_inode(tp, ip, logflags);
if (error)
return error;
- if (!xfs_has_attr(mp) ||
- (!xfs_has_attr2(mp) && version == 2)) {
+ if (!xfs_has_attr(mp)) {
bool log_sb = false;
spin_lock(&mp->m_sb_lock);
if (!xfs_has_attr(mp)) {
xfs_add_attr(mp);
- log_sb = true;
- }
- if (!xfs_has_attr2(mp) && version == 2) {
xfs_add_attr2(mp);
log_sb = true;
}
diff --git a/libxfs/xfs_ialloc.c b/libxfs/xfs_ialloc.c
index 8fd149e184..0efad4cfda 100644
--- a/libxfs/xfs_ialloc.c
+++ b/libxfs/xfs_ialloc.c
@@ -2135,7 +2135,7 @@
* remove the chunk if the block size is large enough for multiple inode
* chunks (that might not be free).
*/
- if (!xfs_has_ikeep(mp) && rec.ir_free == XFS_INOBT_ALL_FREE &&
+ if (rec.ir_free == XFS_INOBT_ALL_FREE &&
mp->m_sb.sb_inopblock <= XFS_INODES_PER_CHUNK) {
xic->deleted = true;
xic->first_ino = xfs_agino_to_ino(pag, rec.ir_startino);
@@ -2281,7 +2281,7 @@
* enough for multiple chunks. Leave the finobt record to remain in sync
* with the inobt.
*/
- if (!xfs_has_ikeep(mp) && rec.ir_free == XFS_INOBT_ALL_FREE &&
+ if (rec.ir_free == XFS_INOBT_ALL_FREE &&
mp->m_sb.sb_inopblock <= XFS_INODES_PER_CHUNK) {
error = xfs_btree_delete(cur, &i);
if (error)
diff --git a/libxfs/xfs_sb.c b/libxfs/xfs_sb.c
index 078c75febf..dd14c3ab3b 100644
--- a/libxfs/xfs_sb.c
+++ b/libxfs/xfs_sb.c
@@ -140,8 +140,6 @@
if (sbp->sb_versionnum & XFS_SB_VERSION_MOREBITSBIT) {
if (sbp->sb_features2 & XFS_SB_VERSION2_LAZYSBCOUNTBIT)
features |= XFS_FEAT_LAZYSBCOUNT;
- if (sbp->sb_features2 & XFS_SB_VERSION2_ATTR2BIT)
- features |= XFS_FEAT_ATTR2;
if (sbp->sb_features2 & XFS_SB_VERSION2_PROJID32BIT)
features |= XFS_FEAT_PROJID32;
if (sbp->sb_features2 & XFS_SB_VERSION2_FTYPE)
@@ -153,7 +151,7 @@
/* Always on V5 features */
features |= XFS_FEAT_ALIGN | XFS_FEAT_LOGV2 | XFS_FEAT_EXTFLG |
- XFS_FEAT_LAZYSBCOUNT | XFS_FEAT_ATTR2 | XFS_FEAT_PROJID32 |
+ XFS_FEAT_LAZYSBCOUNT | XFS_FEAT_PROJID32 |
XFS_FEAT_V3INODES | XFS_FEAT_CRC | XFS_FEAT_PQUOTINO;
/* Optional V5 features */
@@ -1522,7 +1520,8 @@
geo->version = XFS_FSOP_GEOM_VERSION;
geo->flags = XFS_FSOP_GEOM_FLAGS_NLINK |
XFS_FSOP_GEOM_FLAGS_DIRV2 |
- XFS_FSOP_GEOM_FLAGS_EXTFLG;
+ XFS_FSOP_GEOM_FLAGS_EXTFLG |
+ XFS_FSOP_GEOM_FLAGS_ATTR2;
if (xfs_has_attr(mp))
geo->flags |= XFS_FSOP_GEOM_FLAGS_ATTR;
if (xfs_has_quota(mp))
@@ -1535,8 +1534,6 @@
geo->flags |= XFS_FSOP_GEOM_FLAGS_DIRV2CI;
if (xfs_has_lazysbcount(mp))
geo->flags |= XFS_FSOP_GEOM_FLAGS_LAZYSB;
- if (xfs_has_attr2(mp))
- geo->flags |= XFS_FSOP_GEOM_FLAGS_ATTR2;
if (xfs_has_projid32(mp))
geo->flags |= XFS_FSOP_GEOM_FLAGS_PROJID32;
if (xfs_has_crc(mp))
--
- Andrey
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v2 2/33] xfs: remove deprecated sysctl knobs
2025-12-05 15:01 [PATCH v2 0/34] xfsprogs: libxfs sync v6.18 Andrey Albershteyn
2025-12-05 15:01 ` [PATCH v2 1/33] xfs: remove deprecated mount options Andrey Albershteyn
@ 2025-12-05 15:01 ` Andrey Albershteyn
2025-12-05 15:01 ` [PATCH v2 3/33] xfs: convert xfs_buf_log_format_t typedef to struct Andrey Albershteyn
` (31 subsequent siblings)
33 siblings, 0 replies; 35+ messages in thread
From: Andrey Albershteyn @ 2025-12-05 15:01 UTC (permalink / raw)
To: linux-xfs, aalbersh, cem, cmaiolino, djwong, dlemoal,
hans.holmberg, hch, preichl
From: Darrick J. Wong <djwong@kernel.org>
Source kernel commit: 21d59d00221e4ecbcb597eec0021c667477d3335
These sysctl knobs were scheduled for removal in September 2025. That
time has come, so remove them.
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
---
libxfs/xfs_inode_util.c | 11 -----------
1 file changed, 0 insertions(+), 11 deletions(-)
diff --git a/libxfs/xfs_inode_util.c b/libxfs/xfs_inode_util.c
index 2a7988d774..85d4af41d5 100644
--- a/libxfs/xfs_inode_util.c
+++ b/libxfs/xfs_inode_util.c
@@ -296,17 +296,6 @@
} else {
inode_init_owner(args->idmap, inode, dir, args->mode);
}
-
- /*
- * If the group ID of the new file does not match the effective
- * group ID or one of the supplementary group IDs, the S_ISGID
- * bit is cleared (and only if the irix_sgid_inherit
- * compatibility variable is set).
- */
- if (irix_sgid_inherit && (inode->i_mode & S_ISGID) &&
- !vfsgid_in_group_p(i_gid_into_vfsgid(args->idmap, inode)))
- inode->i_mode &= ~S_ISGID;
-
ip->i_projid = xfs_get_initial_prid(pip);
}
--
- Andrey
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v2 3/33] xfs: convert xfs_buf_log_format_t typedef to struct
2025-12-05 15:01 [PATCH v2 0/34] xfsprogs: libxfs sync v6.18 Andrey Albershteyn
2025-12-05 15:01 ` [PATCH v2 1/33] xfs: remove deprecated mount options Andrey Albershteyn
2025-12-05 15:01 ` [PATCH v2 2/33] xfs: remove deprecated sysctl knobs Andrey Albershteyn
@ 2025-12-05 15:01 ` Andrey Albershteyn
2025-12-05 15:01 ` [PATCH v2 4/33] xfs: convert xlog_op_header_t " Andrey Albershteyn
` (30 subsequent siblings)
33 siblings, 0 replies; 35+ messages in thread
From: Andrey Albershteyn @ 2025-12-05 15:01 UTC (permalink / raw)
To: linux-xfs, aalbersh, cem, cmaiolino, djwong, dlemoal,
hans.holmberg, hch, preichl
Reviewed-by: Andrey Albershteyn <aalbersh@kernel.org>
---
include/xfs_trans.h | 2 +-
logprint/log_print_all.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/xfs_trans.h b/include/xfs_trans.h
index d7d3904119..d4b546a0e3 100644
--- a/include/xfs_trans.h
+++ b/include/xfs_trans.h
@@ -50,7 +50,7 @@
struct xfs_buf *bli_buf; /* real buffer pointer */
unsigned int bli_flags; /* misc flags */
unsigned int bli_recur; /* recursion count */
- xfs_buf_log_format_t __bli_format; /* in-log header */
+ struct xfs_buf_log_format __bli_format; /* in-log header */
} xfs_buf_log_item_t;
#define XFS_BLI_DIRTY (1<<0)
diff --git a/logprint/log_print_all.c b/logprint/log_print_all.c
index 39946f32d4..0920c4871c 100644
--- a/logprint/log_print_all.c
+++ b/logprint/log_print_all.c
@@ -72,13 +72,13 @@
{
xfs_agi_t *agi;
xfs_agf_t *agf;
- xfs_buf_log_format_t *f;
+ struct xfs_buf_log_format *f;
char *p;
int len, num, i;
xfs_daddr_t blkno;
struct xfs_disk_dquot *ddq;
- f = (xfs_buf_log_format_t *)item->ri_buf[0].iov_base;
+ f = (struct xfs_buf_log_format*)item->ri_buf[0].iov_base;
printf(" ");
ASSERT(f->blf_type == XFS_LI_BUF);
printf(_("BUF: #regs:%d start blkno:0x%llx len:%d bmap size:%d flags:0x%x\n"),
--
- Andrey
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v2 4/33] xfs: convert xlog_op_header_t typedef to struct
2025-12-05 15:01 [PATCH v2 0/34] xfsprogs: libxfs sync v6.18 Andrey Albershteyn
` (2 preceding siblings ...)
2025-12-05 15:01 ` [PATCH v2 3/33] xfs: convert xfs_buf_log_format_t typedef to struct Andrey Albershteyn
@ 2025-12-05 15:01 ` Andrey Albershteyn
2025-12-05 15:01 ` [PATCH v2 5/33] xfs: convert xfs_trans_header_t typdef " Andrey Albershteyn
` (29 subsequent siblings)
33 siblings, 0 replies; 35+ messages in thread
From: Andrey Albershteyn @ 2025-12-05 15:01 UTC (permalink / raw)
To: linux-xfs, aalbersh, cem, cmaiolino, djwong, dlemoal,
hans.holmberg, hch, preichl
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
---
libxfs/rdwr.c | 4 ++--
libxfs/util.c | 8 ++++----
libxlog/xfs_log_recover.c | 12 ++++++------
logprint/log_redo.c | 10 +++++-----
logprint/logprint.h | 2 +-
5 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/libxfs/rdwr.c b/libxfs/rdwr.c
index 5c14dbb5c8..500a8d8154 100644
--- a/libxfs/rdwr.c
+++ b/libxfs/rdwr.c
@@ -120,7 +120,7 @@
static void unmount_record(void *p)
{
- xlog_op_header_t *op = (xlog_op_header_t *)p;
+ struct xlog_op_header *op = (struct xlog_op_header *)p;
/* the data section must be 32 bit size aligned */
struct {
uint16_t magic;
@@ -137,7 +137,7 @@
op->oh_res2 = 0;
/* and the data for this op */
- memcpy((char *)p + sizeof(xlog_op_header_t), &magic, sizeof(magic));
+ memcpy((char *)p + sizeof(struct xlog_op_header), &magic, sizeof(magic));
}
static char *next(
diff --git a/libxfs/util.c b/libxfs/util.c
index 334e88cd3f..13b8297f73 100644
--- a/libxfs/util.c
+++ b/libxfs/util.c
@@ -85,11 +85,11 @@
*/
/* for trans header */
- unit_bytes += sizeof(xlog_op_header_t);
+ unit_bytes += sizeof(struct xlog_op_header);
unit_bytes += sizeof(xfs_trans_header_t);
/* for start-rec */
- unit_bytes += sizeof(xlog_op_header_t);
+ unit_bytes += sizeof(struct xlog_op_header);
/*
* for LR headers - the space for data in an iclog is the size minus
@@ -112,12 +112,12 @@
num_headers = howmany(unit_bytes, iclog_space);
/* for split-recs - ophdrs added when data split over LRs */
- unit_bytes += sizeof(xlog_op_header_t) * num_headers;
+ unit_bytes += sizeof(struct xlog_op_header) * num_headers;
/* add extra header reservations if we overrun */
while (!num_headers ||
howmany(unit_bytes, iclog_space) > num_headers) {
- unit_bytes += sizeof(xlog_op_header_t);
+ unit_bytes += sizeof(struct xlog_op_header);
num_headers++;
}
unit_bytes += iclog_header_size * num_headers;
diff --git a/libxlog/xfs_log_recover.c b/libxlog/xfs_log_recover.c
index 7ef43956e9..f46cb31977 100644
--- a/libxlog/xfs_log_recover.c
+++ b/libxlog/xfs_log_recover.c
@@ -674,7 +674,7 @@
xfs_daddr_t *tail_blk)
{
xlog_rec_header_t *rhead;
- xlog_op_header_t *op_head;
+ struct xlog_op_header *op_head;
char *offset = NULL;
struct xfs_buf *bp;
int error, i, found;
@@ -808,7 +808,7 @@
if (error)
goto done;
- op_head = (xlog_op_header_t *)offset;
+ op_head = (struct xlog_op_header *)offset;
if (op_head->oh_flags & XLOG_UNMOUNT_TRANS) {
/*
* Set tail and last sync so that newly written
@@ -1199,7 +1199,7 @@
{
char *lp;
int num_logops;
- xlog_op_header_t *ohead;
+ struct xlog_op_header *ohead;
struct xlog_recover *trans;
xlog_tid_t tid;
int error;
@@ -1214,9 +1214,9 @@
return (XFS_ERROR(EIO));
while ((dp < lp) && num_logops) {
- ASSERT(dp + sizeof(xlog_op_header_t) <= lp);
- ohead = (xlog_op_header_t *)dp;
- dp += sizeof(xlog_op_header_t);
+ ASSERT(dp + sizeof(struct xlog_op_header) <= lp);
+ ohead = (struct xlog_op_header *)dp;
+ dp += sizeof(struct xlog_op_header);
if (ohead->oh_clientid != XFS_TRANSACTION &&
ohead->oh_clientid != XFS_LOG) {
xfs_warn(log->l_mp, "%s: bad clientid 0x%x",
diff --git a/logprint/log_redo.c b/logprint/log_redo.c
index f5bac21d35..e442d6f7cd 100644
--- a/logprint/log_redo.c
+++ b/logprint/log_redo.c
@@ -793,7 +793,7 @@
int *i)
{
struct xfs_attri_log_format *src_f = NULL;
- xlog_op_header_t *head = NULL;
+ struct xlog_op_header *head = NULL;
void *name_ptr = NULL;
void *new_name_ptr = NULL;
void *value_ptr = NULL;
@@ -850,7 +850,7 @@
if (name_len > 0) {
printf(_("\n"));
(*i)++;
- head = (xlog_op_header_t *)*ptr;
+ head = (struct xlog_op_header *)*ptr;
xlog_print_op_header(head, *i, ptr);
name_ptr = *ptr;
error = xlog_print_trans_attri_name(ptr,
@@ -862,7 +862,7 @@
if (new_name_len > 0) {
printf(_("\n"));
(*i)++;
- head = (xlog_op_header_t *)*ptr;
+ head = (struct xlog_op_header *)*ptr;
xlog_print_op_header(head, *i, ptr);
new_name_ptr = *ptr;
error = xlog_print_trans_attri_name(ptr,
@@ -874,7 +874,7 @@
if (value_len > 0) {
printf(_("\n"));
(*i)++;
- head = (xlog_op_header_t *)*ptr;
+ head = (struct xlog_op_header *)*ptr;
xlog_print_op_header(head, *i, ptr);
value_ptr = *ptr;
error = xlog_print_trans_attri_value(ptr,
@@ -886,7 +886,7 @@
if (new_value_len > 0) {
printf(_("\n"));
(*i)++;
- head = (xlog_op_header_t *)*ptr;
+ head = (struct xlog_op_header *)*ptr;
xlog_print_op_header(head, *i, ptr);
new_value_ptr = *ptr;
error = xlog_print_trans_attri_value(ptr,
diff --git a/logprint/logprint.h b/logprint/logprint.h
index 8a997fe115..aa90068c8a 100644
--- a/logprint/logprint.h
+++ b/logprint/logprint.h
@@ -65,7 +65,7 @@
extern void xlog_recover_print_attri(struct xlog_recover_item *item);
extern int xlog_print_trans_attrd(char **ptr, uint len);
extern void xlog_recover_print_attrd(struct xlog_recover_item *item);
-extern void xlog_print_op_header(xlog_op_header_t *op_head, int i, char **ptr);
+extern void xlog_print_op_header(struct xlog_op_header *op_head, int i, char **ptr);
int xlog_print_trans_xmi(char **ptr, uint src_len, int continued);
void xlog_recover_print_xmi(struct xlog_recover_item *item);
--
- Andrey
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v2 5/33] xfs: convert xfs_trans_header_t typdef to struct
2025-12-05 15:01 [PATCH v2 0/34] xfsprogs: libxfs sync v6.18 Andrey Albershteyn
` (3 preceding siblings ...)
2025-12-05 15:01 ` [PATCH v2 4/33] xfs: convert xlog_op_header_t " Andrey Albershteyn
@ 2025-12-05 15:01 ` Andrey Albershteyn
2025-12-05 15:01 ` [PATCH v2 6/33] xfs: convert xfs_log_iovec_t typedef " Andrey Albershteyn
` (28 subsequent siblings)
33 siblings, 0 replies; 35+ messages in thread
From: Andrey Albershteyn @ 2025-12-05 15:01 UTC (permalink / raw)
To: linux-xfs, aalbersh, cem, cmaiolino, djwong, dlemoal,
hans.holmberg, hch, preichl
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
---
libxfs/util.c | 2 +-
libxlog/xfs_log_recover.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/libxfs/util.c b/libxfs/util.c
index 13b8297f73..8dba3ef0c6 100644
--- a/libxfs/util.c
+++ b/libxfs/util.c
@@ -86,7 +86,7 @@
/* for trans header */
unit_bytes += sizeof(struct xlog_op_header);
- unit_bytes += sizeof(xfs_trans_header_t);
+ unit_bytes += sizeof(struct xfs_trans_header);
/* for start-rec */
unit_bytes += sizeof(struct xlog_op_header);
diff --git a/libxlog/xfs_log_recover.c b/libxlog/xfs_log_recover.c
index f46cb31977..83d12df656 100644
--- a/libxlog/xfs_log_recover.c
+++ b/libxlog/xfs_log_recover.c
@@ -1026,7 +1026,7 @@
/* finish copying rest of trans header */
xlog_recover_add_item(&trans->r_itemq);
ptr = (char *) &trans->r_theader +
- sizeof(xfs_trans_header_t) - len;
+ sizeof(struct xfs_trans_header) - len;
memcpy(ptr, dp, len); /* d, s, l */
return 0;
}
@@ -1079,7 +1079,7 @@
ASSERT(0);
return XFS_ERROR(EIO);
}
- if (len == sizeof(xfs_trans_header_t))
+ if (len == sizeof(struct xfs_trans_header))
xlog_recover_add_item(&trans->r_itemq);
memcpy(&trans->r_theader, dp, len); /* d, s, l */
return 0;
--
- Andrey
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v2 6/33] xfs: convert xfs_log_iovec_t typedef to struct
2025-12-05 15:01 [PATCH v2 0/34] xfsprogs: libxfs sync v6.18 Andrey Albershteyn
` (4 preceding siblings ...)
2025-12-05 15:01 ` [PATCH v2 5/33] xfs: convert xfs_trans_header_t typdef " Andrey Albershteyn
@ 2025-12-05 15:01 ` Andrey Albershteyn
2025-12-05 15:02 ` [PATCH v2 7/33] xfs: convert xfs_qoff_logformat_t " Andrey Albershteyn
` (27 subsequent siblings)
33 siblings, 0 replies; 35+ messages in thread
From: Andrey Albershteyn @ 2025-12-05 15:01 UTC (permalink / raw)
To: linux-xfs, aalbersh, cem, cmaiolino, djwong, dlemoal,
hans.holmberg, hch, preichl
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
---
libxlog/xfs_log_recover.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libxlog/xfs_log_recover.c b/libxlog/xfs_log_recover.c
index 83d12df656..3e7bbf08af 100644
--- a/libxlog/xfs_log_recover.c
+++ b/libxlog/xfs_log_recover.c
@@ -1112,8 +1112,8 @@
}
item->ri_total = in_f->ilf_size;
- item->ri_buf = kzalloc(item->ri_total * sizeof(xfs_log_iovec_t),
- 0);
+ item->ri_buf = kzalloc(
+ item->ri_total * sizeof(struct xfs_log_iovec), 0);
}
ASSERT(item->ri_total > item->ri_cnt);
/* Description region is ri_buf[0] */
--
- Andrey
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v2 7/33] xfs: convert xfs_qoff_logformat_t typedef to struct
2025-12-05 15:01 [PATCH v2 0/34] xfsprogs: libxfs sync v6.18 Andrey Albershteyn
` (5 preceding siblings ...)
2025-12-05 15:01 ` [PATCH v2 6/33] xfs: convert xfs_log_iovec_t typedef " Andrey Albershteyn
@ 2025-12-05 15:02 ` Andrey Albershteyn
2025-12-05 15:02 ` [PATCH v2 8/33] xfs: convert xfs_dq_logformat_t " Andrey Albershteyn
` (26 subsequent siblings)
33 siblings, 0 replies; 35+ messages in thread
From: Andrey Albershteyn @ 2025-12-05 15:02 UTC (permalink / raw)
To: linux-xfs, aalbersh, cem, cmaiolino, djwong, dlemoal,
hans.holmberg, hch, preichl
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
---
logprint/log_print_all.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/logprint/log_print_all.c b/logprint/log_print_all.c
index 0920c4871c..1d6cee99ba 100644
--- a/logprint/log_print_all.c
+++ b/logprint/log_print_all.c
@@ -181,11 +181,11 @@
STATIC void
xlog_recover_print_quotaoff(
- struct xlog_recover_item *item)
+ struct xlog_recover_item *item)
{
- xfs_qoff_logformat_t *qoff_f;
+ struct xfs_qoff_logformat *qoff_f;
- qoff_f = (xfs_qoff_logformat_t *)item->ri_buf[0].iov_base;
+ qoff_f = (struct xfs_qoff_logformat *)item->ri_buf[0].iov_base;
ASSERT(qoff_f);
printf(_("\tQUOTAOFF: #regs:%d type:"), qoff_f->qf_size);
--
- Andrey
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v2 8/33] xfs: convert xfs_dq_logformat_t typedef to struct
2025-12-05 15:01 [PATCH v2 0/34] xfsprogs: libxfs sync v6.18 Andrey Albershteyn
` (6 preceding siblings ...)
2025-12-05 15:02 ` [PATCH v2 7/33] xfs: convert xfs_qoff_logformat_t " Andrey Albershteyn
@ 2025-12-05 15:02 ` Andrey Albershteyn
2025-12-05 15:02 ` [PATCH v2 9/33] xfs: convert xfs_efi_log_format " Andrey Albershteyn
` (25 subsequent siblings)
33 siblings, 0 replies; 35+ messages in thread
From: Andrey Albershteyn @ 2025-12-05 15:02 UTC (permalink / raw)
To: linux-xfs, aalbersh, cem, cmaiolino, djwong, dlemoal,
hans.holmberg, hch, preichl
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
---
logprint/log_print_all.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/logprint/log_print_all.c b/logprint/log_print_all.c
index 1d6cee99ba..0afad597bb 100644
--- a/logprint/log_print_all.c
+++ b/logprint/log_print_all.c
@@ -202,10 +202,10 @@
xlog_recover_print_dquot(
struct xlog_recover_item *item)
{
- xfs_dq_logformat_t *f;
+ struct xfs_dq_logformat *f;
struct xfs_disk_dquot *d;
- f = (xfs_dq_logformat_t *)item->ri_buf[0].iov_base;
+ f = (struct xfs_dq_logformat *)item->ri_buf[0].iov_base;
ASSERT(f);
ASSERT(f->qlf_len == 1);
d = (struct xfs_disk_dquot *)item->ri_buf[1].iov_base;
--
- Andrey
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v2 9/33] xfs: convert xfs_efi_log_format typedef to struct
2025-12-05 15:01 [PATCH v2 0/34] xfsprogs: libxfs sync v6.18 Andrey Albershteyn
` (7 preceding siblings ...)
2025-12-05 15:02 ` [PATCH v2 8/33] xfs: convert xfs_dq_logformat_t " Andrey Albershteyn
@ 2025-12-05 15:02 ` Andrey Albershteyn
2025-12-05 15:02 ` [PATCH v2 10/33] xfs: convert xfs_efd_log_format_t " Andrey Albershteyn
` (24 subsequent siblings)
33 siblings, 0 replies; 35+ messages in thread
From: Andrey Albershteyn @ 2025-12-05 15:02 UTC (permalink / raw)
To: linux-xfs, aalbersh, cem, cmaiolino, djwong, dlemoal,
hans.holmberg, hch, preichl
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
---
logprint/log_redo.c | 47 ++++++++++++++++++++++++-----------------------
1 file changed, 24 insertions(+), 23 deletions(-)
diff --git a/logprint/log_redo.c b/logprint/log_redo.c
index e442d6f7cd..5581406d43 100644
--- a/logprint/log_redo.c
+++ b/logprint/log_redo.c
@@ -19,7 +19,7 @@
int continued)
{
uint i;
- uint nextents = ((xfs_efi_log_format_t *)buf)->efi_nextents;
+ uint nextents = ((struct xfs_efi_log_format *)buf)->efi_nextents;
uint dst_len = xfs_efi_log_format_sizeof(nextents);
uint len32 = xfs_efi_log_format32_sizeof(nextents);
uint len64 = xfs_efi_log_format64_sizeof(nextents);
@@ -63,23 +63,24 @@
int
xlog_print_trans_efi(
- char **ptr,
- uint src_len,
- int continued)
+ char **ptr,
+ uint src_len,
+ int continued)
{
- const char *item_name = "EFI?";
- xfs_efi_log_format_t *src_f, *f = NULL;
- uint dst_len;
- xfs_extent_t *ex;
- int i;
- int error = 0;
- int core_size = offsetof(xfs_efi_log_format_t, efi_extents);
+ const char *item_name = "EFI?";
+ struct xfs_efi_log_format *src_f, *f = NULL;
+ uint dst_len;
+ xfs_extent_t *ex;
+ int i;
+ int error = 0;
+ int core_size = offsetof(
+ struct xfs_efi_log_format, efi_extents);
/*
* memmove to ensure 8-byte alignment for the long longs in
- * xfs_efi_log_format_t structure
+ * xfs_efi_log_format structure
*/
- if ((src_f = (xfs_efi_log_format_t *)malloc(src_len)) == NULL) {
+ if ((src_f = (struct xfs_efi_log_format *)malloc(src_len)) == NULL) {
fprintf(stderr, _("%s: xlog_print_trans_efi: malloc failed\n"), progname);
exit(1);
}
@@ -95,7 +96,7 @@
goto error;
}
- if ((f = (xfs_efi_log_format_t *)malloc(dst_len)) == NULL) {
+ if ((f = (struct xfs_efi_log_format *)malloc(dst_len)) == NULL) {
fprintf(stderr, _("%s: xlog_print_trans_efi: malloc failed\n"), progname);
exit(1);
}
@@ -135,15 +136,15 @@
void
xlog_recover_print_efi(
- struct xlog_recover_item *item)
+ struct xlog_recover_item *item)
{
- const char *item_name = "EFI?";
- xfs_efi_log_format_t *f, *src_f;
- xfs_extent_t *ex;
- int i;
- uint src_len, dst_len;
+ const char *item_name = "EFI?";
+ struct xfs_efi_log_format *f, *src_f;
+ xfs_extent_t *ex;
+ int i;
+ uint src_len, dst_len;
- src_f = (xfs_efi_log_format_t *)item->ri_buf[0].iov_base;
+ src_f = (struct xfs_efi_log_format *)item->ri_buf[0].iov_base;
src_len = item->ri_buf[0].iov_len;
/*
* An xfs_efi_log_format structure contains a variable length array
@@ -151,9 +152,9 @@
* Each element is of size xfs_extent_32_t or xfs_extent_64_t.
* Need to convert to native format.
*/
- dst_len = sizeof(xfs_efi_log_format_t) +
+ dst_len = sizeof(struct xfs_efi_log_format) +
(src_f->efi_nextents) * sizeof(xfs_extent_t);
- if ((f = (xfs_efi_log_format_t *)malloc(dst_len)) == NULL) {
+ if ((f = (struct xfs_efi_log_format *)malloc(dst_len)) == NULL) {
fprintf(stderr, _("%s: xlog_recover_print_efi: malloc failed\n"),
progname);
exit(1);
--
- Andrey
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v2 10/33] xfs: convert xfs_efd_log_format_t typedef to struct
2025-12-05 15:01 [PATCH v2 0/34] xfsprogs: libxfs sync v6.18 Andrey Albershteyn
` (8 preceding siblings ...)
2025-12-05 15:02 ` [PATCH v2 9/33] xfs: convert xfs_efi_log_format " Andrey Albershteyn
@ 2025-12-05 15:02 ` Andrey Albershteyn
2025-12-05 15:02 ` [PATCH v2 11/33] xfs: convert xfs_efi_log_format_32_t " Andrey Albershteyn
` (23 subsequent siblings)
33 siblings, 0 replies; 35+ messages in thread
From: Andrey Albershteyn @ 2025-12-05 15:02 UTC (permalink / raw)
To: linux-xfs, aalbersh, cem, cmaiolino, djwong, dlemoal,
hans.holmberg, hch, preichl
Align function arguments to new longer variable type and fix comment in
xlog_print_trans_rud() with wrong xfs_efd_log_format mention.
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
---
logprint/log_redo.c | 24 +++++++++++++-----------
1 file changed, 13 insertions(+), 11 deletions(-)
diff --git a/logprint/log_redo.c b/logprint/log_redo.c
index 5581406d43..b957056c87 100644
--- a/logprint/log_redo.c
+++ b/logprint/log_redo.c
@@ -187,18 +187,20 @@
}
int
-xlog_print_trans_efd(char **ptr, uint len)
+xlog_print_trans_efd(
+ char **ptr,
+ uint len)
{
- const char *item_name = "EFD?";
- xfs_efd_log_format_t *f;
- xfs_efd_log_format_t lbuf;
+ const char *item_name = "EFD?";
+ struct xfs_efd_log_format *f;
+ struct xfs_efd_log_format lbuf;
/* size without extents at end */
- uint core_size = sizeof(xfs_efd_log_format_t);
+ uint core_size = sizeof(struct xfs_efd_log_format);
/*
* memmove to ensure 8-byte alignment for the long longs in
- * xfs_efd_log_format_t structure
+ * xfs_efd_log_format structure
*/
memmove(&lbuf, *ptr, min(core_size, len));
f = &lbuf;
@@ -225,12 +227,12 @@
void
xlog_recover_print_efd(
- struct xlog_recover_item *item)
+ struct xlog_recover_item *item)
{
- const char *item_name = "EFD?";
- xfs_efd_log_format_t *f;
+ const char *item_name = "EFD?";
+ struct xfs_efd_log_format *f;
- f = (xfs_efd_log_format_t *)item->ri_buf[0].iov_base;
+ f = (struct xfs_efd_log_format *)item->ri_buf[0].iov_base;
switch (f->efd_type) {
case XFS_LI_EFD: item_name = "EFD"; break;
@@ -376,7 +378,7 @@
/*
* memmove to ensure 8-byte alignment for the long longs in
- * xfs_efd_log_format_t structure
+ * xfs_rud_log_format structure
*/
memmove(&lbuf, *ptr, min(core_size, len));
f = &lbuf;
--
- Andrey
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v2 11/33] xfs: convert xfs_efi_log_format_32_t typedef to struct
2025-12-05 15:01 [PATCH v2 0/34] xfsprogs: libxfs sync v6.18 Andrey Albershteyn
` (9 preceding siblings ...)
2025-12-05 15:02 ` [PATCH v2 10/33] xfs: convert xfs_efd_log_format_t " Andrey Albershteyn
@ 2025-12-05 15:02 ` Andrey Albershteyn
2025-12-05 15:02 ` [PATCH v2 12/33] xfs: convert xfs_extent_t " Andrey Albershteyn
` (22 subsequent siblings)
33 siblings, 0 replies; 35+ messages in thread
From: Andrey Albershteyn @ 2025-12-05 15:02 UTC (permalink / raw)
To: linux-xfs, aalbersh, cem, cmaiolino, djwong, dlemoal,
hans.holmberg, hch, preichl
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
---
logprint/log_redo.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/logprint/log_redo.c b/logprint/log_redo.c
index b957056c87..cabf5ad470 100644
--- a/logprint/log_redo.c
+++ b/logprint/log_redo.c
@@ -28,7 +28,8 @@
memcpy((char *)dst_efi_fmt, buf, len);
return 0;
} else if (len == len32) {
- xfs_efi_log_format_32_t *src_efi_fmt_32 = (xfs_efi_log_format_32_t *)buf;
+ struct xfs_efi_log_format_32 *src_efi_fmt_32 =
+ (struct xfs_efi_log_format_32 *)buf;
dst_efi_fmt->efi_type = src_efi_fmt_32->efi_type;
dst_efi_fmt->efi_size = src_efi_fmt_32->efi_size;
--
- Andrey
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v2 12/33] xfs: convert xfs_extent_t typedef to struct
2025-12-05 15:01 [PATCH v2 0/34] xfsprogs: libxfs sync v6.18 Andrey Albershteyn
` (10 preceding siblings ...)
2025-12-05 15:02 ` [PATCH v2 11/33] xfs: convert xfs_efi_log_format_32_t " Andrey Albershteyn
@ 2025-12-05 15:02 ` Andrey Albershteyn
2025-12-05 15:02 ` [PATCH v2 13/33] xfs: convert xfs_efi_log_format_64_t " Andrey Albershteyn
` (21 subsequent siblings)
33 siblings, 0 replies; 35+ messages in thread
From: Andrey Albershteyn @ 2025-12-05 15:02 UTC (permalink / raw)
To: linux-xfs, aalbersh, cem, cmaiolino, djwong, dlemoal,
hans.holmberg, hch, preichl
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
---
logprint/log_redo.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/logprint/log_redo.c b/logprint/log_redo.c
index cabf5ad470..cdd6e8b763 100644
--- a/logprint/log_redo.c
+++ b/logprint/log_redo.c
@@ -71,7 +71,7 @@
const char *item_name = "EFI?";
struct xfs_efi_log_format *src_f, *f = NULL;
uint dst_len;
- xfs_extent_t *ex;
+ struct xfs_extent *ex;
int i;
int error = 0;
int core_size = offsetof(
@@ -141,7 +141,7 @@
{
const char *item_name = "EFI?";
struct xfs_efi_log_format *f, *src_f;
- xfs_extent_t *ex;
+ struct xfs_extent *ex;
int i;
uint src_len, dst_len;
@@ -154,7 +154,7 @@
* Need to convert to native format.
*/
dst_len = sizeof(struct xfs_efi_log_format) +
- (src_f->efi_nextents) * sizeof(xfs_extent_t);
+ (src_f->efi_nextents) * sizeof(struct xfs_extent);
if ((f = (struct xfs_efi_log_format *)malloc(dst_len)) == NULL) {
fprintf(stderr, _("%s: xlog_recover_print_efi: malloc failed\n"),
progname);
--
- Andrey
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v2 13/33] xfs: convert xfs_efi_log_format_64_t typedef to struct
2025-12-05 15:01 [PATCH v2 0/34] xfsprogs: libxfs sync v6.18 Andrey Albershteyn
` (11 preceding siblings ...)
2025-12-05 15:02 ` [PATCH v2 12/33] xfs: convert xfs_extent_t " Andrey Albershteyn
@ 2025-12-05 15:02 ` Andrey Albershteyn
2025-12-05 15:02 ` [PATCH v2 14/33] xfs: remove the xlog_op_header_t typedef Andrey Albershteyn
` (20 subsequent siblings)
33 siblings, 0 replies; 35+ messages in thread
From: Andrey Albershteyn @ 2025-12-05 15:02 UTC (permalink / raw)
To: linux-xfs, aalbersh, cem, cmaiolino, djwong, dlemoal,
hans.holmberg, hch, preichl
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
---
logprint/log_redo.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/logprint/log_redo.c b/logprint/log_redo.c
index cdd6e8b763..38caf5a25e 100644
--- a/logprint/log_redo.c
+++ b/logprint/log_redo.c
@@ -43,7 +43,8 @@
}
return 0;
} else if (len == len64) {
- xfs_efi_log_format_64_t *src_efi_fmt_64 = (xfs_efi_log_format_64_t *)buf;
+ struct xfs_efi_log_format_64 *src_efi_fmt_64 =
+ (struct xfs_efi_log_format_64 *)buf;
dst_efi_fmt->efi_type = src_efi_fmt_64->efi_type;
dst_efi_fmt->efi_size = src_efi_fmt_64->efi_size;
--
- Andrey
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v2 14/33] xfs: remove the xlog_op_header_t typedef
2025-12-05 15:01 [PATCH v2 0/34] xfsprogs: libxfs sync v6.18 Andrey Albershteyn
` (12 preceding siblings ...)
2025-12-05 15:02 ` [PATCH v2 13/33] xfs: convert xfs_efi_log_format_64_t " Andrey Albershteyn
@ 2025-12-05 15:02 ` Andrey Albershteyn
2025-12-05 15:02 ` [PATCH v2 15/33] xfs: remove the xfs_trans_header_t typedef Andrey Albershteyn
` (19 subsequent siblings)
33 siblings, 0 replies; 35+ messages in thread
From: Andrey Albershteyn @ 2025-12-05 15:02 UTC (permalink / raw)
To: linux-xfs, aalbersh, cem, cmaiolino, djwong, dlemoal,
hans.holmberg, hch, preichl
From: Christoph Hellwig <hch@lst.de>
Source kernel commit: eff8668607888988cad7b31528ff08d8883c5d7e
There are almost no users of the typedef left, kill it and switch the
remaining users to use the underlying struct.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
---
libxfs/xfs_log_format.h | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/libxfs/xfs_log_format.h b/libxfs/xfs_log_format.h
index 0d637c276d..367dfdece9 100644
--- a/libxfs/xfs_log_format.h
+++ b/libxfs/xfs_log_format.h
@@ -141,14 +141,13 @@
#define XLOG_END_TRANS 0x10 /* End a continued transaction */
#define XLOG_UNMOUNT_TRANS 0x20 /* Unmount a filesystem transaction */
-
-typedef struct xlog_op_header {
+struct xlog_op_header {
__be32 oh_tid; /* transaction id of operation : 4 b */
__be32 oh_len; /* bytes in data region : 4 b */
__u8 oh_clientid; /* who sent me this : 1 b */
__u8 oh_flags; /* : 1 b */
__u16 oh_res2; /* 32 bit align : 2 b */
-} xlog_op_header_t;
+};
/* valid values for h_fmt */
#define XLOG_FMT_UNKNOWN 0
--
- Andrey
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v2 15/33] xfs: remove the xfs_trans_header_t typedef
2025-12-05 15:01 [PATCH v2 0/34] xfsprogs: libxfs sync v6.18 Andrey Albershteyn
` (13 preceding siblings ...)
2025-12-05 15:02 ` [PATCH v2 14/33] xfs: remove the xlog_op_header_t typedef Andrey Albershteyn
@ 2025-12-05 15:02 ` Andrey Albershteyn
2025-12-05 15:02 ` [PATCH v2 16/33] xfs: remove the xfs_extent_t typedef Andrey Albershteyn
` (18 subsequent siblings)
33 siblings, 0 replies; 35+ messages in thread
From: Andrey Albershteyn @ 2025-12-05 15:02 UTC (permalink / raw)
To: linux-xfs, aalbersh, cem, cmaiolino, djwong, dlemoal,
hans.holmberg, hch, preichl
From: Christoph Hellwig <hch@lst.de>
Source kernel commit: 05f17dcbfd5dbe309af310508d8830ac4e0c5d4c
There are almost no users of the typedef left, kill it and switch the
remaining users to use the underlying struct.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
---
libxfs/xfs_log_format.h | 4 ++--
libxfs/xfs_log_recover.h | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/libxfs/xfs_log_format.h b/libxfs/xfs_log_format.h
index 367dfdece9..2c3c5e67f7 100644
--- a/libxfs/xfs_log_format.h
+++ b/libxfs/xfs_log_format.h
@@ -212,12 +212,12 @@
* Do not change the below structure without redoing the code in
* xlog_recover_add_to_trans() and xlog_recover_add_to_cont_trans().
*/
-typedef struct xfs_trans_header {
+struct xfs_trans_header {
uint th_magic; /* magic number */
uint th_type; /* transaction type */
int32_t th_tid; /* transaction id (unused) */
uint th_num_items; /* num items logged by trans */
-} xfs_trans_header_t;
+};
#define XFS_TRANS_HEADER_MAGIC 0x5452414e /* TRAN */
diff --git a/libxfs/xfs_log_recover.h b/libxfs/xfs_log_recover.h
index 95de230950..9e712e6236 100644
--- a/libxfs/xfs_log_recover.h
+++ b/libxfs/xfs_log_recover.h
@@ -111,7 +111,7 @@
struct xlog_recover {
struct hlist_node r_list;
xlog_tid_t r_log_tid; /* log's transaction id */
- xfs_trans_header_t r_theader; /* trans header for partial */
+ struct xfs_trans_header r_theader; /* trans header for partial */
int r_state; /* not needed */
xfs_lsn_t r_lsn; /* xact lsn */
struct list_head r_itemq; /* q for items */
--
- Andrey
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v2 16/33] xfs: remove the xfs_extent_t typedef
2025-12-05 15:01 [PATCH v2 0/34] xfsprogs: libxfs sync v6.18 Andrey Albershteyn
` (14 preceding siblings ...)
2025-12-05 15:02 ` [PATCH v2 15/33] xfs: remove the xfs_trans_header_t typedef Andrey Albershteyn
@ 2025-12-05 15:02 ` Andrey Albershteyn
2025-12-05 15:02 ` [PATCH v2 17/33] xfs: remove the xfs_extent32_t typedef Andrey Albershteyn
` (17 subsequent siblings)
33 siblings, 0 replies; 35+ messages in thread
From: Andrey Albershteyn @ 2025-12-05 15:02 UTC (permalink / raw)
To: linux-xfs, aalbersh, cem, cmaiolino, djwong, dlemoal,
hans.holmberg, hch, preichl
From: Christoph Hellwig <hch@lst.de>
Source kernel commit: 476688c8ac60da9bfcb3ce7f5a2d30a145ef7f76
There are almost no users of the typedef left, kill it and switch the
remaining users to use the underlying struct.
Also fix up the comment about the struct xfs_extent definition to be
correct and read more easily.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
---
libxfs/xfs_log_format.h | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/libxfs/xfs_log_format.h b/libxfs/xfs_log_format.h
index 2c3c5e67f7..6d0cad455a 100644
--- a/libxfs/xfs_log_format.h
+++ b/libxfs/xfs_log_format.h
@@ -605,16 +605,17 @@
/*
* EFI/EFD log format definitions
*/
-typedef struct xfs_extent {
+struct xfs_extent {
xfs_fsblock_t ext_start;
xfs_extlen_t ext_len;
-} xfs_extent_t;
+};
/*
- * Since an xfs_extent_t has types (start:64, len: 32)
- * there are different alignments on 32 bit and 64 bit kernels.
- * So we provide the different variants for use by a
- * conversion routine.
+ * Since the structures in struct xfs_extent add up to 96 bytes, it has
+ * different alignments on i386 vs all other architectures, because i386
+ * does not pad structures to their natural alignment.
+ *
+ * Provide the different variants for use by a conversion routine.
*/
typedef struct xfs_extent_32 {
uint64_t ext_start;
@@ -637,7 +638,7 @@
uint16_t efi_size; /* size of this item */
uint32_t efi_nextents; /* # extents to free */
uint64_t efi_id; /* efi identifier */
- xfs_extent_t efi_extents[]; /* array of extents to free */
+ struct xfs_extent efi_extents[]; /* array of extents to free */
} xfs_efi_log_format_t;
static inline size_t
@@ -690,7 +691,7 @@
uint16_t efd_size; /* size of this item */
uint32_t efd_nextents; /* # of extents freed */
uint64_t efd_efi_id; /* id of corresponding efi */
- xfs_extent_t efd_extents[]; /* array of extents freed */
+ struct xfs_extent efd_extents[]; /* array of extents freed */
} xfs_efd_log_format_t;
static inline size_t
--
- Andrey
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v2 17/33] xfs: remove the xfs_extent32_t typedef
2025-12-05 15:01 [PATCH v2 0/34] xfsprogs: libxfs sync v6.18 Andrey Albershteyn
` (15 preceding siblings ...)
2025-12-05 15:02 ` [PATCH v2 16/33] xfs: remove the xfs_extent_t typedef Andrey Albershteyn
@ 2025-12-05 15:02 ` Andrey Albershteyn
2025-12-05 15:03 ` [PATCH v2 18/33] xfs: remove the xfs_extent64_t typedef Andrey Albershteyn
` (16 subsequent siblings)
33 siblings, 0 replies; 35+ messages in thread
From: Andrey Albershteyn @ 2025-12-05 15:02 UTC (permalink / raw)
To: linux-xfs, aalbersh, cem, cmaiolino, djwong, dlemoal,
hans.holmberg, hch, preichl
From: Christoph Hellwig <hch@lst.de>
Source kernel commit: 7eaf684bc48923b5584fc119e8c477be2cdb3eb2
There are almost no users of the typedef left, kill it and switch the
remaining users to use the underlying struct.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
---
libxfs/xfs_log_format.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/libxfs/xfs_log_format.h b/libxfs/xfs_log_format.h
index 6d0cad455a..f11ba20a16 100644
--- a/libxfs/xfs_log_format.h
+++ b/libxfs/xfs_log_format.h
@@ -617,10 +617,10 @@
*
* Provide the different variants for use by a conversion routine.
*/
-typedef struct xfs_extent_32 {
+struct xfs_extent_32 {
uint64_t ext_start;
uint32_t ext_len;
-} __attribute__((packed)) xfs_extent_32_t;
+} __attribute__((packed));
typedef struct xfs_extent_64 {
uint64_t ext_start;
@@ -654,7 +654,7 @@
uint16_t efi_size; /* size of this item */
uint32_t efi_nextents; /* # extents to free */
uint64_t efi_id; /* efi identifier */
- xfs_extent_32_t efi_extents[]; /* array of extents to free */
+ struct xfs_extent_32 efi_extents[]; /* array of extents to free */
} __attribute__((packed)) xfs_efi_log_format_32_t;
static inline size_t
@@ -707,7 +707,7 @@
uint16_t efd_size; /* size of this item */
uint32_t efd_nextents; /* # of extents freed */
uint64_t efd_efi_id; /* id of corresponding efi */
- xfs_extent_32_t efd_extents[]; /* array of extents freed */
+ struct xfs_extent_32 efd_extents[]; /* array of extents freed */
} __attribute__((packed)) xfs_efd_log_format_32_t;
static inline size_t
--
- Andrey
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v2 18/33] xfs: remove the xfs_extent64_t typedef
2025-12-05 15:01 [PATCH v2 0/34] xfsprogs: libxfs sync v6.18 Andrey Albershteyn
` (16 preceding siblings ...)
2025-12-05 15:02 ` [PATCH v2 17/33] xfs: remove the xfs_extent32_t typedef Andrey Albershteyn
@ 2025-12-05 15:03 ` Andrey Albershteyn
2025-12-05 15:03 ` [PATCH v2 19/33] xfs: remove the xfs_efi_log_format_t typedef Andrey Albershteyn
` (15 subsequent siblings)
33 siblings, 0 replies; 35+ messages in thread
From: Andrey Albershteyn @ 2025-12-05 15:03 UTC (permalink / raw)
To: linux-xfs, aalbersh, cem, cmaiolino, djwong, dlemoal,
hans.holmberg, hch, preichl
From: Christoph Hellwig <hch@lst.de>
Source kernel commit: 72628b6f459ea4fed3003db8161b52ee746442d0
There are almost no users of the typedef left, kill it and switch the
remaining users to use the underlying struct.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
---
libxfs/xfs_log_format.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/libxfs/xfs_log_format.h b/libxfs/xfs_log_format.h
index f11ba20a16..2b270912e5 100644
--- a/libxfs/xfs_log_format.h
+++ b/libxfs/xfs_log_format.h
@@ -622,11 +622,11 @@
uint32_t ext_len;
} __attribute__((packed));
-typedef struct xfs_extent_64 {
+struct xfs_extent_64 {
uint64_t ext_start;
uint32_t ext_len;
uint32_t ext_pad;
-} xfs_extent_64_t;
+};
/*
* This is the structure used to lay out an efi log item in the
@@ -670,7 +670,7 @@
uint16_t efi_size; /* size of this item */
uint32_t efi_nextents; /* # extents to free */
uint64_t efi_id; /* efi identifier */
- xfs_extent_64_t efi_extents[]; /* array of extents to free */
+ struct xfs_extent_64 efi_extents[]; /* array of extents to free */
} xfs_efi_log_format_64_t;
static inline size_t
@@ -723,7 +723,7 @@
uint16_t efd_size; /* size of this item */
uint32_t efd_nextents; /* # of extents freed */
uint64_t efd_efi_id; /* id of corresponding efi */
- xfs_extent_64_t efd_extents[]; /* array of extents freed */
+ struct xfs_extent_64 efd_extents[]; /* array of extents freed */
} xfs_efd_log_format_64_t;
static inline size_t
--
- Andrey
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v2 19/33] xfs: remove the xfs_efi_log_format_t typedef
2025-12-05 15:01 [PATCH v2 0/34] xfsprogs: libxfs sync v6.18 Andrey Albershteyn
` (17 preceding siblings ...)
2025-12-05 15:03 ` [PATCH v2 18/33] xfs: remove the xfs_extent64_t typedef Andrey Albershteyn
@ 2025-12-05 15:03 ` Andrey Albershteyn
2025-12-05 15:03 ` [PATCH v2 20/33] xfs: remove the xfs_efi_log_format_32_t typedef Andrey Albershteyn
` (14 subsequent siblings)
33 siblings, 0 replies; 35+ messages in thread
From: Andrey Albershteyn @ 2025-12-05 15:03 UTC (permalink / raw)
To: linux-xfs, aalbersh, cem, cmaiolino, djwong, dlemoal,
hans.holmberg, hch, preichl
From: Christoph Hellwig <hch@lst.de>
Source kernel commit: 655d9ec7bd9e38735ae36dbc635a9161a046f7b9
There are almost no users of the typedef left, kill it and switch the
remaining users to use the underlying struct.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
---
libxfs/xfs_log_format.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libxfs/xfs_log_format.h b/libxfs/xfs_log_format.h
index 2b270912e5..81c84c8a66 100644
--- a/libxfs/xfs_log_format.h
+++ b/libxfs/xfs_log_format.h
@@ -633,13 +633,13 @@
* log. The efi_extents field is a variable size array whose
* size is given by efi_nextents.
*/
-typedef struct xfs_efi_log_format {
+struct xfs_efi_log_format {
uint16_t efi_type; /* efi log item type */
uint16_t efi_size; /* size of this item */
uint32_t efi_nextents; /* # extents to free */
uint64_t efi_id; /* efi identifier */
struct xfs_extent efi_extents[]; /* array of extents to free */
-} xfs_efi_log_format_t;
+};
static inline size_t
xfs_efi_log_format_sizeof(
--
- Andrey
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v2 20/33] xfs: remove the xfs_efi_log_format_32_t typedef
2025-12-05 15:01 [PATCH v2 0/34] xfsprogs: libxfs sync v6.18 Andrey Albershteyn
` (18 preceding siblings ...)
2025-12-05 15:03 ` [PATCH v2 19/33] xfs: remove the xfs_efi_log_format_t typedef Andrey Albershteyn
@ 2025-12-05 15:03 ` Andrey Albershteyn
2025-12-05 15:03 ` [PATCH v2 21/33] xfs: remove the xfs_efi_log_format_64_t typedef Andrey Albershteyn
` (13 subsequent siblings)
33 siblings, 0 replies; 35+ messages in thread
From: Andrey Albershteyn @ 2025-12-05 15:03 UTC (permalink / raw)
To: linux-xfs, aalbersh, cem, cmaiolino, djwong, dlemoal,
hans.holmberg, hch, preichl
From: Christoph Hellwig <hch@lst.de>
Source kernel commit: 68c9f8444ae930343a2c900cb909825bc8f7304a
There are almost no users of the typedef left, kill it and switch the
remaining users to use the underlying struct.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
---
libxfs/xfs_log_format.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libxfs/xfs_log_format.h b/libxfs/xfs_log_format.h
index 81c84c8a66..75cc8b9be5 100644
--- a/libxfs/xfs_log_format.h
+++ b/libxfs/xfs_log_format.h
@@ -649,13 +649,13 @@
nr * sizeof(struct xfs_extent);
}
-typedef struct xfs_efi_log_format_32 {
+struct xfs_efi_log_format_32 {
uint16_t efi_type; /* efi log item type */
uint16_t efi_size; /* size of this item */
uint32_t efi_nextents; /* # extents to free */
uint64_t efi_id; /* efi identifier */
struct xfs_extent_32 efi_extents[]; /* array of extents to free */
-} __attribute__((packed)) xfs_efi_log_format_32_t;
+} __attribute__((packed));
static inline size_t
xfs_efi_log_format32_sizeof(
--
- Andrey
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v2 21/33] xfs: remove the xfs_efi_log_format_64_t typedef
2025-12-05 15:01 [PATCH v2 0/34] xfsprogs: libxfs sync v6.18 Andrey Albershteyn
` (19 preceding siblings ...)
2025-12-05 15:03 ` [PATCH v2 20/33] xfs: remove the xfs_efi_log_format_32_t typedef Andrey Albershteyn
@ 2025-12-05 15:03 ` Andrey Albershteyn
2025-12-05 15:03 ` [PATCH v2 22/33] xfs: remove the xfs_efd_log_format_t typedef Andrey Albershteyn
` (12 subsequent siblings)
33 siblings, 0 replies; 35+ messages in thread
From: Andrey Albershteyn @ 2025-12-05 15:03 UTC (permalink / raw)
To: linux-xfs, aalbersh, cem, cmaiolino, djwong, dlemoal,
hans.holmberg, hch, preichl
From: Christoph Hellwig <hch@lst.de>
Source kernel commit: 3fe5abc2bf4db88c7c9c99e8a1f5b3d1336d528f
There are almost no users of the typedef left, kill it and switch the
remaining users to use the underlying struct.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
---
libxfs/xfs_log_format.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libxfs/xfs_log_format.h b/libxfs/xfs_log_format.h
index 75cc8b9be5..358f7cb43b 100644
--- a/libxfs/xfs_log_format.h
+++ b/libxfs/xfs_log_format.h
@@ -665,13 +665,13 @@
nr * sizeof(struct xfs_extent_32);
}
-typedef struct xfs_efi_log_format_64 {
+struct xfs_efi_log_format_64 {
uint16_t efi_type; /* efi log item type */
uint16_t efi_size; /* size of this item */
uint32_t efi_nextents; /* # extents to free */
uint64_t efi_id; /* efi identifier */
struct xfs_extent_64 efi_extents[]; /* array of extents to free */
-} xfs_efi_log_format_64_t;
+};
static inline size_t
xfs_efi_log_format64_sizeof(
--
- Andrey
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v2 22/33] xfs: remove the xfs_efd_log_format_t typedef
2025-12-05 15:01 [PATCH v2 0/34] xfsprogs: libxfs sync v6.18 Andrey Albershteyn
` (20 preceding siblings ...)
2025-12-05 15:03 ` [PATCH v2 21/33] xfs: remove the xfs_efi_log_format_64_t typedef Andrey Albershteyn
@ 2025-12-05 15:03 ` Andrey Albershteyn
2025-12-05 15:03 ` [PATCH v2 23/33] xfs: remove the unused xfs_efd_log_format_32_t typedef Andrey Albershteyn
` (11 subsequent siblings)
33 siblings, 0 replies; 35+ messages in thread
From: Andrey Albershteyn @ 2025-12-05 15:03 UTC (permalink / raw)
To: linux-xfs, aalbersh, cem, cmaiolino, djwong, dlemoal,
hans.holmberg, hch, preichl
From: Christoph Hellwig <hch@lst.de>
Source kernel commit: 0a33d5ad8a46d1f63174d2684b1d743bd6090554
There are almost no users of the typedef left, kill it and switch the
remaining users to use the underlying struct.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
---
libxfs/xfs_log_format.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libxfs/xfs_log_format.h b/libxfs/xfs_log_format.h
index 358f7cb43b..cb63bb156d 100644
--- a/libxfs/xfs_log_format.h
+++ b/libxfs/xfs_log_format.h
@@ -686,13 +686,13 @@
* log. The efd_extents array is a variable size array whose
* size is given by efd_nextents;
*/
-typedef struct xfs_efd_log_format {
+struct xfs_efd_log_format {
uint16_t efd_type; /* efd log item type */
uint16_t efd_size; /* size of this item */
uint32_t efd_nextents; /* # of extents freed */
uint64_t efd_efi_id; /* id of corresponding efi */
struct xfs_extent efd_extents[]; /* array of extents freed */
-} xfs_efd_log_format_t;
+};
static inline size_t
xfs_efd_log_format_sizeof(
--
- Andrey
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v2 23/33] xfs: remove the unused xfs_efd_log_format_32_t typedef
2025-12-05 15:01 [PATCH v2 0/34] xfsprogs: libxfs sync v6.18 Andrey Albershteyn
` (21 preceding siblings ...)
2025-12-05 15:03 ` [PATCH v2 22/33] xfs: remove the xfs_efd_log_format_t typedef Andrey Albershteyn
@ 2025-12-05 15:03 ` Andrey Albershteyn
2025-12-05 15:03 ` [PATCH v2 24/33] xfs: remove the unused xfs_efd_log_format_64_t typedef Andrey Albershteyn
` (10 subsequent siblings)
33 siblings, 0 replies; 35+ messages in thread
From: Andrey Albershteyn @ 2025-12-05 15:03 UTC (permalink / raw)
To: linux-xfs, aalbersh, cem, cmaiolino, djwong, dlemoal,
hans.holmberg, hch, preichl
From: Christoph Hellwig <hch@lst.de>
Source kernel commit: a0cb349672f9ac2dcd80afa3dd25e2df2842db7a
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
---
libxfs/xfs_log_format.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libxfs/xfs_log_format.h b/libxfs/xfs_log_format.h
index cb63bb156d..2155cc6b2a 100644
--- a/libxfs/xfs_log_format.h
+++ b/libxfs/xfs_log_format.h
@@ -702,13 +702,13 @@
nr * sizeof(struct xfs_extent);
}
-typedef struct xfs_efd_log_format_32 {
+struct xfs_efd_log_format_32 {
uint16_t efd_type; /* efd log item type */
uint16_t efd_size; /* size of this item */
uint32_t efd_nextents; /* # of extents freed */
uint64_t efd_efi_id; /* id of corresponding efi */
struct xfs_extent_32 efd_extents[]; /* array of extents freed */
-} __attribute__((packed)) xfs_efd_log_format_32_t;
+} __attribute__((packed));
static inline size_t
xfs_efd_log_format32_sizeof(
--
- Andrey
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v2 24/33] xfs: remove the unused xfs_efd_log_format_64_t typedef
2025-12-05 15:01 [PATCH v2 0/34] xfsprogs: libxfs sync v6.18 Andrey Albershteyn
` (22 preceding siblings ...)
2025-12-05 15:03 ` [PATCH v2 23/33] xfs: remove the unused xfs_efd_log_format_32_t typedef Andrey Albershteyn
@ 2025-12-05 15:03 ` Andrey Albershteyn
2025-12-05 15:03 ` [PATCH v2 25/33] xfs: remove the unused xfs_buf_log_format_t typedef Andrey Albershteyn
` (9 subsequent siblings)
33 siblings, 0 replies; 35+ messages in thread
From: Andrey Albershteyn @ 2025-12-05 15:03 UTC (permalink / raw)
To: linux-xfs, aalbersh, cem, cmaiolino, djwong, dlemoal,
hans.holmberg, hch, preichl
From: Christoph Hellwig <hch@lst.de>
Source kernel commit: 3dde08b64c98cf76b2e2378ecf36351464e2972a
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
---
libxfs/xfs_log_format.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libxfs/xfs_log_format.h b/libxfs/xfs_log_format.h
index 2155cc6b2a..aa8e3b5577 100644
--- a/libxfs/xfs_log_format.h
+++ b/libxfs/xfs_log_format.h
@@ -718,13 +718,13 @@
nr * sizeof(struct xfs_extent_32);
}
-typedef struct xfs_efd_log_format_64 {
+struct xfs_efd_log_format_64 {
uint16_t efd_type; /* efd log item type */
uint16_t efd_size; /* size of this item */
uint32_t efd_nextents; /* # of extents freed */
uint64_t efd_efi_id; /* id of corresponding efi */
struct xfs_extent_64 efd_extents[]; /* array of extents freed */
-} xfs_efd_log_format_64_t;
+};
static inline size_t
xfs_efd_log_format64_sizeof(
--
- Andrey
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v2 25/33] xfs: remove the unused xfs_buf_log_format_t typedef
2025-12-05 15:01 [PATCH v2 0/34] xfsprogs: libxfs sync v6.18 Andrey Albershteyn
` (23 preceding siblings ...)
2025-12-05 15:03 ` [PATCH v2 24/33] xfs: remove the unused xfs_efd_log_format_64_t typedef Andrey Albershteyn
@ 2025-12-05 15:03 ` Andrey Albershteyn
2025-12-05 15:03 ` [PATCH v2 26/33] xfs: remove the unused xfs_dq_logformat_t typedef Andrey Albershteyn
` (8 subsequent siblings)
33 siblings, 0 replies; 35+ messages in thread
From: Andrey Albershteyn @ 2025-12-05 15:03 UTC (permalink / raw)
To: linux-xfs, aalbersh, cem, cmaiolino, djwong, dlemoal,
hans.holmberg, hch, preichl
From: Christoph Hellwig <hch@lst.de>
Source kernel commit: 1b5c7cc8f8c54858f69311290d5ade12627ff233
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
---
libxfs/xfs_log_format.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libxfs/xfs_log_format.h b/libxfs/xfs_log_format.h
index aa8e3b5577..631af2e28c 100644
--- a/libxfs/xfs_log_format.h
+++ b/libxfs/xfs_log_format.h
@@ -541,7 +541,7 @@
#define __XFS_BLF_DATAMAP_SIZE ((XFS_MAX_BLOCKSIZE / XFS_BLF_CHUNK) / NBWORD)
#define XFS_BLF_DATAMAP_SIZE (__XFS_BLF_DATAMAP_SIZE + 1)
-typedef struct xfs_buf_log_format {
+struct xfs_buf_log_format {
unsigned short blf_type; /* buf log item type indicator */
unsigned short blf_size; /* size of this item */
unsigned short blf_flags; /* misc state */
@@ -549,7 +549,7 @@
int64_t blf_blkno; /* starting blkno of this buf */
unsigned int blf_map_size; /* used size of data bitmap in words */
unsigned int blf_data_map[XFS_BLF_DATAMAP_SIZE]; /* dirty bitmap */
-} xfs_buf_log_format_t;
+};
/*
* All buffers now need to tell recovery where the magic number
--
- Andrey
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v2 26/33] xfs: remove the unused xfs_dq_logformat_t typedef
2025-12-05 15:01 [PATCH v2 0/34] xfsprogs: libxfs sync v6.18 Andrey Albershteyn
` (24 preceding siblings ...)
2025-12-05 15:03 ` [PATCH v2 25/33] xfs: remove the unused xfs_buf_log_format_t typedef Andrey Albershteyn
@ 2025-12-05 15:03 ` Andrey Albershteyn
2025-12-05 15:03 ` [PATCH v2 27/33] xfs: remove the unused xfs_qoff_logformat_t typedef Andrey Albershteyn
` (7 subsequent siblings)
33 siblings, 0 replies; 35+ messages in thread
From: Andrey Albershteyn @ 2025-12-05 15:03 UTC (permalink / raw)
To: linux-xfs, aalbersh, cem, cmaiolino, djwong, dlemoal,
hans.holmberg, hch, preichl
From: Christoph Hellwig <hch@lst.de>
Source kernel commit: ae1ef3272b31e6bccd9f2014e8e8c41887a5137b
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
---
libxfs/xfs_log_format.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libxfs/xfs_log_format.h b/libxfs/xfs_log_format.h
index 631af2e28c..fff3a2aaee 100644
--- a/libxfs/xfs_log_format.h
+++ b/libxfs/xfs_log_format.h
@@ -957,14 +957,14 @@
* The first two fields must be the type and size fitting into
* 32 bits : log_recovery code assumes that.
*/
-typedef struct xfs_dq_logformat {
+struct xfs_dq_logformat {
uint16_t qlf_type; /* dquot log item type */
uint16_t qlf_size; /* size of this item */
xfs_dqid_t qlf_id; /* usr/grp/proj id : 32 bits */
int64_t qlf_blkno; /* blkno of dquot buffer */
int32_t qlf_len; /* len of dquot buffer */
uint32_t qlf_boffset; /* off of dquot in buffer */
-} xfs_dq_logformat_t;
+};
/*
* log format struct for QUOTAOFF records.
--
- Andrey
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v2 27/33] xfs: remove the unused xfs_qoff_logformat_t typedef
2025-12-05 15:01 [PATCH v2 0/34] xfsprogs: libxfs sync v6.18 Andrey Albershteyn
` (25 preceding siblings ...)
2025-12-05 15:03 ` [PATCH v2 26/33] xfs: remove the unused xfs_dq_logformat_t typedef Andrey Albershteyn
@ 2025-12-05 15:03 ` Andrey Albershteyn
2025-12-05 15:03 ` [PATCH v2 28/33] xfs: remove the unused xfs_log_iovec_t typedef Andrey Albershteyn
` (6 subsequent siblings)
33 siblings, 0 replies; 35+ messages in thread
From: Andrey Albershteyn @ 2025-12-05 15:03 UTC (permalink / raw)
To: linux-xfs, aalbersh, cem, cmaiolino, djwong, dlemoal,
hans.holmberg, hch, preichl
From: Christoph Hellwig <hch@lst.de>
Source kernel commit: bf0013f59ccdb283083f0451f6edc50ff98e68c0
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
---
libxfs/xfs_log_format.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libxfs/xfs_log_format.h b/libxfs/xfs_log_format.h
index fff3a2aaee..49c4a33166 100644
--- a/libxfs/xfs_log_format.h
+++ b/libxfs/xfs_log_format.h
@@ -974,12 +974,12 @@
* to the first and ensures that the first logitem is taken out of the AIL
* only when the last one is securely committed.
*/
-typedef struct xfs_qoff_logformat {
+struct xfs_qoff_logformat {
unsigned short qf_type; /* quotaoff log item type */
unsigned short qf_size; /* size of this item */
unsigned int qf_flags; /* USR and/or GRP */
char qf_pad[12]; /* padding for future */
-} xfs_qoff_logformat_t;
+};
/*
* Disk quotas status in m_qflags, and also sb_qflags. 16 bits.
--
- Andrey
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v2 28/33] xfs: remove the unused xfs_log_iovec_t typedef
2025-12-05 15:01 [PATCH v2 0/34] xfsprogs: libxfs sync v6.18 Andrey Albershteyn
` (26 preceding siblings ...)
2025-12-05 15:03 ` [PATCH v2 27/33] xfs: remove the unused xfs_qoff_logformat_t typedef Andrey Albershteyn
@ 2025-12-05 15:03 ` Andrey Albershteyn
2025-12-05 15:03 ` [PATCH v2 29/33] xfs: fix log CRC mismatches between i386 and other architectures Andrey Albershteyn
` (5 subsequent siblings)
33 siblings, 0 replies; 35+ messages in thread
From: Andrey Albershteyn @ 2025-12-05 15:03 UTC (permalink / raw)
To: linux-xfs, aalbersh, cem, cmaiolino, djwong, dlemoal,
hans.holmberg, hch, preichl
From: Christoph Hellwig <hch@lst.de>
Source kernel commit: 3e5bdfe48e1f159de7ca3b23a6afa6c10f2a9ad2
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
---
libxfs/xfs_log_format.h | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/libxfs/xfs_log_format.h b/libxfs/xfs_log_format.h
index 49c4a33166..a42a832117 100644
--- a/libxfs/xfs_log_format.h
+++ b/libxfs/xfs_log_format.h
@@ -194,12 +194,11 @@
} xlog_in_core_2_t;
/* not an on-disk structure, but needed by log recovery in userspace */
-typedef struct xfs_log_iovec {
+struct xfs_log_iovec {
void *i_addr; /* beginning address of region */
int i_len; /* length in bytes of region */
uint i_type; /* type of region */
-} xfs_log_iovec_t;
-
+};
/*
* Transaction Header definitions.
--
- Andrey
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v2 29/33] xfs: fix log CRC mismatches between i386 and other architectures
2025-12-05 15:01 [PATCH v2 0/34] xfsprogs: libxfs sync v6.18 Andrey Albershteyn
` (27 preceding siblings ...)
2025-12-05 15:03 ` [PATCH v2 28/33] xfs: remove the unused xfs_log_iovec_t typedef Andrey Albershteyn
@ 2025-12-05 15:03 ` Andrey Albershteyn
2025-12-05 15:04 ` [PATCH v2 30/33] xfs: move the XLOG_REG_ constants out of xfs_log_format.h Andrey Albershteyn
` (4 subsequent siblings)
33 siblings, 0 replies; 35+ messages in thread
From: Andrey Albershteyn @ 2025-12-05 15:03 UTC (permalink / raw)
To: linux-xfs, aalbersh, cem, cmaiolino, djwong, dlemoal,
hans.holmberg, hch, preichl
From: Christoph Hellwig <hch@lst.de>
Source kernel commit: e747883c7d7306acb4d683038d881528fbfbe749
When mounting file systems with a log that was dirtied on i386 on
other architectures or vice versa, log recovery is unhappy:
[ 11.068052] XFS (vdb): Torn write (CRC failure) detected at log block 0x2. Truncating head block from 0xc.
This is because the CRCs generated by i386 and other architectures
always diff. The reason for that is that sizeof(struct xlog_rec_header)
returns different values for i386 vs the rest (324 vs 328), because the
struct is not sizeof(uint64_t) aligned, and i386 has odd struct size
alignment rules.
This issue goes back to commit 13cdc853c519 ("Add log versioning, and new
super block field for the log stripe") in the xfs-import tree, which
adds log v2 support and the h_size field that causes the unaligned size.
At that time it only mattered for the crude debug only log header
checksum, but with commit 0e446be44806 ("xfs: add CRC checks to the log")
it became a real issue for v5 file system, because now there is a proper
CRC, and regular builds actually expect it match.
Fix this by allowing checksums with and without the padding.
Fixes: 0e446be44806 ("xfs: add CRC checks to the log")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
---
libxfs/xfs_log_format.h | 30 +++++++++++++++++++++++++++++-
libxfs/xfs_ondisk.h | 2 ++
2 files changed, 31 insertions(+), 1 deletion(-)
diff --git a/libxfs/xfs_log_format.h b/libxfs/xfs_log_format.h
index a42a832117..fd00b77af3 100644
--- a/libxfs/xfs_log_format.h
+++ b/libxfs/xfs_log_format.h
@@ -173,12 +173,40 @@
__be32 h_prev_block; /* block number to previous LR : 4 */
__be32 h_num_logops; /* number of log operations in this LR : 4 */
__be32 h_cycle_data[XLOG_HEADER_CYCLE_SIZE / BBSIZE];
- /* new fields */
+
+ /* fields added by the Linux port: */
__be32 h_fmt; /* format of log record : 4 */
uuid_t h_fs_uuid; /* uuid of FS : 16 */
+
+ /* fields added for log v2: */
__be32 h_size; /* iclog size : 4 */
+
+ /*
+ * When h_size added for log v2 support, it caused structure to have
+ * a different size on i386 vs all other architectures because the
+ * sum of the size ofthe member is not aligned by that of the largest
+ * __be64-sized member, and i386 has really odd struct alignment rules.
+ *
+ * Due to the way the log headers are placed out on-disk that alone is
+ * not a problem becaue the xlog_rec_header always sits alone in a
+ * BBSIZEs area, and the rest of that area is padded with zeroes.
+ * But xlog_cksum used to calculate the checksum based on the structure
+ * size, and thus gives different checksums for i386 vs the rest.
+ * We now do two checksum validation passes for both sizes to allow
+ * moving v5 file systems with unclean logs between i386 and other
+ * (little-endian) architectures.
+ */
+ __u32 h_pad0;
} xlog_rec_header_t;
+#ifdef __i386__
+#define XLOG_REC_SIZE offsetofend(struct xlog_rec_header, h_size)
+#define XLOG_REC_SIZE_OTHER sizeof(struct xlog_rec_header)
+#else
+#define XLOG_REC_SIZE sizeof(struct xlog_rec_header)
+#define XLOG_REC_SIZE_OTHER offsetofend(struct xlog_rec_header, h_size)
+#endif /* __i386__ */
+
typedef struct xlog_rec_ext_header {
__be32 xh_cycle; /* write cycle of log : 4 */
__be32 xh_cycle_data[XLOG_HEADER_CYCLE_SIZE / BBSIZE]; /* : 256 */
diff --git a/libxfs/xfs_ondisk.h b/libxfs/xfs_ondisk.h
index 5ed44fdf74..7bfa3242e2 100644
--- a/libxfs/xfs_ondisk.h
+++ b/libxfs/xfs_ondisk.h
@@ -174,6 +174,8 @@
XFS_CHECK_STRUCT_SIZE(struct xfs_rud_log_format, 16);
XFS_CHECK_STRUCT_SIZE(struct xfs_map_extent, 32);
XFS_CHECK_STRUCT_SIZE(struct xfs_phys_extent, 16);
+ XFS_CHECK_STRUCT_SIZE(struct xlog_rec_header, 328);
+ XFS_CHECK_STRUCT_SIZE(struct xlog_rec_ext_header, 260);
XFS_CHECK_OFFSET(struct xfs_bui_log_format, bui_extents, 16);
XFS_CHECK_OFFSET(struct xfs_cui_log_format, cui_extents, 16);
--
- Andrey
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v2 30/33] xfs: move the XLOG_REG_ constants out of xfs_log_format.h
2025-12-05 15:01 [PATCH v2 0/34] xfsprogs: libxfs sync v6.18 Andrey Albershteyn
` (28 preceding siblings ...)
2025-12-05 15:03 ` [PATCH v2 29/33] xfs: fix log CRC mismatches between i386 and other architectures Andrey Albershteyn
@ 2025-12-05 15:04 ` Andrey Albershteyn
2025-12-05 15:04 ` [PATCH v2 31/33] xfs: remove the expr argument to XFS_TEST_ERROR Andrey Albershteyn
` (3 subsequent siblings)
33 siblings, 0 replies; 35+ messages in thread
From: Andrey Albershteyn @ 2025-12-05 15:04 UTC (permalink / raw)
To: linux-xfs, aalbersh, cem, cmaiolino, djwong, dlemoal,
hans.holmberg, hch, preichl
From: Christoph Hellwig <hch@lst.de>
Source kernel commit: 42c21838708c20dd8ba605e4099bf6a7156c3362
These are purely in-memory values and not used at all in xfsprogs.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
---
libxfs/xfs_log_format.h | 37 -------------------------------------
1 file changed, 0 insertions(+), 37 deletions(-)
diff --git a/libxfs/xfs_log_format.h b/libxfs/xfs_log_format.h
index fd00b77af3..6c50cb2ece 100644
--- a/libxfs/xfs_log_format.h
+++ b/libxfs/xfs_log_format.h
@@ -86,43 +86,6 @@
uint32_t pad2; /* may as well make it 64 bits */
};
-/* Region types for iovec's i_type */
-#define XLOG_REG_TYPE_BFORMAT 1
-#define XLOG_REG_TYPE_BCHUNK 2
-#define XLOG_REG_TYPE_EFI_FORMAT 3
-#define XLOG_REG_TYPE_EFD_FORMAT 4
-#define XLOG_REG_TYPE_IFORMAT 5
-#define XLOG_REG_TYPE_ICORE 6
-#define XLOG_REG_TYPE_IEXT 7
-#define XLOG_REG_TYPE_IBROOT 8
-#define XLOG_REG_TYPE_ILOCAL 9
-#define XLOG_REG_TYPE_IATTR_EXT 10
-#define XLOG_REG_TYPE_IATTR_BROOT 11
-#define XLOG_REG_TYPE_IATTR_LOCAL 12
-#define XLOG_REG_TYPE_QFORMAT 13
-#define XLOG_REG_TYPE_DQUOT 14
-#define XLOG_REG_TYPE_QUOTAOFF 15
-#define XLOG_REG_TYPE_LRHEADER 16
-#define XLOG_REG_TYPE_UNMOUNT 17
-#define XLOG_REG_TYPE_COMMIT 18
-#define XLOG_REG_TYPE_TRANSHDR 19
-#define XLOG_REG_TYPE_ICREATE 20
-#define XLOG_REG_TYPE_RUI_FORMAT 21
-#define XLOG_REG_TYPE_RUD_FORMAT 22
-#define XLOG_REG_TYPE_CUI_FORMAT 23
-#define XLOG_REG_TYPE_CUD_FORMAT 24
-#define XLOG_REG_TYPE_BUI_FORMAT 25
-#define XLOG_REG_TYPE_BUD_FORMAT 26
-#define XLOG_REG_TYPE_ATTRI_FORMAT 27
-#define XLOG_REG_TYPE_ATTRD_FORMAT 28
-#define XLOG_REG_TYPE_ATTR_NAME 29
-#define XLOG_REG_TYPE_ATTR_VALUE 30
-#define XLOG_REG_TYPE_XMI_FORMAT 31
-#define XLOG_REG_TYPE_XMD_FORMAT 32
-#define XLOG_REG_TYPE_ATTR_NEWNAME 33
-#define XLOG_REG_TYPE_ATTR_NEWVALUE 34
-#define XLOG_REG_TYPE_MAX 34
-
/*
* Flags to log operation header
*
--
- Andrey
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v2 31/33] xfs: remove the expr argument to XFS_TEST_ERROR
2025-12-05 15:01 [PATCH v2 0/34] xfsprogs: libxfs sync v6.18 Andrey Albershteyn
` (29 preceding siblings ...)
2025-12-05 15:04 ` [PATCH v2 30/33] xfs: move the XLOG_REG_ constants out of xfs_log_format.h Andrey Albershteyn
@ 2025-12-05 15:04 ` Andrey Albershteyn
2025-12-05 15:04 ` [PATCH v2 32/33] xfs: improve default maximum number of open zones Andrey Albershteyn
` (2 subsequent siblings)
33 siblings, 0 replies; 35+ messages in thread
From: Andrey Albershteyn @ 2025-12-05 15:04 UTC (permalink / raw)
To: linux-xfs, aalbersh, cem, cmaiolino, djwong, dlemoal,
hans.holmberg, hch, preichl
From: Christoph Hellwig <hch@lst.de>
Source kernel commit: 807df3227d7674d7957c576551d552acf15bb96f
Don't pass expr to XFS_TEST_ERROR. Most calls pass a constant false,
and the places that do pass an expression become cleaner by moving it
out.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
[aalbersh: remove argument from a macro and fix call in defer_item.c]
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
---
libxfs/defer_item.c | 2 +-
libxfs/libxfs_priv.h | 2 +-
libxfs/xfs_ag_resv.c | 7 +++----
libxfs/xfs_alloc.c | 5 ++---
libxfs/xfs_attr_leaf.c | 2 +-
libxfs/xfs_bmap.c | 17 ++++++++---------
libxfs/xfs_btree.c | 2 +-
libxfs/xfs_da_btree.c | 2 +-
libxfs/xfs_dir2.c | 2 +-
libxfs/xfs_exchmaps.c | 4 ++--
libxfs/xfs_ialloc.c | 2 +-
libxfs/xfs_inode_buf.c | 4 ++--
libxfs/xfs_inode_fork.c | 3 +--
libxfs/xfs_metafile.c | 2 +-
libxfs/xfs_refcount.c | 7 +++----
libxfs/xfs_rmap.c | 2 +-
libxfs/xfs_rtbitmap.c | 2 +-
17 files changed, 31 insertions(+), 36 deletions(-)
diff --git a/libxfs/defer_item.c b/libxfs/defer_item.c
index 4530583dda..3dc938d514 100644
--- a/libxfs/defer_item.c
+++ b/libxfs/defer_item.c
@@ -754,7 +754,7 @@
*/
args->trans = tp;
- if (XFS_TEST_ERROR(false, args->dp->i_mount, XFS_ERRTAG_LARP)) {
+ if (XFS_TEST_ERROR(args->dp->i_mount, XFS_ERRTAG_LARP)) {
error = -EIO;
goto out;
}
diff --git a/libxfs/libxfs_priv.h b/libxfs/libxfs_priv.h
index 48a84a1089..5474865a67 100644
--- a/libxfs/libxfs_priv.h
+++ b/libxfs/libxfs_priv.h
@@ -185,7 +185,7 @@
#define XFS_STATS_INC(mp, count) do { (mp) = (mp); } while (0)
#define XFS_STATS_DEC(mp, count, x) do { (mp) = (mp); } while (0)
#define XFS_STATS_ADD(mp, count, x) do { (mp) = (mp); } while (0)
-#define XFS_TEST_ERROR(expr,a,b) ( expr )
+#define XFS_TEST_ERROR(a,b) (false)
#define __section(section) __attribute__((__section__(section)))
diff --git a/libxfs/xfs_ag_resv.c b/libxfs/xfs_ag_resv.c
index 83cac20331..842e797b2f 100644
--- a/libxfs/xfs_ag_resv.c
+++ b/libxfs/xfs_ag_resv.c
@@ -91,9 +91,8 @@
trace_xfs_ag_resv_critical(pag, type, avail);
/* Critically low if less than 10% or max btree height remains. */
- return XFS_TEST_ERROR(avail < orig / 10 ||
- avail < mp->m_agbtree_maxlevels,
- mp, XFS_ERRTAG_AG_RESV_CRITICAL);
+ return avail < orig / 10 || avail < mp->m_agbtree_maxlevels ||
+ XFS_TEST_ERROR(mp, XFS_ERRTAG_AG_RESV_CRITICAL);
}
/*
@@ -202,7 +201,7 @@
return -EINVAL;
}
- if (XFS_TEST_ERROR(false, mp, XFS_ERRTAG_AG_RESV_FAIL))
+ if (XFS_TEST_ERROR(mp, XFS_ERRTAG_AG_RESV_FAIL))
error = -ENOSPC;
else
error = xfs_dec_fdblocks(mp, hidden_space, true);
diff --git a/libxfs/xfs_alloc.c b/libxfs/xfs_alloc.c
index a9fb29ea99..311f5342d6 100644
--- a/libxfs/xfs_alloc.c
+++ b/libxfs/xfs_alloc.c
@@ -3317,7 +3317,7 @@
xfs_verifier_error(bp, -EFSBADCRC, __this_address);
else {
fa = xfs_agf_verify(bp);
- if (XFS_TEST_ERROR(fa, mp, XFS_ERRTAG_ALLOC_READ_AGF))
+ if (fa || XFS_TEST_ERROR(mp, XFS_ERRTAG_ALLOC_READ_AGF))
xfs_verifier_error(bp, -EFSCORRUPTED, fa);
}
}
@@ -4015,8 +4015,7 @@
ASSERT(len != 0);
ASSERT(type != XFS_AG_RESV_AGFL);
- if (XFS_TEST_ERROR(false, mp,
- XFS_ERRTAG_FREE_EXTENT))
+ if (XFS_TEST_ERROR(mp, XFS_ERRTAG_FREE_EXTENT))
return -EIO;
error = xfs_free_extent_fix_freelist(tp, pag, &agbp);
diff --git a/libxfs/xfs_attr_leaf.c b/libxfs/xfs_attr_leaf.c
index cfb8d40e51..29e9a419d0 100644
--- a/libxfs/xfs_attr_leaf.c
+++ b/libxfs/xfs_attr_leaf.c
@@ -1209,7 +1209,7 @@
trace_xfs_attr_leaf_to_node(args);
- if (XFS_TEST_ERROR(false, mp, XFS_ERRTAG_ATTR_LEAF_TO_NODE)) {
+ if (XFS_TEST_ERROR(mp, XFS_ERRTAG_ATTR_LEAF_TO_NODE)) {
error = -EIO;
goto out;
}
diff --git a/libxfs/xfs_bmap.c b/libxfs/xfs_bmap.c
index e6a1922abb..f2f616e521 100644
--- a/libxfs/xfs_bmap.c
+++ b/libxfs/xfs_bmap.c
@@ -3648,8 +3648,7 @@
/* Trim the allocation back to the maximum an AG can fit. */
args.maxlen = min(ap->length, mp->m_ag_max_usable);
- if (unlikely(XFS_TEST_ERROR(false, mp,
- XFS_ERRTAG_BMAP_ALLOC_MINLEN_EXTENT)))
+ if (unlikely(XFS_TEST_ERROR(mp, XFS_ERRTAG_BMAP_ALLOC_MINLEN_EXTENT)))
error = xfs_bmap_exact_minlen_extent_alloc(ap, &args);
else if ((ap->datatype & XFS_ALLOC_USERDATA) &&
xfs_inode_is_filestream(ap->ip))
@@ -3835,7 +3834,7 @@
}
if (XFS_IS_CORRUPT(mp, !xfs_ifork_has_extents(ifp)) ||
- XFS_TEST_ERROR(false, mp, XFS_ERRTAG_BMAPIFORMAT)) {
+ XFS_TEST_ERROR(mp, XFS_ERRTAG_BMAPIFORMAT)) {
xfs_bmap_mark_sick(ip, whichfork);
return -EFSCORRUPTED;
}
@@ -4186,7 +4185,7 @@
(XFS_BMAPI_PREALLOC | XFS_BMAPI_ZERO));
if (XFS_IS_CORRUPT(mp, !xfs_ifork_has_extents(ifp)) ||
- XFS_TEST_ERROR(false, mp, XFS_ERRTAG_BMAPIFORMAT)) {
+ XFS_TEST_ERROR(mp, XFS_ERRTAG_BMAPIFORMAT)) {
xfs_bmap_mark_sick(ip, whichfork);
return -EFSCORRUPTED;
}
@@ -4531,7 +4530,7 @@
(XFS_BMAPI_ATTRFORK | XFS_BMAPI_PREALLOC));
if (XFS_IS_CORRUPT(mp, !xfs_ifork_has_extents(ifp)) ||
- XFS_TEST_ERROR(false, mp, XFS_ERRTAG_BMAPIFORMAT)) {
+ XFS_TEST_ERROR(mp, XFS_ERRTAG_BMAPIFORMAT)) {
xfs_bmap_mark_sick(ip, whichfork);
return -EFSCORRUPTED;
}
@@ -5665,7 +5664,7 @@
int logflags = 0;
if (XFS_IS_CORRUPT(mp, !xfs_ifork_has_extents(ifp)) ||
- XFS_TEST_ERROR(false, mp, XFS_ERRTAG_BMAPIFORMAT)) {
+ XFS_TEST_ERROR(mp, XFS_ERRTAG_BMAPIFORMAT)) {
xfs_bmap_mark_sick(ip, whichfork);
return -EFSCORRUPTED;
}
@@ -5781,7 +5780,7 @@
int logflags = 0;
if (XFS_IS_CORRUPT(mp, !xfs_ifork_has_extents(ifp)) ||
- XFS_TEST_ERROR(false, mp, XFS_ERRTAG_BMAPIFORMAT)) {
+ XFS_TEST_ERROR(mp, XFS_ERRTAG_BMAPIFORMAT)) {
xfs_bmap_mark_sick(ip, whichfork);
return -EFSCORRUPTED;
}
@@ -5886,7 +5885,7 @@
int i = 0;
if (XFS_IS_CORRUPT(mp, !xfs_ifork_has_extents(ifp)) ||
- XFS_TEST_ERROR(false, mp, XFS_ERRTAG_BMAPIFORMAT)) {
+ XFS_TEST_ERROR(mp, XFS_ERRTAG_BMAPIFORMAT)) {
xfs_bmap_mark_sick(ip, whichfork);
return -EFSCORRUPTED;
}
@@ -6051,7 +6050,7 @@
trace_xfs_bmap_deferred(bi);
- if (XFS_TEST_ERROR(false, tp->t_mountp, XFS_ERRTAG_BMAP_FINISH_ONE))
+ if (XFS_TEST_ERROR(tp->t_mountp, XFS_ERRTAG_BMAP_FINISH_ONE))
return -EIO;
switch (bi->bi_type) {
diff --git a/libxfs/xfs_btree.c b/libxfs/xfs_btree.c
index 8576611994..1404d86fb9 100644
--- a/libxfs/xfs_btree.c
+++ b/libxfs/xfs_btree.c
@@ -303,7 +303,7 @@
fa = __xfs_btree_check_block(cur, block, level, bp);
if (XFS_IS_CORRUPT(mp, fa != NULL) ||
- XFS_TEST_ERROR(false, mp, xfs_btree_block_errtag(cur))) {
+ XFS_TEST_ERROR(mp, xfs_btree_block_errtag(cur))) {
if (bp)
trace_xfs_btree_corrupt(bp, _RET_IP_);
xfs_btree_mark_sick(cur);
diff --git a/libxfs/xfs_da_btree.c b/libxfs/xfs_da_btree.c
index af3fcdf5e4..37be99bd54 100644
--- a/libxfs/xfs_da_btree.c
+++ b/libxfs/xfs_da_btree.c
@@ -561,7 +561,7 @@
trace_xfs_da_split(state->args);
- if (XFS_TEST_ERROR(false, state->mp, XFS_ERRTAG_DA_LEAF_SPLIT))
+ if (XFS_TEST_ERROR(state->mp, XFS_ERRTAG_DA_LEAF_SPLIT))
return -EIO;
/*
diff --git a/libxfs/xfs_dir2.c b/libxfs/xfs_dir2.c
index 1285019b67..d5f2e516e5 100644
--- a/libxfs/xfs_dir2.c
+++ b/libxfs/xfs_dir2.c
@@ -222,7 +222,7 @@
bool ino_ok = xfs_verify_dir_ino(mp, ino);
if (XFS_IS_CORRUPT(mp, !ino_ok) ||
- XFS_TEST_ERROR(false, mp, XFS_ERRTAG_DIR_INO_VALIDATE)) {
+ XFS_TEST_ERROR(mp, XFS_ERRTAG_DIR_INO_VALIDATE)) {
xfs_warn(mp, "Invalid inode number 0x%Lx",
(unsigned long long) ino);
return -EFSCORRUPTED;
diff --git a/libxfs/xfs_exchmaps.c b/libxfs/xfs_exchmaps.c
index 2d75135494..8e39324d42 100644
--- a/libxfs/xfs_exchmaps.c
+++ b/libxfs/xfs_exchmaps.c
@@ -613,7 +613,7 @@
return error;
}
- if (XFS_TEST_ERROR(false, tp->t_mountp, XFS_ERRTAG_EXCHMAPS_FINISH_ONE))
+ if (XFS_TEST_ERROR(tp->t_mountp, XFS_ERRTAG_EXCHMAPS_FINISH_ONE))
return -EIO;
/* If we still have work to do, ask for a new transaction. */
@@ -879,7 +879,7 @@
&new_nextents))
return -EFBIG;
- if (XFS_TEST_ERROR(false, mp, XFS_ERRTAG_REDUCE_MAX_IEXTENTS) &&
+ if (XFS_TEST_ERROR(mp, XFS_ERRTAG_REDUCE_MAX_IEXTENTS) &&
new_nextents > 10)
return -EFBIG;
diff --git a/libxfs/xfs_ialloc.c b/libxfs/xfs_ialloc.c
index 0efad4cfda..9f4ec7bbc0 100644
--- a/libxfs/xfs_ialloc.c
+++ b/libxfs/xfs_ialloc.c
@@ -2701,7 +2701,7 @@
xfs_verifier_error(bp, -EFSBADCRC, __this_address);
else {
fa = xfs_agi_verify(bp);
- if (XFS_TEST_ERROR(fa, mp, XFS_ERRTAG_IALLOC_READ_AGI))
+ if (fa || XFS_TEST_ERROR(mp, XFS_ERRTAG_IALLOC_READ_AGI))
xfs_verifier_error(bp, -EFSCORRUPTED, fa);
}
}
diff --git a/libxfs/xfs_inode_buf.c b/libxfs/xfs_inode_buf.c
index 4eca3d6dd6..e2c87ca03c 100644
--- a/libxfs/xfs_inode_buf.c
+++ b/libxfs/xfs_inode_buf.c
@@ -58,8 +58,8 @@
di_ok = xfs_verify_magic16(bp, dip->di_magic) &&
xfs_dinode_good_version(mp, dip->di_version) &&
xfs_verify_agino_or_null(bp->b_pag, unlinked_ino);
- if (unlikely(XFS_TEST_ERROR(!di_ok, mp,
- XFS_ERRTAG_ITOBP_INOTOBP))) {
+ if (unlikely(!di_ok ||
+ XFS_TEST_ERROR(mp, XFS_ERRTAG_ITOBP_INOTOBP))) {
if (readahead) {
bp->b_flags &= ~XBF_DONE;
xfs_buf_ioerror(bp, -EIO);
diff --git a/libxfs/xfs_inode_fork.c b/libxfs/xfs_inode_fork.c
index 52740e8e88..329d52cc52 100644
--- a/libxfs/xfs_inode_fork.c
+++ b/libxfs/xfs_inode_fork.c
@@ -754,8 +754,7 @@
if (nr_exts < ifp->if_nextents)
return -EFBIG;
- if (XFS_TEST_ERROR(false, mp, XFS_ERRTAG_REDUCE_MAX_IEXTENTS) &&
- nr_exts > 10)
+ if (XFS_TEST_ERROR(mp, XFS_ERRTAG_REDUCE_MAX_IEXTENTS) && nr_exts > 10)
return -EFBIG;
if (nr_exts > xfs_iext_max_nextents(has_large, whichfork)) {
diff --git a/libxfs/xfs_metafile.c b/libxfs/xfs_metafile.c
index 6ded87d09a..9c3751f581 100644
--- a/libxfs/xfs_metafile.c
+++ b/libxfs/xfs_metafile.c
@@ -119,7 +119,7 @@
div_u64(mp->m_metafile_resv_target, 10)))
return true;
- return XFS_TEST_ERROR(false, mp, XFS_ERRTAG_METAFILE_RESV_CRITICAL);
+ return XFS_TEST_ERROR(mp, XFS_ERRTAG_METAFILE_RESV_CRITICAL);
}
/* Allocate a block from the metadata file's reservation. */
diff --git a/libxfs/xfs_refcount.c b/libxfs/xfs_refcount.c
index 4d31c3379d..f9714acd9a 100644
--- a/libxfs/xfs_refcount.c
+++ b/libxfs/xfs_refcount.c
@@ -1111,8 +1111,7 @@
* refcount continue update "error" has been injected.
*/
if (cur->bc_refc.nr_ops > 2 &&
- XFS_TEST_ERROR(false, cur->bc_mp,
- XFS_ERRTAG_REFCOUNT_CONTINUE_UPDATE))
+ XFS_TEST_ERROR(cur->bc_mp, XFS_ERRTAG_REFCOUNT_CONTINUE_UPDATE))
return false;
if (cur->bc_refc.nr_ops == 0)
@@ -1396,7 +1395,7 @@
trace_xfs_refcount_deferred(mp, ri);
- if (XFS_TEST_ERROR(false, mp, XFS_ERRTAG_REFCOUNT_FINISH_ONE))
+ if (XFS_TEST_ERROR(mp, XFS_ERRTAG_REFCOUNT_FINISH_ONE))
return -EIO;
/*
@@ -1509,7 +1508,7 @@
trace_xfs_refcount_deferred(mp, ri);
- if (XFS_TEST_ERROR(false, mp, XFS_ERRTAG_REFCOUNT_FINISH_ONE))
+ if (XFS_TEST_ERROR(mp, XFS_ERRTAG_REFCOUNT_FINISH_ONE))
return -EIO;
/*
diff --git a/libxfs/xfs_rmap.c b/libxfs/xfs_rmap.c
index 8c0c22a349..33e856875d 100644
--- a/libxfs/xfs_rmap.c
+++ b/libxfs/xfs_rmap.c
@@ -2689,7 +2689,7 @@
trace_xfs_rmap_deferred(mp, ri);
- if (XFS_TEST_ERROR(false, mp, XFS_ERRTAG_RMAP_FINISH_ONE))
+ if (XFS_TEST_ERROR(mp, XFS_ERRTAG_RMAP_FINISH_ONE))
return -EIO;
/*
diff --git a/libxfs/xfs_rtbitmap.c b/libxfs/xfs_rtbitmap.c
index 34425a9336..354ebb8d06 100644
--- a/libxfs/xfs_rtbitmap.c
+++ b/libxfs/xfs_rtbitmap.c
@@ -1062,7 +1062,7 @@
ASSERT(rbmip->i_itemp != NULL);
xfs_assert_ilocked(rbmip, XFS_ILOCK_EXCL);
- if (XFS_TEST_ERROR(false, mp, XFS_ERRTAG_FREE_EXTENT))
+ if (XFS_TEST_ERROR(mp, XFS_ERRTAG_FREE_EXTENT))
return -EIO;
error = xfs_rtcheck_alloc_range(&args, start, len);
--
- Andrey
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v2 32/33] xfs: improve default maximum number of open zones
2025-12-05 15:01 [PATCH v2 0/34] xfsprogs: libxfs sync v6.18 Andrey Albershteyn
` (30 preceding siblings ...)
2025-12-05 15:04 ` [PATCH v2 31/33] xfs: remove the expr argument to XFS_TEST_ERROR Andrey Albershteyn
@ 2025-12-05 15:04 ` Andrey Albershteyn
2025-12-05 15:04 ` [PATCH v2 33/33] xfs: prevent gc from picking the same zone twice Andrey Albershteyn
2025-12-08 6:49 ` [PATCH v2 0/34] xfsprogs: libxfs sync v6.18 Christoph Hellwig
33 siblings, 0 replies; 35+ messages in thread
From: Andrey Albershteyn @ 2025-12-05 15:04 UTC (permalink / raw)
To: linux-xfs, aalbersh, cem, cmaiolino, djwong, dlemoal,
hans.holmberg, hch, preichl
From: Damien Le Moal <dlemoal@kernel.org>
Source kernel commit: ff3d90903f8f525eedb26efe6fea03c39476cb69
For regular block devices using the zoned allocator, the default
maximum number of open zones is set to 1/4 of the number of realtime
groups. For a large capacity device, this leads to a very large limit.
E.g. with a 26 TB HDD:
mount /dev/sdb /mnt
...
XFS (sdb): 95836 zones of 65536 blocks size (23959 max open)
In turn such large limit on the number of open zones can lead, depending
on the workload, on a very large number of concurrent write streams
which devices generally do not handle well, leading to poor performance.
Introduce the default limit XFS_DEFAULT_MAX_OPEN_ZONES, defined as 128
to match the hardware limit of most SMR HDDs available today, and use
this limit to set mp->m_max_open_zones in xfs_calc_open_zones() instead
of calling xfs_max_open_zones(), when the user did not specify a limit
with the max_open_zones mount option.
For the 26 TB HDD example, we now get:
mount /dev/sdb /mnt
...
XFS (sdb): 95836 zones of 65536 blocks (128 max open zones)
This change does not prevent the user from specifying a lareger number
for the open zones limit. E.g.
mount -o max_open_zones=4096 /dev/sdb /mnt
...
XFS (sdb): 95836 zones of 65536 blocks (4096 max open zones)
Finally, since xfs_calc_open_zones() checks and caps the
mp->m_max_open_zones limit against the value calculated by
xfs_max_open_zones() for any type of device, this new default limit does
not increase m_max_open_zones for small capacity devices.
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
---
libxfs/xfs_zones.h | 7 +++++++
1 file changed, 7 insertions(+), 0 deletions(-)
diff --git a/libxfs/xfs_zones.h b/libxfs/xfs_zones.h
index c4f1367b2c..5fefd132e0 100644
--- a/libxfs/xfs_zones.h
+++ b/libxfs/xfs_zones.h
@@ -29,6 +29,13 @@
#define XFS_OPEN_GC_ZONES 1U
#define XFS_MIN_OPEN_ZONES (XFS_OPEN_GC_ZONES + 1U)
+/*
+ * For zoned devices that do not have a limit on the number of open zones, and
+ * for regular devices using the zoned allocator, use the most common SMR disks
+ * limit (128) as the default limit on the number of open zones.
+ */
+#define XFS_DEFAULT_MAX_OPEN_ZONES 128
+
bool xfs_zone_validate(struct blk_zone *zone, struct xfs_rtgroup *rtg,
xfs_rgblock_t *write_pointer);
--
- Andrey
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v2 33/33] xfs: prevent gc from picking the same zone twice
2025-12-05 15:01 [PATCH v2 0/34] xfsprogs: libxfs sync v6.18 Andrey Albershteyn
` (31 preceding siblings ...)
2025-12-05 15:04 ` [PATCH v2 32/33] xfs: improve default maximum number of open zones Andrey Albershteyn
@ 2025-12-05 15:04 ` Andrey Albershteyn
2025-12-08 6:49 ` [PATCH v2 0/34] xfsprogs: libxfs sync v6.18 Christoph Hellwig
33 siblings, 0 replies; 35+ messages in thread
From: Andrey Albershteyn @ 2025-12-05 15:04 UTC (permalink / raw)
To: linux-xfs, aalbersh, cem, cmaiolino, djwong, dlemoal,
hans.holmberg, hch, preichl
From: Christoph Hellwig <hch@lst.de>
Source kernel commit: 83bac569c762651ac6dff9a86f54ecc13d911f7d
When we are picking a zone for gc it might already be in the pipeline
which can lead to us moving the same data twice resulting in in write
amplification and a very unfortunate case where we keep on garbage
collecting the zone we just filled with migrated data stopping all
forward progress.
Fix this by introducing a count of on-going GC operations on a zone, and
skip any zone with ongoing GC when picking a new victim.
Fixes: 080d01c41 ("xfs: implement zoned garbage collection")
Signed-off-by: Hans Holmberg <hans.holmberg@wdc.com>
Co-developed-by: Hans Holmberg <hans.holmberg@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Tested-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
---
libxfs/xfs_rtgroup.h | 6 ++++++
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/libxfs/xfs_rtgroup.h b/libxfs/xfs_rtgroup.h
index d36a6ae0ab..d4fcf591e6 100644
--- a/libxfs/xfs_rtgroup.h
+++ b/libxfs/xfs_rtgroup.h
@@ -50,6 +50,12 @@
uint8_t *rtg_rsum_cache;
struct xfs_open_zone *rtg_open_zone;
};
+
+ /*
+ * Count of outstanding GC operations for zoned XFS. Any RTG with a
+ * non-zero rtg_gccount will not be picked as new GC victim.
+ */
+ atomic_t rtg_gccount;
};
/*
--
- Andrey
^ permalink raw reply related [flat|nested] 35+ messages in thread
* Re: [PATCH v2 0/34] xfsprogs: libxfs sync v6.18
2025-12-05 15:01 [PATCH v2 0/34] xfsprogs: libxfs sync v6.18 Andrey Albershteyn
` (32 preceding siblings ...)
2025-12-05 15:04 ` [PATCH v2 33/33] xfs: prevent gc from picking the same zone twice Andrey Albershteyn
@ 2025-12-08 6:49 ` Christoph Hellwig
33 siblings, 0 replies; 35+ messages in thread
From: Christoph Hellwig @ 2025-12-08 6:49 UTC (permalink / raw)
To: Andrey Albershteyn
Cc: linux-xfs, aalbersh, cem, cmaiolino, djwong, dlemoal,
hans.holmberg, hch, preichl
Looks good:
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 35+ messages in thread
end of thread, other threads:[~2025-12-08 6:49 UTC | newest]
Thread overview: 35+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-05 15:01 [PATCH v2 0/34] xfsprogs: libxfs sync v6.18 Andrey Albershteyn
2025-12-05 15:01 ` [PATCH v2 1/33] xfs: remove deprecated mount options Andrey Albershteyn
2025-12-05 15:01 ` [PATCH v2 2/33] xfs: remove deprecated sysctl knobs Andrey Albershteyn
2025-12-05 15:01 ` [PATCH v2 3/33] xfs: convert xfs_buf_log_format_t typedef to struct Andrey Albershteyn
2025-12-05 15:01 ` [PATCH v2 4/33] xfs: convert xlog_op_header_t " Andrey Albershteyn
2025-12-05 15:01 ` [PATCH v2 5/33] xfs: convert xfs_trans_header_t typdef " Andrey Albershteyn
2025-12-05 15:01 ` [PATCH v2 6/33] xfs: convert xfs_log_iovec_t typedef " Andrey Albershteyn
2025-12-05 15:02 ` [PATCH v2 7/33] xfs: convert xfs_qoff_logformat_t " Andrey Albershteyn
2025-12-05 15:02 ` [PATCH v2 8/33] xfs: convert xfs_dq_logformat_t " Andrey Albershteyn
2025-12-05 15:02 ` [PATCH v2 9/33] xfs: convert xfs_efi_log_format " Andrey Albershteyn
2025-12-05 15:02 ` [PATCH v2 10/33] xfs: convert xfs_efd_log_format_t " Andrey Albershteyn
2025-12-05 15:02 ` [PATCH v2 11/33] xfs: convert xfs_efi_log_format_32_t " Andrey Albershteyn
2025-12-05 15:02 ` [PATCH v2 12/33] xfs: convert xfs_extent_t " Andrey Albershteyn
2025-12-05 15:02 ` [PATCH v2 13/33] xfs: convert xfs_efi_log_format_64_t " Andrey Albershteyn
2025-12-05 15:02 ` [PATCH v2 14/33] xfs: remove the xlog_op_header_t typedef Andrey Albershteyn
2025-12-05 15:02 ` [PATCH v2 15/33] xfs: remove the xfs_trans_header_t typedef Andrey Albershteyn
2025-12-05 15:02 ` [PATCH v2 16/33] xfs: remove the xfs_extent_t typedef Andrey Albershteyn
2025-12-05 15:02 ` [PATCH v2 17/33] xfs: remove the xfs_extent32_t typedef Andrey Albershteyn
2025-12-05 15:03 ` [PATCH v2 18/33] xfs: remove the xfs_extent64_t typedef Andrey Albershteyn
2025-12-05 15:03 ` [PATCH v2 19/33] xfs: remove the xfs_efi_log_format_t typedef Andrey Albershteyn
2025-12-05 15:03 ` [PATCH v2 20/33] xfs: remove the xfs_efi_log_format_32_t typedef Andrey Albershteyn
2025-12-05 15:03 ` [PATCH v2 21/33] xfs: remove the xfs_efi_log_format_64_t typedef Andrey Albershteyn
2025-12-05 15:03 ` [PATCH v2 22/33] xfs: remove the xfs_efd_log_format_t typedef Andrey Albershteyn
2025-12-05 15:03 ` [PATCH v2 23/33] xfs: remove the unused xfs_efd_log_format_32_t typedef Andrey Albershteyn
2025-12-05 15:03 ` [PATCH v2 24/33] xfs: remove the unused xfs_efd_log_format_64_t typedef Andrey Albershteyn
2025-12-05 15:03 ` [PATCH v2 25/33] xfs: remove the unused xfs_buf_log_format_t typedef Andrey Albershteyn
2025-12-05 15:03 ` [PATCH v2 26/33] xfs: remove the unused xfs_dq_logformat_t typedef Andrey Albershteyn
2025-12-05 15:03 ` [PATCH v2 27/33] xfs: remove the unused xfs_qoff_logformat_t typedef Andrey Albershteyn
2025-12-05 15:03 ` [PATCH v2 28/33] xfs: remove the unused xfs_log_iovec_t typedef Andrey Albershteyn
2025-12-05 15:03 ` [PATCH v2 29/33] xfs: fix log CRC mismatches between i386 and other architectures Andrey Albershteyn
2025-12-05 15:04 ` [PATCH v2 30/33] xfs: move the XLOG_REG_ constants out of xfs_log_format.h Andrey Albershteyn
2025-12-05 15:04 ` [PATCH v2 31/33] xfs: remove the expr argument to XFS_TEST_ERROR Andrey Albershteyn
2025-12-05 15:04 ` [PATCH v2 32/33] xfs: improve default maximum number of open zones Andrey Albershteyn
2025-12-05 15:04 ` [PATCH v2 33/33] xfs: prevent gc from picking the same zone twice Andrey Albershteyn
2025-12-08 6:49 ` [PATCH v2 0/34] xfsprogs: libxfs sync v6.18 Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox