<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/xfs/libxfs, branch linux-5.16.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.16.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.16.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2021-11-24T18:06:02Z</updated>
<entry>
<title>xfs: Fix the free logic of state in xfs_attr_node_hasname</title>
<updated>2021-11-24T18:06:02Z</updated>
<author>
<name>Yang Xu</name>
</author>
<published>2021-11-24T18:06:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a1de97fe296c52eafc6590a3506f4bbd44ecb19a'/>
<id>urn:sha1:a1de97fe296c52eafc6590a3506f4bbd44ecb19a</id>
<content type='text'>
When testing xfstests xfs/126 on lastest upstream kernel, it will hang on some machine.
Adding a getxattr operation after xattr corrupted, I can reproduce it 100%.

The deadlock as below:
[983.923403] task:setfattr        state:D stack:    0 pid:17639 ppid: 14687 flags:0x00000080
[  983.923405] Call Trace:
[  983.923410]  __schedule+0x2c4/0x700
[  983.923412]  schedule+0x37/0xa0
[  983.923414]  schedule_timeout+0x274/0x300
[  983.923416]  __down+0x9b/0xf0
[  983.923451]  ? xfs_buf_find.isra.29+0x3c8/0x5f0 [xfs]
[  983.923453]  down+0x3b/0x50
[  983.923471]  xfs_buf_lock+0x33/0xf0 [xfs]
[  983.923490]  xfs_buf_find.isra.29+0x3c8/0x5f0 [xfs]
[  983.923508]  xfs_buf_get_map+0x4c/0x320 [xfs]
[  983.923525]  xfs_buf_read_map+0x53/0x310 [xfs]
[  983.923541]  ? xfs_da_read_buf+0xcf/0x120 [xfs]
[  983.923560]  xfs_trans_read_buf_map+0x1cf/0x360 [xfs]
[  983.923575]  ? xfs_da_read_buf+0xcf/0x120 [xfs]
[  983.923590]  xfs_da_read_buf+0xcf/0x120 [xfs]
[  983.923606]  xfs_da3_node_read+0x1f/0x40 [xfs]
[  983.923621]  xfs_da3_node_lookup_int+0x69/0x4a0 [xfs]
[  983.923624]  ? kmem_cache_alloc+0x12e/0x270
[  983.923637]  xfs_attr_node_hasname+0x6e/0xa0 [xfs]
[  983.923651]  xfs_has_attr+0x6e/0xd0 [xfs]
[  983.923664]  xfs_attr_set+0x273/0x320 [xfs]
[  983.923683]  xfs_xattr_set+0x87/0xd0 [xfs]
[  983.923686]  __vfs_removexattr+0x4d/0x60
[  983.923688]  __vfs_removexattr_locked+0xac/0x130
[  983.923689]  vfs_removexattr+0x4e/0xf0
[  983.923690]  removexattr+0x4d/0x80
[  983.923693]  ? __check_object_size+0xa8/0x16b
[  983.923695]  ? strncpy_from_user+0x47/0x1a0
[  983.923696]  ? getname_flags+0x6a/0x1e0
[  983.923697]  ? _cond_resched+0x15/0x30
[  983.923699]  ? __sb_start_write+0x1e/0x70
[  983.923700]  ? mnt_want_write+0x28/0x50
[  983.923701]  path_removexattr+0x9b/0xb0
[  983.923702]  __x64_sys_removexattr+0x17/0x20
[  983.923704]  do_syscall_64+0x5b/0x1a0
[  983.923705]  entry_SYSCALL_64_after_hwframe+0x65/0xca
[  983.923707] RIP: 0033:0x7f080f10ee1b

When getxattr calls xfs_attr_node_get function, xfs_da3_node_lookup_int fails with EFSCORRUPTED in
xfs_attr_node_hasname because we have use blocktrash to random it in xfs/126. So it
free state in internal and xfs_attr_node_get doesn't do xfs_buf_trans release job.

Then subsequent removexattr will hang because of it.

