<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/xfs, branch master</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=master</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2026-03-11T12:21:42Z</updated>
<entry>
<title>xfs: fix integer overflow in bmap intent sort comparator</title>
<updated>2026-03-11T12:21:42Z</updated>
<author>
<name>Long Li</name>
</author>
<published>2026-03-10T12:32:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=362c490980867930a098b99f421268fbd7ca05fd'/>
<id>urn:sha1:362c490980867930a098b99f421268fbd7ca05fd</id>
<content type='text'>
xfs_bmap_update_diff_items() sorts bmap intents by inode number using
a subtraction of two xfs_ino_t (uint64_t) values, with the result
truncated to int. This is incorrect when two inode numbers differ by
more than INT_MAX (2^31 - 1), which is entirely possible on large XFS
filesystems.

Fix this by replacing the subtraction with cmp_int().

Cc: &lt;stable@vger.kernel.org&gt; # v4.9
Fixes: 9f3afb57d5f1 ("xfs: implement deferred bmbt map/unmap operations")
Signed-off-by: Long Li &lt;leo.lilong@huawei.com&gt;
Reviewed-by: Darrick J. Wong &lt;djwong@kernel.org&gt;
Signed-off-by: Carlos Maiolino &lt;cem@kernel.org&gt;
</content>
</entry>
<entry>
<title>xfs: fix undersized l_iclog_roundoff values</title>
<updated>2026-03-10T15:19:31Z</updated>
<author>
<name>Darrick J. Wong</name>
</author>
<published>2026-03-05T04:26:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=52a8a1ba883defbfe3200baa22cf4cd21985d51a'/>
<id>urn:sha1:52a8a1ba883defbfe3200baa22cf4cd21985d51a</id>
<content type='text'>
If the superblock doesn't list a log stripe unit, we set the incore log
roundoff value to 512.  This leads to corrupt logs and unmountable
filesystems in generic/617 on a disk with 4k physical sectors...

XFS (sda1): Mounting V5 Filesystem ff3121ca-26e6-4b77-b742-aaff9a449e1c
XFS (sda1): Torn write (CRC failure) detected at log block 0x318e. Truncating head block from 0x3197.
XFS (sda1): failed to locate log tail
XFS (sda1): log mount/recovery failed: error -74
XFS (sda1): log mount failed
XFS (sda1): Mounting V5 Filesystem ff3121ca-26e6-4b77-b742-aaff9a449e1c
XFS (sda1): Ending clean mount

...on the current xfsprogs for-next which has a broken mkfs.  xfs_info
shows this...

meta-data=/dev/sda1              isize=512    agcount=4, agsize=644992 blks
         =                       sectsz=4096  attr=2, projid32bit=1
         =                       crc=1        finobt=1, sparse=1, rmapbt=1
         =                       reflink=1    bigtime=1 inobtcount=1 nrext64=1
         =                       exchange=1   metadir=1
data     =                       bsize=4096   blocks=2579968, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0, ftype=1, parent=1
log      =internal log           bsize=4096   blocks=16384, version=2
         =                       sectsz=4096  sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
         =                       rgcount=0    rgsize=268435456 extents
         =                       zoned=0      start=0 reserved=0

...observe that the log section has sectsz=4096 sunit=0, which means
that the roundoff factor is 512, not 4096 as you'd expect.  We should
fix mkfs not to generate broken filesystems, but anyone can fuzz the
ondisk superblock so we should be more cautious.  I think the inadequate
logic predates commit a6a65fef5ef8d0, but that's clearly going to
require a different backport.

Cc: stable@vger.kernel.org # v5.14
Fixes: a6a65fef5ef8d0 ("xfs: log stripe roundoff is a property of the log")
Signed-off-by: Darrick J. Wong &lt;djwong@kernel.org&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Carlos Maiolino &lt;cem@kernel.org&gt;
</content>
</entry>
<entry>
<title>xfs: ensure dquot item is deleted from AIL only after log shutdown</title>
<updated>2026-03-10T08:40:38Z</updated>
<author>
<name>Long Li</name>
</author>
<published>2026-03-05T08:49:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=186ac39b8a7d3ec7ce9c5dd45e5c2730177f375c'/>
<id>urn:sha1:186ac39b8a7d3ec7ce9c5dd45e5c2730177f375c</id>
<content type='text'>
In xfs_qm_dqflush(), when a dquot flush fails due to corruption
(the out_abort error path), the original code removed the dquot log
item from the AIL before calling xfs_force_shutdown(). This ordering
introduces a subtle race condition that can lead to data loss after
a crash.

