<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/fs/btrfs, branch v2022.04</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=v2022.04</id>
<link rel='self' href='http://cgit.235523.xyz/u-boot.git/atom/fs/btrfs?h=v2022.04'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<updated>2022-01-18T13:31:02Z</updated>
<entry>
<title>fs/btrfs: fix a bug that U-boot fs btrfs implementation doesn't handle NO_HOLE feature correctly</title>
<updated>2022-01-18T13:31:02Z</updated>
<author>
<name>Qu Wenruo</name>
<email>wqu@suse.com</email>
</author>
<published>2021-12-27T06:11:14Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=7c075433feb95b34e762edd384e76a5d08f73ad9'/>
<id>urn:sha1:7c075433feb95b34e762edd384e76a5d08f73ad9</id>
<content type='text'>
[BUG]
When passing a btrfs with NO_HOLE feature to U-boot, and if one file
contains holes, then the hash of the file is not correct in U-boot:

 # mkfs.btrfs -f test.img	# Since v5.15, mkfs defaults to NO_HOLES
 # mount test.img /mnt/btrfs
 # xfs_io -f -c "pwrite 0 4k" -c "pwrite 8k 4k" /mnt/btrfs/file
 # md5sum /mnt/btrfs/file
 277f3840b275c74d01e979ea9d75ac19  /mnt/btrfs/file
 # umount /mnt/btrfs
 # ./u-boot
 =&gt; host bind 0 /home/adam/test.img
 =&gt; ls host 0
 &lt;   &gt;      12288  Mon Dec 27 05:35:23 2021  file
 =&gt; load host 0 0x1000000 file
 12288 bytes read in 0 ms
 =&gt; md5sum 0x1000000 0x3000
 md5 for 01000000 ... 01002fff ==&gt; 855ffdbe4d0ccc5acab92e1b5330e4c1

The md5sum doesn't match at all.

[CAUSE]
In U-boot btrfs implementation, the function btrfs_read_file() has the
following iteration for file extent iteration:

	/* Read the aligned part */
	while (cur &lt; aligned_end) {
		ret = lookup_data_extent(root, &amp;path, ino, cur, &amp;next_offset);
		if (ret &lt; 0)
			goto out;
		if (ret &gt; 0) {
			/* No next, direct exit */
			if (!next_offset) {
				ret = 0;
				goto out;
			}
		}
		/* Read file extent */

But for NO_HOLES features, hole extents will not have any extent item
for it.
Thus if @cur is at a hole, lookup_data_extent() will just return &gt;0, and
update @next_offset.

But we still believe there is some data to read for @cur for ret &gt; 0
case, causing we read extent data from the next file extent.

This means, what we do for above NO_HOLES btrfs is:
- Read 4K data from disk to file offset [0, 4K)
  So far the data is still correct

- Read 4K data from disk to file offset [4K, 8K)
  We didn't skip the 4K hole, but read the data at file offset [8K, 12K)
  into file offset [4K, 8K).

  This causes the checksum mismatch.

[FIX]
Add extra check to skip to the next non-hole range after
lookup_data_extent().

Signed-off-by: Qu Wenruo &lt;wqu@suse.com&gt;
</content>
</entry>
<entry>
<title>fs/btrfs: add dependency on BLAKE2 hash</title>
<updated>2022-01-18T13:31:02Z</updated>
<author>
<name>Qu Wenruo</name>
<email>wqu@suse.com</email>
</author>
<published>2021-12-27T06:12:08Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=1617165a172ea1768c9cb12cde536f1da252546e'/>
<id>urn:sha1:1617165a172ea1768c9cb12cde536f1da252546e</id>
<content type='text'>
Now btrfs can utilize the newly intorudced BLAKE2 hash.

Signed-off-by: Qu Wenruo &lt;wqu@suse.com&gt;
</content>
</entry>
<entry>
<title>btrfs: Use U-Boot API for decompression</title>
<updated>2021-10-08T19:53:26Z</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2021-09-25T13:03:10Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=918adf8e07337719750c57be0939824247973b1e'/>
<id>urn:sha1:918adf8e07337719750c57be0939824247973b1e</id>
<content type='text'>
Use the common function to avoid code duplication.

Acked-by: Qu Wenruo &lt;wqu@suse.com&gt;
Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>WS cleanup: remove SPACE(s) followed by TAB</title>
<updated>2021-09-30T13:08:16Z</updated>
<author>
<name>Wolfgang Denk</name>
<email>wd@denx.de</email>
</author>
<published>2021-09-27T15:42:39Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=0cf207ec01cbacae47585fcc26591dd2296507d6'/>
<id>urn:sha1:0cf207ec01cbacae47585fcc26591dd2296507d6</id>
<content type='text'>
Signed-off-by: Wolfgang Denk &lt;wd@denx.de&gt;
</content>
</entry>
<entry>
<title>WS cleanup: remove excessive empty lines</title>
<updated>2021-09-30T12:08:56Z</updated>
<author>
<name>Wolfgang Denk</name>
<email>wd@denx.de</email>
</author>
<published>2021-09-27T15:42:37Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=c72231d2729cea8b683ef05d94c986ced36755b3'/>
<id>urn:sha1:c72231d2729cea8b683ef05d94c986ced36755b3</id>
<content type='text'>
Signed-off-by: Wolfgang Denk &lt;wd@denx.de&gt;
</content>
</entry>
<entry>
<title>btrfs: Suppress the message about missing filesystem</title>
<updated>2021-09-16T17:19:25Z</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2021-08-19T03:40:26Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=64acd46a82f06dfae7a181437e256a4194e612d8'/>
<id>urn:sha1:64acd46a82f06dfae7a181437e256a4194e612d8</id>
<content type='text'>
This message comes up a lot when scanning filesystems. It suggests to the
user that there is some sort of error, but in fact there is no reason to
expect that a particular partition has a btrfs filesystem. Other
filesystems don't print this error.

Turn it into a debug message.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Reviewed-by: Marek Behún &lt;marek.behun@nic.cz&gt;
Reviewed-by: Qu Wenruo &lt;wqu@suse.com&gt;
</content>
</entry>
<entry>
<title>btrfs: Use default subvolume as filesystem root</title>
<updated>2021-09-01T14:11:24Z</updated>
<author>
<name>Matwey V. Kornilov</name>
<email>matwey.kornilov@gmail.com</email>
</author>
<published>2021-08-01T20:52:16Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=94509b79b13e69c209199af0757afbde8d2ebd6d'/>
<id>urn:sha1:94509b79b13e69c209199af0757afbde8d2ebd6d</id>
<content type='text'>
BTRFS volume consists of a number of subvolumes which can be mounted separately
from each other. The top-level subvolume always exists even if no subvolumes
were created manually. A subvolume can be denoted as the default subvolume i.e.
the subvolume which is mounted by default.

The default "default subvolume" is the top-level one, but this is far from the
common practices used in the wild. For instance, openSUSE provides an OS
snapshot/rollback feature based on BTRFS. To achieve this, the actual OS root
filesystem is located into a separate subvolume which is "default" but not
"top-level". That means that the /boot/dtb/ directory is also located inside
this default subvolume instead of top-level one.

However, the existing btrfs u-boot driver always uses the top-level subvolume
as the filesystem root. This behaviour 1) is inconsistent with

    mount /dev/sda1 /target

