<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/xfs, branch linux-6.15.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.15.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.15.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2025-08-20T16:36:32Z</updated>
<entry>
<title>xfs: fix scrub trace with null pointer in quotacheck</title>
<updated>2025-08-20T16:36:32Z</updated>
<author>
<name>Andrey Albershteyn</name>
</author>
<published>2025-07-31T17:07:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9fe1cb2766c74860de310eee3cca0f8173eb5f90'/>
<id>urn:sha1:9fe1cb2766c74860de310eee3cca0f8173eb5f90</id>
<content type='text'>
commit 5d94b19f066480addfcdcb5efde66152ad5a7c0e upstream.

The quotacheck doesn't initialize sc-&gt;ip.

Cc: stable@vger.kernel.org # v6.8
Fixes: 21d7500929c8a0 ("xfs: improve dquot iteration for scrub")
Reviewed-by: Darrick J. Wong &lt;djwong@kernel.org&gt;
Signed-off-by: Andrey Albershteyn &lt;aalbersh@kernel.org&gt;
Signed-off-by: Carlos Maiolino &lt;cem@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>xfs: don't allocate the xfs_extent_busy structure for zoned RTGs</title>
<updated>2025-07-24T06:58:30Z</updated>
<author>
<name>Christoph Hellwig</name>
</author>
<published>2025-07-16T12:54:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bffff7253b7b1d87a0048c03c285eae72e47dc6c'/>
<id>urn:sha1:bffff7253b7b1d87a0048c03c285eae72e47dc6c</id>
<content type='text'>
commit 5948705adbf1a7afcecfe9a13ff39221ef61e16b upstream.

Busy extent tracking is primarily used to ensure that freed blocks are
not reused for data allocations before the transaction that deleted them
has been committed to stable storage, and secondarily to drive online
discard.  None of the use cases applies to zoned RTGs, as the zoned
allocator can't overwrite blocks before resetting the zone, which already
flushes out all transactions touching the RTGs.

So the busy extent tracking is not needed for zoned RTGs, and also not
called for zoned RTGs.  But somehow the code to skip allocating and
freeing the structure got lost during the zoned XFS upstreaming process.
This not only causes these structures to unnecessarily allocated, but can
also lead to memory leaks as the xg_busy_extents pointer in the
xfs_group structure is overlayed with the pointer for the linked list
of to be reset zones.

Stop allocating and freeing the structure to not pointlessly allocate
memory which is then leaked when the zone is reset.

Fixes: 080d01c41d44 ("xfs: implement zoned garbage collection")
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Cc: &lt;stable@vger.kernel.org&gt; # v6.15
[cem: Fix type and add stable tag]
Reviewed-by: Darrick J. Wong &lt;djwong@kernel.org&gt;
Signed-off-by: Carlos Maiolino &lt;cem@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>xfs: actually use the xfs_growfs_check_rtgeom tracepoint</title>
<updated>2025-07-10T14:08:24Z</updated>
<author>
<name>Darrick J. Wong</name>
</author>
<published>2025-06-12T17:51:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=955c2707e392bb06c259ba70a2178c0c3f449f4d'/>
<id>urn:sha1:955c2707e392bb06c259ba70a2178c0c3f449f4d</id>
<content type='text'>
commit db44d088a5ab030b741a3adf2e7b181a8a6dcfbe upstream.

We created a new tracepoint but forgot to put it in.  Fix that.

Cc: rostedt@goodmis.org
Cc: stable@vger.kernel.org # v6.14
Fixes: 59a57acbce282d ("xfs: check that the rtrmapbt maxlevels doesn't increase when growing fs")
Signed-off-by: Darrick J. Wong &lt;djwong@kernel.org&gt;
Reviewed-by: Carlos Maiolino &lt;cmaiolino@redhat.com&gt;
Reported-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Closes: https://lore.kernel.org/all/20250612131021.114e6ec8@batman.local.home/
Signed-off-by: Carlos Maiolino &lt;cem@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>xfs: don't assume perags are initialised when trimming AGs</title>
<updated>2025-06-19T13:41:06Z</updated>
<author>
<name>Dave Chinner</name>
</author>
<published>2025-04-30T23:27:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=53244759c5ba564e6be6863c64f6c88045305bcb'/>
<id>urn:sha1:53244759c5ba564e6be6863c64f6c88045305bcb</id>
<content type='text'>
commit 23be716b1c4f3f3a6c00ee38d51a57ef7db9ef7d upstream.

When running fstrim immediately after mounting a V4 filesystem,
the fstrim fails to trim all the free space in the filesystem. It
only trims the first extent in the by-size free space tree in each
AG and then returns. If a second fstrim is then run, it runs
correctly and the entire free space in the filesystem is iterated
and discarded correctly.

The problem lies in the setup of the trim cursor - it assumes that
pag-&gt;pagf_longest is valid without either reading the AGF first or
checking if xfs_perag_initialised_agf(pag) is true or not.

