<feed xmlns='http://www.w3.org/2005/Atom'>
<title>lwn.git/fs/btrfs/xattr.c, branch docs-fixes</title>
<subtitle>Linux kernel documentation tree maintained by Jonathan Corbet</subtitle>
<id>http://mirrors.hust.edu.cn/git/lwn.git/atom?h=docs-fixes</id>
<link rel='self' href='http://mirrors.hust.edu.cn/git/lwn.git/atom?h=docs-fixes'/>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/'/>
<updated>2025-11-25T00:53:33+00:00</updated>
<entry>
<title>btrfs: remaining BTRFS_PATH_AUTO_FREE conversions</title>
<updated>2025-11-25T00:53:33+00:00</updated>
<author>
<name>David Sterba</name>
<email>dsterba@suse.com</email>
</author>
<published>2025-11-18T16:06:46+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=10934c131f9bcfb616dd8be9456f11efd6b240ec'/>
<id>urn:sha1:10934c131f9bcfb616dd8be9456f11efd6b240ec</id>
<content type='text'>
Do the remaining btrfs_path conversion to the auto cleaning, this seems
to be the last one. Most of the conversions are trivial, only adding the
declaration and removing the freeing, or changing the goto patterns to
return.

There are some functions with many changes, like __btrfs_free_extent(),
btrfs_remove_from_free_space_tree() or btrfs_add_to_free_space_tree()
but it still follows the same pattern.

Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
</content>
</entry>
<entry>
<title>btrfs: use bool type for btrfs_path members used as booleans</title>
<updated>2025-11-24T21:42:25+00:00</updated>
<author>
<name>Filipe Manana</name>
<email>fdmanana@suse.com</email>
</author>
<published>2025-11-14T16:00:04+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=d7fe41044b3ac8f9b5965de499a13ac9ae947e79'/>
<id>urn:sha1:d7fe41044b3ac8f9b5965de499a13ac9ae947e79</id>
<content type='text'>
Many fields of struct btrfs_path are used as booleans but their type is
an unsigned int (of one 1 bit width to save space). Change the type to
bool keeping the :1 suffix so that they combine with the previous u8
fields in order to save space. This makes the code more clear by using
explicit true/false and more in line with the preferred style, preserving
the size of the structure.

Reviewed-by: Johannes Thumshirn &lt;johannes.thumshirn@wdc.com&gt;
Signed-off-by: Filipe Manana &lt;fdmanana@suse.com&gt;
Reviewed-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
</content>
</entry>
<entry>
<title>btrfs: more trivial BTRFS_PATH_AUTO_FREE conversions</title>
<updated>2025-11-24T20:59:11+00:00</updated>
<author>
<name>Sun YangKai</name>
<email>sunk67188@gmail.com</email>
</author>
<published>2025-10-04T14:31:09+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=7fc35cc559cb64221a7fb1d2cf48cda8fd31fc9e'/>
<id>urn:sha1:7fc35cc559cb64221a7fb1d2cf48cda8fd31fc9e</id>
<content type='text'>
Convert more of the trivial pattern for the auto freeing of btrfs_path
with goto -&gt; return conversions where applicable.

Signed-off-by: Sun YangKai &lt;sunk67188@gmail.com&gt;
Reviewed-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
</content>
</entry>
<entry>
<title>btrfs: replace strcpy() with strscpy()</title>
<updated>2025-07-21T22:05:00+00:00</updated>
<author>
<name>Brahmajit Das</name>
<email>listout@listout.xyz</email>
</author>
<published>2025-06-20T16:49:57+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=164299ba117619643f6f042d487153d45a142999'/>
<id>urn:sha1:164299ba117619643f6f042d487153d45a142999</id>
<content type='text'>
strcpy() is discouraged from use due to lack of bounds checking.
Replaces it with strscpy(), the recommended alternative for null
terminated strings, to follow best practices.

There are instances where strscpy() cannot be used such as where both
the source and destination are character pointers. In that instance we
can use sysfs_emit().

Link: https://github.com/KSPP/linux/issues/88
Suggested-by: Anthony Iliopoulos &lt;ailiop@suse.com&gt;
Signed-off-by: Brahmajit Das &lt;bdas@suse.de&gt;
Reviewed-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
</content>
</entry>
<entry>
<title>btrfs: xattr: remove unnecessary call to btrfs_mark_buffer_dirty()</title>
<updated>2025-01-13T13:53:20+00:00</updated>
<author>
<name>Filipe Manana</name>
<email>fdmanana@suse.com</email>
</author>
<published>2024-12-18T13:04:01+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=74973b45a69b8f805e12e50cf85fa2ad500754f0'/>
<id>urn:sha1:74973b45a69b8f805e12e50cf85fa2ad500754f0</id>
<content type='text'>
The call to btrfs_mark_buffer_dirty() at btrfs_setxattr() is not
necessary as we have a path setup for writing with btrfs_search_slot()
having a 'cow' argument set to 1.

