]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfsprogs-dev.git/log
xfsprogs-dev.git
2 weeks agoxfsprogs: Release v6.18.0 for-next master v6.18.0
Andrey Albershteyn [Wed, 24 Dec 2025 15:34:39 +0000 (16:34 +0100)]
xfsprogs: Release v6.18.0

Update all the necessary files for a v6.18.0 release.

Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
3 weeks agomkfs: adjust_nr_zones for zoned file system on conventional devices
Christoph Hellwig [Thu, 18 Dec 2025 16:09:32 +0000 (17:09 +0100)]
mkfs: adjust_nr_zones for zoned file system on conventional devices

When creating zoned file systems on conventional devices, mkfs doesn't
currently align the RT device size to the zone size, which can create
unmountable file systems.  Fix this by moving the rgcount modification
to account for reserved zoned and then calling adjust_nr_zones
unconditionally, and thus ensuring that the rtblocks and rtextents values
are guaranteed to always be a multiple of the zone size.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
3 weeks agoxfs_logprint: fix pointer bug
Darrick J. Wong [Tue, 9 Dec 2025 20:57:38 +0000 (12:57 -0800)]
xfs_logprint: fix pointer bug

generic/055 captures a crash in xfs_logprint due to an incorrect
refactoring trying to increment a pointer-to-pointer whereas before it
incremented a pointer.

Fixes: 5a9b7e95140893 ("logprint: factor out a xlog_print_op helper")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
4 weeks agomdrestore: fix restore_v2() superblock length check
Pavel Reichl [Tue, 9 Dec 2025 22:58:52 +0000 (23:58 +0100)]
mdrestore: fix restore_v2() superblock length check

On big-endian architectures (e.g. s390x), restoring a filesystem from a
v2 metadump fails with "Invalid superblock disk address/length". This is
caused by restore_v2() treating a superblock extent length of 1 as an
error, even though a length of 1 is expected because the superblock fits
within a 512-byte sector.

On little-endian systems, the same raw extent length bytes that represent
a value of 1 on big-endian are misinterpreted as 16777216 due to byte
ordering, so the faulty check never triggers there and the bug is hidden.

Fix the issue by using an endian-correct comparison of xme_len so that
the superblock extent length is validated properly and consistently on
all architectures.

Signed-off-by: Pavel Reichl <preichl@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Chandan Babu R <chandanbabu@kernel.org>
4 weeks agorepair: enhance process_dinode_metafile
Christoph Hellwig [Wed, 10 Dec 2025 05:54:41 +0000 (06:54 +0100)]
repair: enhance process_dinode_metafile

Explicitly list the destiny of each metafile inode type, and warn about
unexpected types instead of just silently zapping them.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
4 weeks agorepair: factor out a process_dinode_metafile helper
Christoph Hellwig [Wed, 10 Dec 2025 05:54:40 +0000 (06:54 +0100)]
repair: factor out a process_dinode_metafile helper

Split the metafile logic from process_dinode_int into a separate
helper.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
4 weeks agorepair: add canonical names for the XR_INO_ constants
Christoph Hellwig [Wed, 10 Dec 2025 05:54:39 +0000 (06:54 +0100)]
repair: add canonical names for the XR_INO_ constants

Add an array with the canonical name for each inode type so that code
doesn't have to implement switch statements for that, and remove the now
trivial process_misc_ino_types and process_misc_ino_types_blocks
functions.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
4 weeks agorepair: add a enum for the XR_INO_* values
Christoph Hellwig [Wed, 10 Dec 2025 05:54:38 +0000 (06:54 +0100)]
repair: add a enum for the XR_INO_* values

Move the XR_INO_ definitions into dinode.c as they aren't used anywhere
else, and turn them into an enum to improve type safety.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
5 weeks agomkfs: add 2025 LTS config file
Darrick J. Wong [Tue, 9 Dec 2025 16:16:24 +0000 (08:16 -0800)]
mkfs: add 2025 LTS config file

Add a new configuration file with the defaults as of 6.18 LTS.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
5 weeks agomkfs: enable new features by default
Darrick J. Wong [Tue, 9 Dec 2025 16:16:08 +0000 (08:16 -0800)]
mkfs: enable new features by default

Since the LTS is coming up, enable parent pointers and exchange-range by
default for all users.  Also fix up an out of date comment.

I created a really stupid benchmarking script that does:

#!/bin/bash

# pptr overhead benchmark

umount /opt /mnt
rmmod xfs
for i in 1 0; do
umount /opt
mkfs.xfs -f /dev/sdb -n parent=$i | grep -i parent=
mount /dev/sdb /opt
mkdir -p /opt/foo
for ((i=0;i<5;i++)); do
time fsstress -n 100000 -p 4 -z -f creat=1 -d /opt/foo -s 1
done
done

This is the result of creating an enormous number of empty files in a
single directory:

# ./dumb.sh
naming   =version 2              bsize=4096   ascii-ci=0, ftype=1, parent=0
real    0m18.807s
user    0m2.169s
sys     0m54.013s

naming   =version 2              bsize=4096   ascii-ci=0, ftype=1, parent=1
real    0m20.654s
user    0m2.374s
sys     1m4.441s

As you can see, there's a 10% increase in runtime here.  If I make the
workload a bit more representative by changing the -f argument to
include a directory tree workout:

-f creat=1,mkdir=1,mknod=1,rmdir=1,unlink=1,link=1,rename=1

naming   =version 2              bsize=4096   ascii-ci=0, ftype=1, parent=1
real    0m12.742s
user    0m28.074s
sys     0m10.839s

naming   =version 2              bsize=4096   ascii-ci=0, ftype=1, parent=0
real    0m12.782s
user    0m28.892s
sys     0m8.897s

Almost no difference here.  If I then actually write to the regular
files by adding:

-f write=1

naming   =version 2              bsize=4096   ascii-ci=0, ftype=1, parent=1
real    0m16.668s
user    0m21.709s
sys     0m15.425s

naming   =version 2              bsize=4096   ascii-ci=0, ftype=1, parent=0
real    0m15.562s
user    0m21.740s
sys     0m12.927s

So that's about a 2% difference.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
5 weeks agolibfrog: fix incorrect FS_IOC_FSSETXATTR argument to ioctl()
Arkadiusz Miśkiewicz [Fri, 5 Dec 2025 14:31:48 +0000 (15:31 +0100)]
libfrog: fix incorrect FS_IOC_FSSETXATTR argument to ioctl()

xfsprogs 6.17.0 has broken project quota due to incorrect argument
passed to FS_IOC_FSSETXATTR ioctl(). Instead of passing struct fsxattr,
struct file_attr was passed.

# LC_ALL=C /usr/sbin/xfs_quota -x -c "project -s -p /home/xxx 389701" /home
Setting up project 389701 (path /home/xxx)...
xfs_quota: cannot set project on /home/xxx: Invalid argument
Processed 1 (/etc/projects and cmdline) paths for project 389701 with
recursion depth infinite (-1).

ioctl(5, FS_IOC_FSSETXATTR, {fsx_xflags=FS_XFLAG_PROJINHERIT|FS_XFLAG_HASATTR, fsx_extsize=0, fsx_projid=0, fsx_cowextsize=389701}) = -1 EINVAL (Invalid argument)