As a result, when a filesystem is mounted without reading the AGF
(e.g. a clean mount on a v4 filesystem) and the first operation is a
fstrim call, pag-&gt;pagf_longest is zero and so the free extent search
starts at the wrong end of the by-size btree and exits after
discarding the first record in the tree.

Fix this by deferring the initialisation of tcur-&gt;count to after
we have locked the AGF and guaranteed that the perag is properly
initialised. We trigger this on tcur-&gt;count == 0 after locking the
AGF, as this will only occur on the first call to
xfs_trim_gather_extents() for each AG. If we need to iterate,
tcur-&gt;count will be set to the length of the record we need to
restart at, so we can use this to ensure we only sample a valid
pag-&gt;pagf_longest value for the iteration.

Signed-off-by: Dave Chinner &lt;dchinner@redhat.com&gt;
Reviewed-by: Bill O'Donnell &lt;bodonnel@redhat.com&gt;
Reviewed-by: Darrick J. Wong &lt;djwong@kernel.org&gt;
Fixes: 89cfa899608f ("xfs: reduce AGF hold times during fstrim operations")
Cc: &lt;stable@vger.kernel.org&gt; # v6.6
Signed-off-by: Carlos Maiolino &lt;cem@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>iomap: don't lose folio dropbehind state for overwrites</title>
<updated>2025-06-19T13:40:22Z</updated>
<author>
<name>Jens Axboe</name>
</author>
<published>2025-05-27T23:01:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=68a233b4fcd8a0fce4bb0c13670b5f2cc42a6529'/>
<id>urn:sha1:68a233b4fcd8a0fce4bb0c13670b5f2cc42a6529</id>
<content type='text'>
[ Upstream commit 34ecde3c56066ba79e5ec3d93c5b14ea83e3603e ]

DONTCACHE I/O must have the completion punted to a workqueue, just like
what is done for unwritten extents, as the completion needs task context
to perform the invalidation of the folio(s). However, if writeback is
started off filemap_fdatawrite_range() off generic_sync() and it's an
overwrite, then the DONTCACHE marking gets lost as iomap_add_to_ioend()
don't look at the folio being added and no further state is passed down
to help it know that this is a dropbehind/DONTCACHE write.

Check if the folio being added is marked as dropbehind, and set
IOMAP_IOEND_DONTCACHE if that is the case. Then XFS can factor this into
the decision making of completion context in xfs_submit_ioend().
Additionally include this ioend flag in the NOMERGE flags, to avoid
mixing it with unrelated IO.

Since this is the 3rd flag that will cause XFS to punt the completion to
a workqueue, add a helper so that each one of them can get appropriately
commented.

This fixes extra page cache being instantiated when the write performed
is an overwrite, rather than newly instantiated blocks.

Fixes: b2cd5ae693a3 ("iomap: make buffered writes work with RWF_DONTCACHE")
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
Link: https://lore.kernel.org/5153f6e8-274d-4546-bf55-30a5018e0d03@kernel.dk
Reviewed-by: Dave Chinner &lt;dchinner@redhat.com&gt;
Signed-off-by: Christian Brauner &lt;brauner@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>xfs: Fix comment on xfs_trans_ail_update_bulk()</title>
<updated>2025-05-14T13:37:50Z</updated>
<author>
<name>Carlos Maiolino</name>
</author>
<published>2025-05-12T11:42:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=08c73a4b2e3cd2ff9db0ecb3c5c0dd7e23edc770'/>
<id>urn:sha1:08c73a4b2e3cd2ff9db0ecb3c5c0dd7e23edc770</id>
<content type='text'>
This function doesn't take the AIL lock, but should be called
with AIL lock held. Also (hopefuly) simplify the comment.

Signed-off-by: Carlos Maiolino &lt;cmaiolino@redhat.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Chandan Babu R &lt;chandanbabu@kernel.org&gt;
Signed-off-by: Carlos Maiolino &lt;cem@kernel.org&gt;
</content>
</entry>
<entry>
<title>xfs: Fix a comment on xfs_ail_delete</title>
<updated>2025-05-14T13:37:50Z</updated>
<author>
<name>Carlos Maiolino</name>
</author>
<published>2025-05-12T11:42:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fa8deae92f473a2ebc0e1c7cfa316f5c083e1880'/>
<id>urn:sha1:fa8deae92f473a2ebc0e1c7cfa316f5c083e1880</id>
<content type='text'>
It doesn't return anything.

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;cmaiolino@redhat.com&gt;
Reviewed-by: Chandan Babu R &lt;chandanbabu@kernel.org&gt;
Signed-off-by: Carlos Maiolino &lt;cem@kernel.org&gt;
</content>
</entry>
<entry>
<title>xfs: Fail remount with noattr2 on a v5 with v4 enabled</title>
<updated>2025-05-14T13:37:50Z</updated>
<author>
<name>Nirjhar Roy (IBM)</name>
</author>
<published>2025-05-12T16:30:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=95b613339c0e5fe651a3ef7605708478bc34a5af'/>
<id>urn:sha1:95b613339c0e5fe651a3ef7605708478bc34a5af</id>
<content type='text'>
Bug: When we compile the kernel with CONFIG_XFS_SUPPORT_V4=y,
remount with "-o remount,noattr2" on a v5 XFS does not
fail explicitly.