This just makes the code more verbose, confusing and add a little extra
overhead and well as increase the module's text size, so remove it.

Reviewed-by: Johannes Thumshirn &lt;johannes.thumshirn@wdc.com&gt;
Signed-off-by: Filipe Manana &lt;fdmanana@suse.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
</content>
</entry>
<entry>
<title>btrfs: drop unused parameter fs_info from btrfs_match_dir_item_name()</title>
<updated>2024-11-11T13:34:17+00:00</updated>
<author>
<name>David Sterba</name>
<email>dsterba@suse.com</email>
</author>
<published>2024-10-09T14:32:22+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=8c7cd2b6c9c1b296fd8760d7b89330a4b1793b7f'/>
<id>urn:sha1:8c7cd2b6c9c1b296fd8760d7b89330a4b1793b7f</id>
<content type='text'>
Cascaded removal of fs_info that is not needed in several functions.

Reviewed-by: Anand Jain &lt;anand.jain@oracle.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
</content>
</entry>
<entry>
<title>btrfs: add and use helper to verify the calling task has locked the inode</title>
<updated>2024-09-10T14:51:22+00:00</updated>
<author>
<name>Filipe Manana</name>
<email>fdmanana@suse.com</email>
</author>
<published>2024-08-29T18:03:52+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=1b6e068a0cc3d3888ddd5e4967357075fd6502da'/>
<id>urn:sha1:1b6e068a0cc3d3888ddd5e4967357075fd6502da</id>
<content type='text'>
We have a few places that check if we have the inode locked by doing:

    ASSERT(inode_is_locked(vfs_inode));

This actually proved to be useful several times as if assertions are
enabled (and by default they are in many distros) it immediately triggers
a crash which is impossible for users to miss.

However that doesn't check if the lock is held by the calling task, so
the check passes if some other task locked the inode.

Using one of the lockdep functions to check the lock is held, like
lockdep_assert_held() for example, does check that the calling task
holds the lock, and if that's not the case it produces a warning and
stack trace in dmesg. However, despite the misleading "assert" in the
name of the lockdep helpers, it does not trigger a crash/BUG_ON(), just
a warning and splat in dmesg, which is easy to get unnoticed by users
who may have lockdep enabled.

So add a helper that does the ASSERT() and calls lockdep_assert_held()
immediately after and use it every where we check the inode is locked.
Like this if the lock is held by some other task we get the warning
in dmesg which is caught by fstests, very helpful during development,
and may also be occassionaly noticed by users with lockdep enabled.

Reviewed-by: Josef Bacik &lt;josef@toxicpanda.com&gt;
Signed-off-by: Filipe Manana &lt;fdmanana@suse.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
</content>
</entry>
<entry>
<title>btrfs: pass a btrfs_inode to btrfs_set_prop()</title>
<updated>2024-07-11T13:33:29+00:00</updated>
<author>
<name>David Sterba</name>
<email>dsterba@suse.com</email>
</author>
<published>2022-01-31T18:16:41+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=0d9b7e166aef9f6d6dc574155cce293a2b6bf190'/>
<id>urn:sha1:0d9b7e166aef9f6d6dc574155cce293a2b6bf190</id>
<content type='text'>
Pass a struct btrfs_inode to btrfs_set_prop() as it's an
internal interface, allowing to remove some use of BTRFS_I.

Reviewed-by: Boris Burkov &lt;boris@bur.io&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
</content>
</entry>
<entry>
<title>btrfs: constify pointer parameters where applicable</title>
<updated>2024-07-11T13:33:22+00:00</updated>
<author>
<name>David Sterba</name>
<email>dsterba@suse.com</email>
</author>
<published>2024-05-30T17:14:12+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=2917f74102cf23afe770c1293aabce005f956b4f'/>
<id>urn:sha1:2917f74102cf23afe770c1293aabce005f956b4f</id>
<content type='text'>
We can add const to many parameters, this is for clarity and minor
addition to safety. There are some minor effects, in the assembly
code and .ko measured on release config. This patch does not cover all
possible conversions.

Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
</content>
</entry>
<entry>
<title>btrfs: rename err to ret in btrfs_initxattrs()</title>
<updated>2024-05-07T19:31:00+00:00</updated>
<author>
<name>Anand Jain</name>
<email>anand.jain@oracle.com</email>
</author>
<published>2024-03-19T03:34:32+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=c87b979d9f27f4368d01a53d7dd17062d3c13fda'/>
<id>urn:sha1:c87b979d9f27f4368d01a53d7dd17062d3c13fda</id>
<content type='text'>
Unify naming of return value to the preferred way.

Signed-off-by: Anand Jain &lt;anand.jain@oracle.com&gt;
Reviewed-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
</content>
</entry>
</feed>