The AIL tracks the oldest dirty metadata in the journal. The position
of the tail item in the AIL determines the log tail LSN, which is the
oldest LSN that must be preserved for crash recovery. When an item is
removed from the AIL, the log tail can advance past the LSN of that item.

The race window is as follows: if the dquot item happens to be at
the tail of the log, removing it from the AIL allows the log tail
to advance. If a concurrent log write is sampling the tail LSN at
the same time and subsequently writes a complete checkpoint (i.e.,
one containing a commit record) to disk before the shutdown takes
effect, the journal will no longer protect the dquot's last
modification. On the next mount, log recovery will not replay the
dquot changes, even though they were never written back to disk,
resulting in silent data loss.

Fix this by calling xfs_force_shutdown() before xfs_trans_ail_delete()
in the out_abort path. Once the log is shut down, no new log writes
can complete with an updated tail LSN, making it safe to remove the
dquot item from the AIL.

Cc: stable@vger.kernel.org
Fixes: b707fffda6a3 ("xfs: abort consistently on dquot flush failure")
Signed-off-by: Long Li &lt;leo.lilong@huawei.com&gt;
Reviewed-by: Carlos Maiolino &lt;cmaiolino@redhat.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Carlos Maiolino &lt;cem@kernel.org&gt;
</content>
</entry>
<entry>
<title>xfs: remove redundant set null for ip-&gt;i_itemp</title>
<updated>2026-03-10T08:39:53Z</updated>
<author>
<name>Long Li</name>
</author>
<published>2026-03-05T08:49:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f1d77b863b414586ee45e10d9837c9ab27d8692d'/>
<id>urn:sha1:f1d77b863b414586ee45e10d9837c9ab27d8692d</id>
<content type='text'>
ip-&gt;i_itemp has been set null in xfs_inode_item_destroy(), so there is
no need set it null again in xfs_inode_free_callback().

Signed-off-by: Long Li &lt;leo.lilong@huawei.com&gt;
Reviewed-by: Carlos Maiolino &lt;cmaiolino@redhat.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Darrick J. Wong &lt;djwong@kernel.org&gt;
Signed-off-by: Carlos Maiolino &lt;cem@kernel.org&gt;
</content>
</entry>
<entry>
<title>xfs: fix returned valued from xfs_defer_can_append</title>
<updated>2026-03-06T08:30:07Z</updated>
<author>
<name>Carlos Maiolino</name>
</author>
<published>2026-03-04T18:54:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=54fcd2f95f8d216183965a370ec69e1aab14f5da'/>
<id>urn:sha1:54fcd2f95f8d216183965a370ec69e1aab14f5da</id>
<content type='text'>
xfs_defer_can_append returns a bool, it shouldn't be returning
a NULL.

Found by code inspection.

Fixes: 4dffb2cbb483 ("xfs: allow pausing of pending deferred work items")
Cc: &lt;stable@vger.kernel.org&gt; # v6.8
Signed-off-by: Carlos Maiolino &lt;cmaiolino@redhat.com&gt;
Reviewed-by: Darrick J. Wong &lt;djwong@kernel.org&gt;
Acked-by: Souptick Joarder &lt;souptick.joarder@hpe.com&gt;
Signed-off-by: Carlos Maiolino &lt;cem@kernel.org&gt;
</content>
</entry>
<entry>
<title>xfs: Remove redundant NULL check after __GFP_NOFAIL</title>
<updated>2026-03-05T09:02:45Z</updated>
<author>
<name>hongao</name>
</author>
<published>2026-03-04T11:29:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=281cb17787d4284a7790b9cbd80fded826ca7739'/>
<id>urn:sha1:281cb17787d4284a7790b9cbd80fded826ca7739</id>
<content type='text'>
kzalloc() is called with __GFP_NOFAIL, so a NULL return is not expected.
Drop the redundant !map check in xfs_dabuf_map().
Also switch the nirecs-sized allocation to kcalloc().

Signed-off-by: hongao &lt;hongao@uniontech.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Carlos Maiolino &lt;cem@kernel.org&gt;
</content>
</entry>
<entry>
<title>xfs: fix race between healthmon unmount and read_iter</title>
<updated>2026-03-04T09:11:47Z</updated>
<author>
<name>Darrick J. Wong</name>
</author>
<published>2026-03-02T17:31:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0ca1a8331c0fa5e57844e003a5d667a15b1e002c'/>
<id>urn:sha1:0ca1a8331c0fa5e57844e003a5d667a15b1e002c</id>
<content type='text'>
xfs/1879 on one of my test VMs got stuck due to the xfs_io healthmon
subcommand sleeping in wait_event_interruptible at:

 xfs_healthmon_read_iter+0x558/0x5f8 [xfs]
 vfs_read+0x248/0x320
 ksys_read+0x78/0x120

