<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/fs/btrfs, branch main</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/u-boot.git/atom/fs/btrfs?h=main</id>
<link rel='self' href='http://cgit.235523.xyz/u-boot.git/atom/fs/btrfs?h=main'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<updated>2026-08-10T18:38:57Z</updated>
<entry>
<title>fs: btrfs: deduplicate the inode size lookup</title>
<updated>2026-08-10T18:38:57Z</updated>
<author>
<name>Cole Munz</name>
<email>Munzzyy1@proton.me</email>
</author>
<published>2026-08-02T09:35:26Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=a11f8659f451c5601bac6fdf5b48594d347db38d'/>
<id>urn:sha1:a11f8659f451c5601bac6fdf5b48594d347db38d</id>
<content type='text'>
btrfs_readdir() and btrfs_size() both open code the same search for an
inode item to read its size field. Move it into one helper.

Signed-off-by: Cole Munz &lt;Munzzyy1@proton.me&gt;
Reviewed-by: Qu Wenruo &lt;wqu@suse.com&gt;
</content>
</entry>
<entry>
<title>fs: btrfs: release the path when btrfs_search_slot() fails</title>
<updated>2026-08-10T18:38:57Z</updated>
<author>
<name>Cole Munz</name>
<email>Munzzyy1@proton.me</email>
</author>
<published>2026-08-02T09:35:22Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=1a5c8af2d4e4b4029739eb8787ce259d74977dfd'/>
<id>urn:sha1:1a5c8af2d4e4b4029739eb8787ce259d74977dfd</id>
<content type='text'>
The U-Boot copy of btrfs_search_slot() returns on error with the nodes
it has descended through still attached to the path. The kernel one
releases the path on any error unless p-&gt;skip_release_on_error is set,
and callers written against that convention treat a failed search as
owning nothing. btrfs_size() is one: it returns straight away on a
search error and never reaches its btrfs_release_path() call, so the
attached extent buffer references leak.

Route both error exits through a release of the path. The error
returns of read_node_slot() carry no extra reference, so the path is
the only thing to clean up.

Suggested-by: Qu Wenruo &lt;quwenruo.btrfs@gmx.com&gt;
Signed-off-by: Cole Munz &lt;Munzzyy1@proton.me&gt;
Reviewed-by: Qu Wenruo &lt;wqu@suse.com&gt;
</content>
</entry>
<entry>
<title>fs: btrfs: report file sizes from readdir</title>
<updated>2026-08-10T18:38:57Z</updated>
<author>
<name>Cole Munz</name>
<email>Munzzyy1@proton.me</email>
</author>
<published>2026-08-02T09:35:19Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=1cf825afd0d7ebb4857002833658574efbef6626'/>
<id>urn:sha1:1cf825afd0d7ebb4857002833658574efbef6626</id>
<content type='text'>
btrfs_readdir() zeroes the dirent and fills in only the name and the
type, so dent-&gt;size stays 0 and every file is listed as zero bytes:

  =&gt; ls host 0 /
          0   f_192k.bin
          0   small_3k.bin

Reads themselves are fine, since btrfs_read() takes the size from
btrfs_size(), which does its own inode item lookup. It affects EFI
too: dir_read() in lib/efi_loader/efi_file.c copies dent-&gt;size into
both file_size and physical_size, so an EFI application enumerating a
directory on btrfs sees every file as empty, which is the generic-code
path Alexey's readdir series moves btrfs onto.

The custom listing that fs_ls_generic() replaced looked the inode item
up and printed the real size, and every other filesystem in the tree
fills dent-&gt;size in its own readdir: ext4fs.c:327, exfat io.c:805,
erofs fs.c:186, squashfs sqfs.c:1095 and fat.c:1555.

btrfs_next_dir_entry() already has the dir item mapped, so read the
key it points at while we are there and hand it back to the caller,
and use that to reach the inode item. A subvolume entry points at a
root item instead and has no size of its own, so leave that one at 0.

  =&gt; ls host 0 /
     196608   f_192k.bin
       3000   small_3k.bin

Fixes: 31cf3f177823 ("fs: btrfs: use fs_ls_generic() and drop custom implementation")
Signed-off-by: Cole Munz &lt;Munzzyy1@proton.me&gt;
Reviewed-by: Qu Wenruo &lt;wqu@suse.com&gt;
</content>
</entry>
<entry>
<title>fs: btrfs: use fs_ls_generic() and drop custom implementation</title>
<updated>2026-07-10T21:55:01Z</updated>
<author>
<name>Alexey Charkov</name>
<email>alchark@flipper.net</email>
</author>
<published>2026-06-26T15:18:22Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=31cf3f177823362a42bf4630ec85370ea768ddf1'/>
<id>urn:sha1:31cf3f177823362a42bf4630ec85370ea768ddf1</id>
<content type='text'>
Now that generic callbacks for opendir/readdir/closedir are implemented,
the custom btrfs_ls() implementation is no longer needed, along with the
btrfs_iter_dir() callback iterator.

Use fs_ls_generic() instead.