This bug was introduced by kernel commit 07120f1abdff ("xfs: Add xfs_has_attr and subroutines").
It adds xfs_attr_node_hasname helper and said caller will be responsible for freeing the state
in this case. But xfs_attr_node_hasname will free state itself instead of caller if
xfs_da3_node_lookup_int fails.

Fix this bug by moving the step of free state into caller.

Also, use "goto error/out" instead of returning error directly in xfs_attr_node_addname_find_attr and
xfs_attr_node_removename_setup function because we should free state ourselves.

Fixes: 07120f1abdff ("xfs: Add xfs_has_attr and subroutines")
Signed-off-by: Yang Xu &lt;xuyang2018.jy@fujitsu.com&gt;
Reviewed-by: Darrick J. Wong &lt;djwong@kernel.org&gt;
Signed-off-by: Darrick J. Wong &lt;djwong@kernel.org&gt;
</content>
</entry>
<entry>
<title>xfs: sync xfs_btree_split macros with userspace libxfs</title>
<updated>2021-11-11T17:13:39Z</updated>
<author>
<name>Darrick J. Wong</name>
</author>
<published>2021-11-10T02:32:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4a6b35b3b3f28df81fea931dc77c4c229cbdb5b2'/>
<id>urn:sha1:4a6b35b3b3f28df81fea931dc77c4c229cbdb5b2</id>
<content type='text'>
Sync this one last bit of discrepancy between kernel and userspace
libxfs.

Signed-off-by: Darrick J. Wong &lt;djwong@kernel.org&gt;
Reviewed-by: Eric Sandeen &lt;sandeen@redhat.com&gt;
</content>
</entry>
<entry>
<title>xfs: #ifdef out perag code for userspace</title>
<updated>2021-11-10T17:37:38Z</updated>
<author>
<name>Eric Sandeen</name>
</author>
<published>2021-11-10T02:18:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=29f11fce211c7fcf32713457c031e71785fb6088'/>
<id>urn:sha1:29f11fce211c7fcf32713457c031e71785fb6088</id>
<content type='text'>
The xfs_perag structure and initialization is unused in userspace,
so #ifdef it out with __KERNEL__ to facilitate the xfsprogs sync
and build.

Signed-off-by: Eric Sandeen &lt;esandeen@redhat.com&gt;
Reviewed-by: Darrick J. Wong &lt;djwong@kernel.org&gt;
Signed-off-by: Darrick J. Wong &lt;djwong@kernel.org&gt;
</content>
</entry>
<entry>
<title>xfs: use swap() to make dabtree code cleaner</title>
<updated>2021-11-08T19:23:25Z</updated>
<author>
<name>Yang Guang</name>
</author>
<published>2021-11-08T19:23:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5b068aadf62da006891383f6b23e47bc3ad49995'/>
<id>urn:sha1:5b068aadf62da006891383f6b23e47bc3ad49995</id>
<content type='text'>
Use the macro 'swap()' defined in 'include/linux/minmax.h' to avoid
opencoding it.

Reported-by: Zeal Robot &lt;zealci@zte.com.cn&gt;
Signed-off-by: Yang Guang &lt;yang.guang5@zte.com.cn&gt;
Reviewed-by: Darrick J. Wong &lt;djwong@kernel.org&gt;
Signed-off-by: Darrick J. Wong &lt;djwong@kernel.org&gt;
</content>
</entry>
<entry>
<title>xfs: remove unused parameter from refcount code</title>
<updated>2021-10-22T23:04:36Z</updated>
<author>
<name>Darrick J. Wong</name>
</author>
<published>2021-10-12T22:58:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c04c51c524697cd68d668d595f8ebc381ffe426b'/>
<id>urn:sha1:c04c51c524697cd68d668d595f8ebc381ffe426b</id>
<content type='text'>
The owner info parameter is always NULL, so get rid of the parameter.