There seems to be a double mistake which hides the original ioctl()
argument bug on old kernel with xfsprogs built against it. The size of
fa_xflags was also wrong in xfsprogs's linux.h header. This way when
xfsprogs is compiled on newer kernel but used with older kernel this bug
uncovers.

Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Arkadiusz Miśkiewicz <arekm@maven.pl>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agoxfs: prevent gc from picking the same zone twice
Christoph Hellwig [Fri, 5 Dec 2025 15:04:33 +0000 (16:04 +0100)]
xfs: prevent gc from picking the same zone twice

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>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agoxfs: improve default maximum number of open zones
Damien Le Moal [Fri, 5 Dec 2025 15:04:24 +0000 (16:04 +0100)]
xfs: improve default maximum number of open zones

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>
5 weeks agoxfs: remove the expr argument to XFS_TEST_ERROR
Christoph Hellwig [Fri, 5 Dec 2025 15:04:17 +0000 (16:04 +0100)]
xfs: remove the expr argument to XFS_TEST_ERROR

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]
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agoxfs: move the XLOG_REG_ constants out of xfs_log_format.h
Christoph Hellwig [Fri, 5 Dec 2025 15:04:11 +0000 (16:04 +0100)]
xfs: move the XLOG_REG_ constants out of xfs_log_format.h

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>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agoxfs: fix log CRC mismatches between i386 and other architectures
Christoph Hellwig [Fri, 5 Dec 2025 15:03:59 +0000 (16:03 +0100)]
xfs: fix log CRC mismatches between i386 and other architectures

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>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agoxfs: remove the unused xfs_log_iovec_t typedef
Christoph Hellwig [Fri, 5 Dec 2025 15:03:46 +0000 (16:03 +0100)]
xfs: remove the unused xfs_log_iovec_t typedef

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>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agoxfs: remove the unused xfs_qoff_logformat_t typedef
Christoph Hellwig [Fri, 5 Dec 2025 15:03:42 +0000 (16:03 +0100)]
xfs: remove the unused xfs_qoff_logformat_t typedef

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>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agoxfs: remove the unused xfs_dq_logformat_t typedef
Christoph Hellwig [Fri, 5 Dec 2025 15:03:38 +0000 (16:03 +0100)]
xfs: remove the unused xfs_dq_logformat_t typedef

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>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agoxfs: remove the unused xfs_buf_log_format_t typedef
Christoph Hellwig [Fri, 5 Dec 2025 15:03:32 +0000 (16:03 +0100)]
xfs: remove the unused xfs_buf_log_format_t typedef

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>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agoxfs: remove the unused xfs_efd_log_format_64_t typedef
Christoph Hellwig [Fri, 5 Dec 2025 15:03:28 +0000 (16:03 +0100)]
xfs: remove the unused xfs_efd_log_format_64_t typedef

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>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agoxfs: remove the unused xfs_efd_log_format_32_t typedef
Christoph Hellwig [Fri, 5 Dec 2025 15:03:24 +0000 (16:03 +0100)]
xfs: remove the unused xfs_efd_log_format_32_t typedef

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>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agoxfs: remove the xfs_efd_log_format_t typedef
Christoph Hellwig [Fri, 5 Dec 2025 15:03:19 +0000 (16:03 +0100)]
xfs: remove the xfs_efd_log_format_t typedef

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>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agoxfs: remove the xfs_efi_log_format_64_t typedef
Christoph Hellwig [Fri, 5 Dec 2025 15:03:15 +0000 (16:03 +0100)]
xfs: remove the xfs_efi_log_format_64_t typedef

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>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agoxfs: remove the xfs_efi_log_format_32_t typedef
Christoph Hellwig [Fri, 5 Dec 2025 15:03:10 +0000 (16:03 +0100)]
xfs: remove the xfs_efi_log_format_32_t typedef

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>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agoxfs: remove the xfs_efi_log_format_t typedef
Christoph Hellwig [Fri, 5 Dec 2025 15:03:06 +0000 (16:03 +0100)]
xfs: remove the xfs_efi_log_format_t typedef

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>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agoxfs: remove the xfs_extent64_t typedef
Christoph Hellwig [Fri, 5 Dec 2025 15:03:01 +0000 (16:03 +0100)]
xfs: remove the xfs_extent64_t typedef

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>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agoxfs: remove the xfs_extent32_t typedef
Christoph Hellwig [Fri, 5 Dec 2025 15:02:56 +0000 (16:02 +0100)]
xfs: remove the xfs_extent32_t typedef

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>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agoxfs: remove the xfs_extent_t typedef
Christoph Hellwig [Fri, 5 Dec 2025 15:02:51 +0000 (16:02 +0100)]
xfs: remove the xfs_extent_t typedef

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>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agoxfs: remove the xfs_trans_header_t typedef
Christoph Hellwig [Fri, 5 Dec 2025 15:02:46 +0000 (16:02 +0100)]
xfs: remove the xfs_trans_header_t typedef

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>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agoxfs: remove the xlog_op_header_t typedef
Christoph Hellwig [Fri, 5 Dec 2025 15:02:42 +0000 (16:02 +0100)]
xfs: remove the xlog_op_header_t typedef

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>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agoxfs: convert xfs_efi_log_format_64_t typedef to struct
Andrey Albershteyn [Fri, 5 Dec 2025 15:02:37 +0000 (16:02 +0100)]
xfs: convert xfs_efi_log_format_64_t typedef to struct

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agoxfs: convert xfs_extent_t typedef to struct
Andrey Albershteyn [Fri, 5 Dec 2025 15:02:32 +0000 (16:02 +0100)]
xfs: convert xfs_extent_t typedef to struct

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agoxfs: convert xfs_efi_log_format_32_t typedef to struct
Andrey Albershteyn [Fri, 5 Dec 2025 15:02:27 +0000 (16:02 +0100)]
xfs: convert xfs_efi_log_format_32_t typedef to struct

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agoxfs: convert xfs_efd_log_format_t typedef to struct
Andrey Albershteyn [Fri, 5 Dec 2025 15:02:21 +0000 (16:02 +0100)]
xfs: convert xfs_efd_log_format_t typedef to struct