Signed-off-by: Alexey Charkov &lt;alchark@flipper.net&gt;
Reviewed-by: Qu Wenruo &lt;wqu@suse.com&gt;
</content>
</entry>
<entry>
<title>fs: btrfs: implement opendir(), readdir() and closedir()</title>
<updated>2026-07-10T21:55:01Z</updated>
<author>
<name>Alexey Charkov</name>
<email>alchark@flipper.net</email>
</author>
<published>2026-06-26T15:18:21Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=5f064aef5d766e291982f9cba6dc728dcdb53868'/>
<id>urn:sha1:5f064aef5d766e291982f9cba6dc728dcdb53868</id>
<content type='text'>
Add support for generic directory iteration with opendir(), readdir() and
closedir() in the btrfs filesystem driver.

Signed-off-by: Alexey Charkov &lt;alchark@flipper.net&gt;
Reviewed-by: Qu Wenruo &lt;wqu@suse.com&gt;
</content>
</entry>
<entry>
<title>fs: btrfs: Do not free multi when guaranteed to be NULL</title>
<updated>2025-07-15T15:55:37Z</updated>
<author>
<name>Andrew Goodbody</name>
<email>andrew.goodbody@linaro.org</email>
</author>
<published>2025-07-08T11:34:49Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=9204cae0937c0e26fcff1ee08e51ef37f59844fe'/>
<id>urn:sha1:9204cae0937c0e26fcff1ee08e51ef37f59844fe</id>
<content type='text'>
multi is guaranteed to be NULL in the first two error exit paths so the
attempt to free it is not needed. Remove those calls.

This issue found by Smatch.

Signed-off-by: Andrew Goodbody &lt;andrew.goodbody@linaro.org&gt;
</content>
</entry>
<entry>
<title>fs: btrfs: hide duplicate 'Cannot lookup file' error on 'load'</title>
<updated>2024-11-15T19:11:47Z</updated>
<author>
<name>Dominique Martinet</name>
<email>dominique.martinet@atmark-techno.com</email>
</author>
<published>2024-11-15T02:15:47Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=6e988fde65b0a89d49c20553d47a8ec1e5461c12'/>
<id>urn:sha1:6e988fde65b0a89d49c20553d47a8ec1e5461c12</id>
<content type='text'>
Running commands such as 'load mmc 2:1 $addr $path' when path does not
exists will print an error twice if the file does not exist, e.g.:
```
Cannot lookup file boot/boot.scr
Failed to load 'boot/boot.scr'
```
(where the first line is printed by btrfs and the second by common fs
code)

Historically other filesystems such as ext4 or fat have not been
printing a message here, so do the same here to avoid duplicate.

The other error messages in this function are also somewhat redundant,
but bring useful diagnostics if they happen somewhere, so have been left
as printf.

Note that if a user wants no message to be printed for optional file
loads, they have to check for file existence first with other commands
such as 'size'.

Signed-off-by: Dominique Martinet &lt;dominique.martinet@atmark-techno.com&gt;
Reviewed-by: Qu Wenruo &lt;wqu@suse.com&gt;
</content>
</entry>
<entry>
<title>include: export uuid.h</title>
<updated>2024-09-12T15:35:37Z</updated>
<author>
<name>Caleb Connolly</name>
<email>caleb.connolly@linaro.org</email>
</author>
<published>2024-08-30T12:34:37Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=58d825fb18053ec7e432de7bbb70a452b9228076'/>
<id>urn:sha1:58d825fb18053ec7e432de7bbb70a452b9228076</id>
<content type='text'>
Move this header to include/u-boot/ so that it can be used by external
tools.

Reviewed-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
Signed-off-by: Caleb Connolly &lt;caleb.connolly@linaro.org&gt;
</content>
</entry>
<entry>
<title>fs: Remove duplicate newlines</title>
<updated>2024-07-15T18:12:17Z</updated>
<author>
<name>Marek Vasut</name>
<email>marek.vasut+renesas@mailbox.org</email>
</author>
<published>2024-07-13T13:19:21Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=dc5e2057131fd90bb62bb8c6b92abdb86ae32624'/>
<id>urn:sha1:dc5e2057131fd90bb62bb8c6b92abdb86ae32624</id>
<content type='text'>
Drop all duplicate newlines. No functional change.

Signed-off-by: Marek Vasut &lt;marek.vasut+renesas@mailbox.org&gt;
</content>
</entry>
<entry>
<title>fs: btrfs: fix out of bounds write</title>
<updated>2024-06-26T15:55:53Z</updated>
<author>
<name>Alex Shumsky</name>
<email>alexthreed@gmail.com</email>
</author>
<published>2024-06-18T21:41:38Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=ee1941e4fec601a8444f49c7dad04ad700d501a6'/>
<id>urn:sha1:ee1941e4fec601a8444f49c7dad04ad700d501a6</id>
<content type='text'>
Fix btrfs_read/read_and_truncate_page write out of bounds of destination
buffer. Old behavior break bootstd malloc'd buffers of exact file size.
Previously this OOB write have not been noticed because distroboot usually
read files into huge static memory areas.

Signed-off-by: Alex Shumsky &lt;alexthreed@gmail.com&gt;
Fixes: e342718 ("fs: btrfs: Implement btrfs_file_read()")
Reviewed-by: Qu Wenruo &lt;wqu@suse.com&gt;
</content>
</entry>
</feed>