Looking at xfs_healthmon_read_iter, in !O_NONBLOCK mode it will sleep
until the mount cookie == DETACHED_MOUNT_COOKIE, there are events
waiting to be formatted, or there are formatted events in the read
buffer that could be copied to userspace.

Poking into the running kernel, I see that there are zero events in the
list, the read buffer is empty, and the mount cookie is indeed in
DETACHED state.  IOWs, xfs_healthmon_has_eventdata should have returned
true, but instead we're asleep waiting for a wakeup.

I think what happened here is that xfs_healthmon_read_iter and
xfs_healthmon_unmount were racing with each other, and _read_iter lost
the race.  _unmount queued an unmount event, which woke up _read_iter.
It found, formatted, and copied the event out to userspace.  That
cleared out the pending event list and emptied the read buffer.  xfs_io
then called read() again, so _has_eventdata decided that we should sleep
on the empty event queue.

Next, _unmount called xfs_healthmon_detach, which set the mount cookie
to DETACHED.  Unfortunately, it didn't call wake_up_all on the hm, so
the wait_event_interruptible in the _read_iter thread remains asleep.
That's why the test stalled.

Fix this by moving the wake_up_all call to xfs_healthmon_detach.

Fixes: b3a289a2a9397b ("xfs: create event queuing, formatting, and discovery infrastructure")
Signed-off-by: Darrick J. Wong &lt;djwong@kernel.org&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Carlos Maiolino &lt;cem@kernel.org&gt;
</content>
</entry>
<entry>
<title>xfs: remove scratch field from struct xfs_gc_bio</title>
<updated>2026-03-04T08:34:12Z</updated>
<author>
<name>Damien Le Moal</name>
</author>
<published>2026-02-25T22:46:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6270b8ac2f41858952074b23c2d3d9aa2fe1bfa9'/>
<id>urn:sha1:6270b8ac2f41858952074b23c2d3d9aa2fe1bfa9</id>
<content type='text'>
The scratch field in struct xfs_gc_bio is unused. Remove it.

Fixes: 102f444b57b3 ("xfs: rework zone GC buffer management")
Signed-off-by: Damien Le Moal &lt;dlemoal@kernel.org&gt;
Reviewed-by: Carlos Maiolino &lt;cmaiolino@redhat.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Darrick J. Wong &lt;djwong@kernel.org&gt;
Signed-off-by: Carlos Maiolino &lt;cem@kernel.org&gt;
</content>
</entry>
<entry>
<title>xfs: add static size checks for ioctl UABI</title>
<updated>2026-02-25T12:58:50Z</updated>
<author>
<name>Wilfred Mallawa</name>
</author>
<published>2026-02-11T03:29:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=650b774cf94495465d6a38c31bb1a6ce697b6b37'/>
<id>urn:sha1:650b774cf94495465d6a38c31bb1a6ce697b6b37</id>
<content type='text'>
The ioctl structures in libxfs/xfs_fs.h are missing static size checks.
It is useful to have static size checks for these structures as adding
new fields to them could cause issues (e.g. extra padding that may be
inserted by the compiler). So add these checks to xfs/xfs_ondisk.h.

Due to different padding/alignment requirements across different
architectures, to avoid build failures, some structures are ommited from
the size checks. For example, structures with "compat_" definitions in
xfs/xfs_ioctl32.h are ommited.

Signed-off-by: Wilfred Mallawa &lt;wilfred.mallawa@wdc.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Carlos Maiolino &lt;cem@kernel.org&gt;
</content>
</entry>
<entry>
<title>xfs: remove duplicate static size checks</title>
<updated>2026-02-25T12:58:49Z</updated>
<author>
<name>Wilfred Mallawa</name>
</author>
<published>2026-02-11T03:29:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e97cbf863d8918452c9f81bebdade8d04e2e7b60'/>
<id>urn:sha1:e97cbf863d8918452c9f81bebdade8d04e2e7b60</id>
<content type='text'>
In libxfs/xfs_ondisk.h, remove some duplicate entries of
XFS_CHECK_STRUCT_SIZE().

Signed-off-by: Wilfred Mallawa &lt;wilfred.mallawa@wdc.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Carlos Maiolino &lt;cem@kernel.org&gt;
</content>
</entry>
</feed>