Align function arguments to new longer variable type and fix comment in
xlog_print_trans_rud() with wrong xfs_efd_log_format mention.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agoxfs: convert xfs_efi_log_format typedef to struct
Andrey Albershteyn [Fri, 5 Dec 2025 15:02:15 +0000 (16:02 +0100)]
xfs: convert xfs_efi_log_format typedef to struct

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agoxfs: convert xfs_dq_logformat_t typedef to struct
Andrey Albershteyn [Fri, 5 Dec 2025 15:02:06 +0000 (16:02 +0100)]
xfs: convert xfs_dq_logformat_t typedef to struct

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agoxfs: convert xfs_qoff_logformat_t typedef to struct
Andrey Albershteyn [Fri, 5 Dec 2025 15:02:01 +0000 (16:02 +0100)]
xfs: convert xfs_qoff_logformat_t typedef to struct

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agoxfs: convert xfs_log_iovec_t typedef to struct
Andrey Albershteyn [Fri, 5 Dec 2025 15:01:55 +0000 (16:01 +0100)]
xfs: convert xfs_log_iovec_t typedef to struct

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agoxfs: convert xfs_trans_header_t typdef to struct
Andrey Albershteyn [Fri, 5 Dec 2025 15:01:50 +0000 (16:01 +0100)]
xfs: convert xfs_trans_header_t typdef to struct

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agoxfs: convert xlog_op_header_t typedef to struct
Andrey Albershteyn [Fri, 5 Dec 2025 15:01:45 +0000 (16:01 +0100)]
xfs: convert xlog_op_header_t typedef to struct

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agoxfs: convert xfs_buf_log_format_t typedef to struct
Andrey Albershteyn [Fri, 5 Dec 2025 15:01:40 +0000 (16:01 +0100)]
xfs: convert xfs_buf_log_format_t typedef to struct

Reviewed-by: Andrey Albershteyn <aalbersh@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
5 weeks agoxfs: remove deprecated sysctl knobs
Darrick J. Wong [Fri, 5 Dec 2025 15:01:35 +0000 (16:01 +0100)]
xfs: remove deprecated sysctl knobs

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>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agoxfs: remove deprecated mount options
Darrick J. Wong [Fri, 5 Dec 2025 15:01:30 +0000 (16:01 +0100)]
xfs: remove deprecated mount options

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>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agoman2: fix getparents ioctl manpage
Darrick J. Wong [Tue, 2 Dec 2025 01:28:00 +0000 (17:28 -0800)]
man2: fix getparents ioctl manpage

Fix a silly typo in the manual page for the GETPARENTS ioctl.

Cc: linux-xfs@vger.kernel.org # v6.10.0
Fixes: a24294c252d4a6 ("man: document the XFS_IOC_GETPARENTS ioctl")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
5 weeks agoxfs_db: document the rtsb command
Darrick J. Wong [Tue, 2 Dec 2025 01:27:44 +0000 (17:27 -0800)]
xfs_db: document the rtsb command

Document the rtsb command, which positions the debugger at the
superblock for the realtime volume, if there is one.

Found by xfs/514.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
5 weeks agolibxfs: fix build warnings
Darrick J. Wong [Tue, 2 Dec 2025 01:27:29 +0000 (17:27 -0800)]
libxfs: fix build warnings