command, which mount the default subvolume 2) leads to the issues when
/boot/dtb cannot be found properly (see the reference).

This patch uses the default subvolume as the filesystem root to overcome
mentioned issues.

Reference: https://bugzilla.suse.com/show_bug.cgi?id=1185656
Signed-off-by: Matwey V. Kornilov &lt;matwey.kornilov@gmail.com&gt;
Fixes: f06bfcf54d0e ("fs: btrfs: Crossport open_ctree_fs_info() from btrfs-progs")
Reviewed-by: Qu Wenruo &lt;wqu@suse.com&gt;
</content>
</entry>
<entry>
<title>Use LIB_UUID with ACPIGEN and FS_BTRFS</title>
<updated>2021-07-28T18:27:54Z</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2021-07-02T18:36:15Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=8b6ee2484cf7eadc2be6e1768f894acd07856b43'/>
<id>urn:sha1:8b6ee2484cf7eadc2be6e1768f894acd07856b43</id>
<content type='text'>
Since the ACPI-generation code makes use of UUIDs we typically need to
enabled UUID support for it to build. Add a new Kconfig condition.

Use it for BTRFS also.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>fs: btrfs: Add missing cache aligned allocation</title>
<updated>2021-05-26T21:26:07Z</updated>
<author>
<name>Marek Vasut</name>
<email>marex@denx.de</email>
</author>
<published>2021-05-17T22:39:39Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=9e8bb078859a559b17effdb21bafdb050b859b6e'/>
<id>urn:sha1:9e8bb078859a559b17effdb21bafdb050b859b6e</id>
<content type='text'>
The superblock buffer must be cache aligned, since it might be used
in DMA context, allocate it using ALLOC_CACHE_ALIGN_BUFFER() just
like it was done in btrfs_read_superblock() and read_tree_node().

This fixes this output on boot and non-working btrfs on iMX53:
CACHE: Misaligned operation at range [ced299d0, ced2a9d0]

Signed-off-by: Marek Vasut &lt;marex@denx.de&gt;
Cc: Marek Behún &lt;marek.behun@nic.cz&gt;
Cc: Qu Wenruo &lt;wqu@suse.com&gt;
Reviewed-by: Marek Behún &lt;marek.behun@nic.cz&gt;
</content>
</entry>
<entry>
<title>fs: btrfs: fix the false alert of decompression failure</title>
<updated>2021-04-27T12:05:30Z</updated>
<author>
<name>Qu Wenruo</name>
<email>wqu@suse.com</email>
</author>
<published>2021-04-17T12:52:13Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=dae9aeda45277de24161d0f68f1a9468758f166e'/>
<id>urn:sha1:dae9aeda45277de24161d0f68f1a9468758f166e</id>
<content type='text'>
There are some cases where decompressed sectors can have padding zeros.

In kernel code, we have lines to address such situation:

        /*
         * btrfs_getblock is doing a zero on the tail of the page too,
         * but this will cover anything missing from the decompressed
         * data.
         */
        if (bytes &lt; destlen)
                memset(kaddr+bytes, 0, destlen-bytes);
        kunmap_local(kaddr);

But not in U-boot code, thus we have some reports of U-boot failed to
read compressed files in btrfs.

Fix it by doing the same thing of the kernel, for both inline and
regular compressed extents.

Reported-by: Matwey Kornilov &lt;matwey.kornilov@gmail.com&gt;
Link: https://bugzilla.suse.com/show_bug.cgi?id=1183717
Fixes: a26a6bedafcf ("fs: btrfs: Introduce btrfs_read_extent_inline() and btrfs_read_extent_reg()")
Signed-off-by: Qu Wenruo &lt;wqu@suse.com&gt;
</content>
</entry>
</feed>