Reproduction:
mkfs.xfs -f /dev/loop0
mount /dev/loop0 /mnt/scratch
mount -o remount,noattr2 /dev/loop0 /mnt/scratch

However, with CONFIG_XFS_SUPPORT_V4=n, the remount
correctly fails explicitly. This is because the way the
following 2 functions are defined:

static inline bool xfs_has_attr2 (struct xfs_mount *mp)
{
	return !IS_ENABLED(CONFIG_XFS_SUPPORT_V4) ||
		(mp-&gt;m_features &amp; XFS_FEAT_ATTR2);
}
static inline bool xfs_has_noattr2 (const struct xfs_mount *mp)
{
	return mp-&gt;m_features &amp; XFS_FEAT_NOATTR2;
}

xfs_has_attr2() returns true when CONFIG_XFS_SUPPORT_V4=n
and hence, the following if condition in
xfs_fs_validate_params() succeeds and returns -EINVAL:

/*
 * We have not read the superblock at this point, so only the attr2
 * mount option can set the attr2 feature by this stage.
 */

if (xfs_has_attr2(mp) &amp;&amp; xfs_has_noattr2(mp)) {
	xfs_warn(mp, "attr2 and noattr2 cannot both be specified.");
	return -EINVAL;
}

With CONFIG_XFS_SUPPORT_V4=y, xfs_has_attr2() always return
false and hence no error is returned.

Fix: Check if the existing mount has crc enabled(i.e, of
type v5 and has attr2 enabled) and the
remount has noattr2, if yes, return -EINVAL.

I have tested xfs/{189,539} in fstests with v4
and v5 XFS with both CONFIG_XFS_SUPPORT_V4=y/n and
they both behave as expected.

This patch also fixes remount from noattr2 -&gt; attr2 (on a v4 xfs).

Related discussion in [1]

[1] https://lore.kernel.org/all/Z65o6nWxT00MaUrW@dread.disaster.area/

Signed-off-by: Nirjhar Roy (IBM) &lt;nirjhar.roy.lists@gmail.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Carlos Maiolino &lt;cmaiolino@redhat.com&gt;
Signed-off-by: Carlos Maiolino &lt;cem@kernel.org&gt;
</content>
</entry>
<entry>
<title>xfs: fix zoned GC data corruption due to wrong bv_offset</title>
<updated>2025-05-14T13:37:49Z</updated>
<author>
<name>Christoph Hellwig</name>
</author>
<published>2025-05-12T14:43:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fbecd731de05707a73a3d86c6cbe6b9441cdbedc'/>
<id>urn:sha1:fbecd731de05707a73a3d86c6cbe6b9441cdbedc</id>
<content type='text'>
xfs_zone_gc_write_chunk writes out the data buffer read in earlier using
the same bio, and currenly looks at bv_offset for the offset into the
scratch folio for that.  But commit 26064d3e2b4d ("block: fix adding
folio to bio") changed how bv_page and bv_offset are calculated for
adding larger folios, breaking this fragile logic.

Switch to extracting the full physical address from the old bio_vec,
and calculate the offset into the folio from that instead.

This fixes data corruption during garbage collection with heavy rockdsb
workloads.  Thanks to Hans for tracking down the culprit commit during
long bisection sessions.

Fixes: 26064d3e2b4d ("block: fix adding folio to bio")
Fixes: 080d01c41d44 ("xfs: implement zoned garbage collection")
Reported-by: Hans Holmberg &lt;Hans.Holmberg@wdc.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Hans Holmberg &lt;Hans.Holmberg@wdc.com&gt;
Tested-by: Hans Holmberg &lt;Hans.Holmberg@wdc.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: free up mp-&gt;m_free[0].count in error case</title>
<updated>2025-05-14T13:37:49Z</updated>
<author>
<name>Wengang Wang</name>
</author>
<published>2025-05-05T23:35:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=09dab6ce0243bc1939bd1f77a066ccdd72d44efe'/>
<id>urn:sha1:09dab6ce0243bc1939bd1f77a066ccdd72d44efe</id>
<content type='text'>
In xfs_init_percpu_counters(), memory for mp-&gt;m_free[0].count wasn't freed
in error case. Free it up in this patch.

Signed-off-by: Wengang Wang &lt;wen.gang.wang@oracle.com&gt;
Fixes: 712bae96631852 ("xfs: generalize the freespace and reserved blocks handling")
Reviewed-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>
</feed>