gcc 14.2 with all the warnings turn on complains about missing
prototypes for these two functions:

 util.c:147:1: error: no previous prototype for 'current_fixed_time' [-Werror=missing-prototypes]
   147 | current_fixed_time(
       | ^~~~~~~~~~~~~~~~~~
 util.c:590:1: error: no previous prototype for 'get_deterministic_seed' [-Werror=missing-prototypes]
   590 | get_deterministic_seed(
       | ^~~~~~~~~~~~~~~~~~~~~~

Since they're not used outside of util.c, just make them static.

Fixes: 4a54700b4385bb ("libxfs: support reproducible filesystems using deterministic time/seed")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
5 weeks agologprint: cleanup xfs_log_print
Christoph Hellwig [Fri, 28 Nov 2025 06:30:02 +0000 (07:30 +0100)]
logprint: cleanup xfs_log_print

Re-indent and drop typedefs.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agologprint: cleanup xlog_print_extended_headers
Christoph Hellwig [Fri, 28 Nov 2025 06:30:01 +0000 (07:30 +0100)]
logprint: cleanup xlog_print_extended_headers

Re-indent and drop typedefs.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agologprint: factor out a xlog_print_ext_header helper
Christoph Hellwig [Fri, 28 Nov 2025 06:30:00 +0000 (07:30 +0100)]
logprint: factor out a xlog_print_ext_header helper

Split the inner extheader printing loop into a separate helper.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agologprint: cleanup xlog_reallocate_xhdrs
Christoph Hellwig [Fri, 28 Nov 2025 06:29:59 +0000 (07:29 +0100)]
logprint: cleanup xlog_reallocate_xhdrs

Re-indent and drop typedefs.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agologprint: re-indent print_xlog_bad_*
Christoph Hellwig [Fri, 28 Nov 2025 06:29:58 +0000 (07:29 +0100)]
logprint: re-indent print_xlog_bad_*

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agologprint: cleanup xlog_print_rec_xhead
Christoph Hellwig [Fri, 28 Nov 2025 06:29:57 +0000 (07:29 +0100)]
logprint: cleanup xlog_print_rec_xhead

Re-indent and drop typedefs.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agologprint: cleanup xlog_print_rec_head
Christoph Hellwig [Fri, 28 Nov 2025 06:29:56 +0000 (07:29 +0100)]
logprint: cleanup xlog_print_rec_head

Re-indent and drop typedefs.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agologprint: cleanup xlog_print_record
Christoph Hellwig [Fri, 28 Nov 2025 06:29:55 +0000 (07:29 +0100)]
logprint: cleanup xlog_print_record

Indent to the normal style, use structs instead of typedefs, and move
assignments out of conditionals.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agologprint: factor out a xlog_unpack_rec_header
Christoph Hellwig [Fri, 28 Nov 2025 06:29:54 +0000 (07:29 +0100)]
logprint: factor out a xlog_unpack_rec_header

Split the log record validation and unpacking logic into a separate
helper.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agologprint: factor out a xlog_print_op helper
Christoph Hellwig [Fri, 28 Nov 2025 06:29:53 +0000 (07:29 +0100)]
logprint: factor out a xlog_print_op helper

Split the inner printing loop from xlog_print_record into a separate
helper.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agologprint: factor out a xlog_print_process_region helper
Christoph Hellwig [Fri, 28 Nov 2025 06:29:52 +0000 (07:29 +0100)]
logprint: factor out a xlog_print_process_region helper

Start splitting up xlog_print_record by moving the switch on the item
types inside the inner loop into a self-contained helper.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agologprint: re-indent print_lseek / print_lsn
Christoph Hellwig [Fri, 28 Nov 2025 06:29:51 +0000 (07:29 +0100)]
logprint: re-indent print_lseek / print_lsn

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agologprint: cleanup xlog_print_trans_dquot
Christoph Hellwig [Fri, 28 Nov 2025 06:29:50 +0000 (07:29 +0100)]
logprint: cleanup xlog_print_trans_dquot

Re-indent, drop typedefs and invert a conditional to allow for an early
return.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agologprint: cleanup xlog_print_trans_inode
Christoph Hellwig [Fri, 28 Nov 2025 06:29:49 +0000 (07:29 +0100)]
logprint: cleanup xlog_print_trans_inode

Re-indent, drop typedefs and invert a conditional to allow for an early
return.

Signed-off-by: Christoph Hellwig <hch@lst.de>
[aalbersh: add one column of tabs to arguments and vars definitions]
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
Reviewed-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agologprint: move xfs_inode_item_format_convert up
Christoph Hellwig [Fri, 28 Nov 2025 06:29:48 +0000 (07:29 +0100)]
logprint: move xfs_inode_item_format_convert up

Toward the caller.  And reindent it while we're at it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
[aalbersh: add one tab column to arguments to make it align with in_f32]
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
Reviewed-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agologprint: cleanup xlog_print_trans_inode_core
Christoph Hellwig [Fri, 28 Nov 2025 06:29:47 +0000 (07:29 +0100)]
logprint: cleanup xlog_print_trans_inode_core

Re-indent and drop typedefs.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agologprint: cleanup xlog_print_trans_qoff
Christoph Hellwig [Fri, 28 Nov 2025 06:29:46 +0000 (07:29 +0100)]
logprint: cleanup xlog_print_trans_qoff

Re-indent, drop typedefs and invert a conditional to allow for an early
return.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agologprint: cleanup xlog_print_trans_buffer
Christoph Hellwig [Fri, 28 Nov 2025 06:29:45 +0000 (07:29 +0100)]
logprint: cleanup xlog_print_trans_buffer

Re-indent, drop typedefs and invert a conditional to allow for an early
return.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agologprint: split per-type helpers out of xlog_print_trans_buffer
Christoph Hellwig [Fri, 28 Nov 2025 06:29:44 +0000 (07:29 +0100)]
logprint: split per-type helpers out of xlog_print_trans_buffer

Add a new helper for each special cased buffer type.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agologprint: cleanup xlog_print_trans_header
Christoph Hellwig [Fri, 28 Nov 2025 06:29:43 +0000 (07:29 +0100)]
logprint: cleanup xlog_print_trans_header

Re-indent and drop typedef use.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agologprint: cleanup struct xlog_split_item handling
Christoph Hellwig [Fri, 28 Nov 2025 06:29:42 +0000 (07:29 +0100)]
logprint: cleanup struct xlog_split_item handling

Drop the typedef and re-indent the helpers for it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agologprint: cleanup xlog_print_op_header
Christoph Hellwig [Fri, 28 Nov 2025 06:29:41 +0000 (07:29 +0100)]
logprint: cleanup xlog_print_op_header

Re-indent and drop typedef use.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agologprint: re-indent printing helpers
Christoph Hellwig [Fri, 28 Nov 2025 06:29:40 +0000 (07:29 +0100)]
logprint: re-indent printing helpers

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agologprint: remove xlog_print_dir2_sf
Christoph Hellwig [Fri, 28 Nov 2025 06:29:39 +0000 (07:29 +0100)]
logprint: remove xlog_print_dir2_sf

The code has been stubbed out since the initial creation of the
xfsprogs repository.  Open code the single-line printf in the
data fork caller (attr forks can't contain directories) and remove
the dead code.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Andrey Albershteyn <aalbersh@kernel.org>
5 weeks agoinclude: remove struct xfs_qoff_logitem
Christoph Hellwig [Fri, 28 Nov 2025 06:29:38 +0000 (07:29 +0100)]
include: remove struct xfs_qoff_logitem

Not used anywhere, so remove it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Andrey Albershteyn <aalbersh@kernel.org>
7 weeks agoxfs_scrub: fix null pointer crash in scrub_render_ino_descr
Darrick J. Wong [Fri, 21 Nov 2025 16:39:37 +0000 (08:39 -0800)]
xfs_scrub: fix null pointer crash in scrub_render_ino_descr

Starting in Debian 13's libc6, passing a NULL format string to vsnprintf
causes the program to segfault.  Prior to this, the null format string
would be ignored.  Because @format is optional, let's explicitly steer
around the vsnprintf if there is no format string.  Also tidy whitespace
in the comment.

Found by generic/45[34] on Debian 13.

Cc: linux-xfs@vger.kernel.org # v6.10.0
Fixes: 9a8b09762f9a52 ("xfs_scrub: use parent pointers when possible to report file operations")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Andrey Albershteyn <aalbersh@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
7 weeks agometadump: catch used extent array overflow
Carlos Maiolino [Thu, 13 Nov 2025 13:57:11 +0000 (14:57 +0100)]
metadump: catch used extent array overflow

An user reported a SIGSEGV when attempting to create a metadump image of
a filesystem.
The reason is because we fail to catch a possible overflow in the
used extents array in process_exinode() which may happen if the extent
count is corrupted.
This leads process_bmbt_reclist() to attempt to index into the array
using the bogus extent count with:

convert_extent(&rp[numrecs - 1], &o, &s, &c, &f);

Fix this by extending the used counter to uint64_t and
checking for the overflow possibility.

Reported-by: hubert . <hubjin657@outlook.com>
Suggested-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
7 weeks agomkfs: fix zone capacity check for sequential zones
Carlos Maiolino [Thu, 13 Nov 2025 13:46:13 +0000 (14:46 +0100)]
mkfs: fix zone capacity check for sequential zones

Sequential zones can have a different, smaller capacity than
conventional zones.

Currently mkfs assumes both sequential and conventional zones will have
the same capacity and and set the zone_info to the capacity of the first
found zone and use that value to validate all the remaining zones's
capacity.

Because conventional zones can't have a different capacity than its
size, the first zone always have the largest possible capacity, so, mkfs
will fail to validate any consecutive sequential zone if its capacity is
smaller than the conventional zones.

What we should do instead, is set the zone info capacity accordingly to
the settings of first zone found of the respective type and validate
the capacity based on that instead of assuming all zones will have the
same capacity.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Hans Holmberg <hans.holmberg@wdc.com>
7 weeks agolibxfs: support reproducible filesystems using deterministic time/seed
Luca Di Maio [Sat, 8 Nov 2025 14:39:53 +0000 (15:39 +0100)]
libxfs: support reproducible filesystems using deterministic time/seed

Add support for reproducible filesystem creation through two environment
variables that enable deterministic behavior when building XFS filesystems.

SOURCE_DATE_EPOCH support:
When SOURCE_DATE_EPOCH is set, use its value for all filesystem timestamps
instead of the current time. This follows the reproducible builds
specification (https://reproducible-builds.org/specs/source-date-epoch/)
and ensures consistent inode timestamps across builds.

DETERMINISTIC_SEED support:
When DETERMINISTIC_SEED=1 is set, return a fixed seed value (0x53454544 =
"SEED") from get_random_u32() instead of reading from /dev/urandom.

get_random_u32() seems to be used mostly to set inode generation number, being
fixed should not be create collision issues at mkfs time.

The implementation introduces two helper functions to minimize changes
to existing code:

- current_fixed_time(): Parses and caches SOURCE_DATE_EPOCH on first
  call. Returns fixed timestamp when set, falls back to gettimeofday() on
  parse errors or when unset.
- get_deterministic_seed(): Checks for DETERMINISTIC_SEED=1 environment
  variable on first call, and returns a fixed seed value (0x53454544).
  Falls back to getrandom() when unset.
- Both helpers use one-time initialization to avoid repeated getenv() calls.
- Both quickly exit and noop if environment is not set or has invalid
  variables, falling back to original behaviour.

Example usage:
  SOURCE_DATE_EPOCH=1234567890 \
  DETERMINISTIC_SEED=1 \
  mkfs.xfs \
-m uuid=$EXAMPLE_UUID \
-p file=./rootfs \
disk1.img

This enables distributions and build systems to create bit-for-bit
identical XFS filesystems when needed for verification and debugging.

v1 -> v2:
- simplify deterministic seed by returning a fixed value instead
  of using Middle Square Weyl Sequence PRNG
- fix timestamp type time_t -> time64_t
- fix timestamp initialization flag to allow negative epochs
- fix timestamp conversion type using strtoll
- fix timestamp conversion check to be sure the whole string was parsed
- print warning message when SOURCE_DATE_EPOCH is invalid

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
7 weeks agoFix alloc/free of cache item
Torsten Rupp [Sun, 12 Oct 2025 07:23:58 +0000 (09:23 +0200)]
Fix alloc/free of cache item

xfs_extfree_item_cache is allocated and freed twice. Remove the
obsolete alloc/free.

Signed-off-by: Torsten Rupp <torsten.rupp@gmx.net>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
7 weeks agoxfs_io: use the XFS_ERRTAG macro to generate injection targets
Christoph Hellwig [Mon, 15 Sep 2025 13:33:17 +0000 (06:33 -0700)]
xfs_io: use the XFS_ERRTAG macro to generate injection targets

Use the new magic macro table provided by libxfs to autogenerate
the list of valid error injection targets.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
7 weeks agoxfs: centralize error tag definitions
Andrey Albershteyn [Mon, 24 Nov 2025 14:24:27 +0000 (15:24 +0100)]
xfs: centralize error tag definitions

From: Christoph Hellwig <hch@lst.de>

Source kernel commit: 71fa062196ae3abab790c91f1bdf09dcdc6fb1fe

Right now 5 places in the kernel and one in xfsprogs need to be updated
for each new error tag.  Add a bit of macro magic so that only the
error tag definition and a single table, which reside next to each
other, need to be updated.

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>