Skip to content

tree reading cleanups in mount

Nikolay Borisov linux-btrfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest8 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8btrfs: Cleanup and simplify find_newest_super_backupfs/btrfs/disk-io.c+10 -191 reply
2/8btrfs: Remove newest_gen argument from find_oldest_super_backupfs/btrfs/disk-io.c+2 -40 replies
3/8btrfs: Add read_backup_rootfs/btrfs/disk-io.c+44 -00 replies
4/8btrfs: Factor out tree roots initialization during mountfs/btrfs/disk-io.c+83 -570 replies
5/8btrfs: Don't use objectid_mutex during mountfs/btrfs/disk-io.c+4 -30 replies
6/8btrfs: Remove unused next_root_backup functionfs/btrfs/disk-io.c+0 -500 replies
7/8btrfs: Rename find_oldest_super_backup to init_backup_root_slotfs/btrfs/disk-io.c+4 -60 replies
8/8btrfs: Streamline btrfs_fs_info::backup_root_index semanticsfs/btrfs/disk-io.c+9 -390 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/8] tree reading cleanups in mount

Hello,

Here is the second version of the tree reading code which gets executed during mount. This goes a bit further than the previous posting in that it not only introduces a new function but also refactors the code which decides which backup root to use. Overall I think the semantics are now much cleaner and centralised in a single function - init_tree_roots rather than split between mount and backup root write out.

The series starts gradually by simplifying find_newest_super_backup and its callers (patches 1-2).

It then paves the way forward by introducing read_backup_rooti (patch 3) which supersedes (patch 4) next_root_backup, the latter is then removed (patch 6). While at it I also remove the unnecessary objectid mutex during mount (patch 5).

The final 2 patches streamlines how btrfs_fs_info::backup_root_index is being initialised.

This patchset has been tested by simulating (via btrfs-corrupt-block) corruption of the primary root and resorting to using usebackuproot mount option. I've also added a regression test to btrfs-progs that will follow shortly.

Nikolay Borisov (8):
btrfs: Cleanup and simplify find_newest_super_backup
btrfs: Remove newest_gen argument from find_oldest_super_backup
btrfs: Add read_backup_root
btrfs: Factor out tree roots initialization during mount
btrfs: Don't use objectid_mutex during mount
btrfs: Remove unused next_root_backup function
btrfs: Rename find_oldest_super_backup to init_backup_root_slot
btrfs: Streamline btrfs_fs_info::backup_root_index semantics

 fs/btrfs/disk-io.c | 252 ++++++++++++++++++++-------------------------
 1 file changed, 113 insertions(+), 139 deletions(-)
Signature · 1 line
2.17.1