u-boot/fs/btrfs
Matwey V. Kornilov 94509b79b1 btrfs: Use default subvolume as filesystem root
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 <matwey.kornilov@gmail.com>
Fixes: f06bfcf54d ("fs: btrfs: Crossport open_ctree_fs_info() from btrfs-progs")
Reviewed-by: Qu Wenruo <wqu@suse.com>
2021-09-01 10:11:24 -04:00
..
common fs: btrfs: Crossport rbtree-utils from btrfs-progs 2020-09-07 20:57:27 -04:00
crypto fs: btrfs: Add more checksum algorithms 2020-09-07 20:57:27 -04:00
kernel-shared fs: btrfs: Sync btrfs_btree.h from kernel 2020-09-07 20:57:27 -04:00
btrfs.c fs: btrfs: change directory list output to be aligned as before 2021-02-24 16:51:48 -05:00
btrfs.h fs: btrfs: Cleanup the old implementation 2020-09-07 21:00:36 -04:00
compat.h fs: btrfs: Introduce function to resolve path in one subvolume 2020-09-07 21:00:36 -04:00
compression.c fs: btrfs: Cleanup the old implementation 2020-09-07 21:00:36 -04:00
conv-funcs.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
ctree.c fs: btrfs: Cleanup the old implementation 2020-09-07 21:00:36 -04:00
ctree.h fs: btrfs: Cleanup the old implementation 2020-09-07 21:00:36 -04:00
dev.c common: Drop part.h from common header 2020-05-18 17:33:33 -04:00
dir-item.c fs: btrfs: Cleanup the old implementation 2020-09-07 21:00:36 -04:00
disk-io.c btrfs: Use default subvolume as filesystem root 2021-09-01 10:11:24 -04:00
disk-io.h fs: btrfs: Cleanup the old implementation 2020-09-07 21:00:36 -04:00
extent-cache.c fs: btrfs: Crossport extent-cache.[ch] from btrfs-progs 2020-09-07 20:57:27 -04:00
extent-cache.h fs: btrfs: Crossport extent-cache.[ch] from btrfs-progs 2020-09-07 20:57:27 -04:00
extent-io.c fs: btrfs: Cleanup the old implementation 2020-09-07 21:00:36 -04:00
extent-io.h fs: btrfs: Crossport extent-io.[ch] from btrfs-progs 2020-09-07 20:57:27 -04:00
inode.c fs: btrfs: fix the false alert of decompression failure 2021-04-27 08:05:30 -04:00
Kconfig Use LIB_UUID with ACPIGEN and FS_BTRFS 2021-07-28 14:27:54 -04:00
Makefile fs: btrfs: Cleanup the old implementation 2020-09-07 21:00:36 -04:00
root-tree.c fs: btrfs: Crossport open_ctree_fs_info() from btrfs-progs 2020-09-07 20:57:27 -04:00
subvolume.c fs: btrfs: Cleanup the old implementation 2020-09-07 21:00:36 -04:00
volumes.c fs: btrfs: volumes: prevent overflow for multiplying 2021-01-20 14:01:08 -05:00
volumes.h fs: btrfs: Crossport btrfs_read_sys_array() and btrfs_read_chunk_tree() 2020-09-07 20:57:27 -04:00