Signed-off-by: Darrick J. Wong &lt;djwong@kernel.org&gt;
Reviewed-by: Chandan Babu R &lt;chandan.babu@oracle.com&gt;
</content>
</entry>
<entry>
<title>xfs: reduce the size of struct xfs_extent_free_item</title>
<updated>2021-10-22T23:04:36Z</updated>
<author>
<name>Darrick J. Wong</name>
</author>
<published>2021-10-12T22:55:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b3b5ff412ab04afd99173bb12d3cc146ee478ae7'/>
<id>urn:sha1:b3b5ff412ab04afd99173bb12d3cc146ee478ae7</id>
<content type='text'>
We only use EFIs to free metadata blocks -- not regular data/attr fork
extents.  Remove all the fields that we never use, for a net reduction
of 16 bytes.

Signed-off-by: Darrick J. Wong &lt;djwong@kernel.org&gt;
Reviewed-by: Chandan Babu R &lt;chandan.babu@oracle.com&gt;
</content>
</entry>
<entry>
<title>xfs: rename xfs_bmap_add_free to xfs_free_extent_later</title>
<updated>2021-10-22T23:04:36Z</updated>
<author>
<name>Darrick J. Wong</name>
</author>
<published>2021-10-12T21:17:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c201d9ca5392b20f04882848a071025b0e194c17'/>
<id>urn:sha1:c201d9ca5392b20f04882848a071025b0e194c17</id>
<content type='text'>
xfs_bmap_add_free isn't a block mapping function; it schedules deferred
freeing operations for a later point in a compound transaction chain.
While it's primarily used by bunmapi, its use has expanded beyond that.
Move it to xfs_alloc.c and rename the function since it's now general
freeing functionality.  Bring the slab cache bits in line with the
way we handle the other intent items.

Signed-off-by: Darrick J. Wong &lt;djwong@kernel.org&gt;
Reviewed-by: Chandan Babu R &lt;chandan.babu@oracle.com&gt;
</content>
</entry>
<entry>
<title>xfs: create slab caches for frequently-used deferred items</title>
<updated>2021-10-22T23:04:36Z</updated>
<author>
<name>Darrick J. Wong</name>
</author>
<published>2021-10-12T21:11:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f3c799c22c661e181c71a0d9914fc923023f65fb'/>
<id>urn:sha1:f3c799c22c661e181c71a0d9914fc923023f65fb</id>
<content type='text'>
Create slab caches for the high-level structures that coordinate
deferred intent items, since they're used fairly heavily.

Signed-off-by: Darrick J. Wong &lt;djwong@kernel.org&gt;
Reviewed-by: Chandan Babu R &lt;chandan.babu@oracle.com&gt;
</content>
</entry>
<entry>
<title>xfs: compact deferred intent item structures</title>
<updated>2021-10-22T23:04:36Z</updated>
<author>
<name>Darrick J. Wong</name>
</author>
<published>2021-10-12T22:29:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9e253954acf53227f33d307f5ac5ff94c1ca5880'/>
<id>urn:sha1:9e253954acf53227f33d307f5ac5ff94c1ca5880</id>
<content type='text'>
Rearrange these structs to reduce the amount of unused padding bytes.
This saves eight bytes for each of the three structs changed here, which
means they're now all (rmap/bmap are 64 bytes, refc is 32 bytes) even
powers of two.

Signed-off-by: Darrick J. Wong &lt;djwong@kernel.org&gt;
Reviewed-by: Chandan Babu R &lt;chandan.babu@oracle.com&gt;
</content>
</entry>
<entry>
<title>xfs: rename _zone variables to _cache</title>
<updated>2021-10-22T23:04:20Z</updated>
<author>
<name>Darrick J. Wong</name>
</author>
<published>2021-10-12T18:09:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=182696fb021fc196e5cbe641565ca40fcf0f885a'/>
<id>urn:sha1:182696fb021fc196e5cbe641565ca40fcf0f885a</id>
<content type='text'>
Now that we've gotten rid of the kmem_zone_t typedef, rename the
variables to _cache since that's what they are.

Signed-off-by: Darrick J. Wong &lt;djwong@kernel.org&gt;
Reviewed-by: Chandan Babu R &lt;chandan.babu@oracle.com&gt;
</content>
</entry>
</feed>
