mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git
synced 2024-11-23 12:14:24 +08:00
btrfs-progs: prepare the latest device's superblock for commit
Add a flag to copy the superblock of the latest device to the fs_info::super_copy for the commit process, rather than using the superblock from the device specified in the argument. This serves as groundwork to enable recovery from an incomplete btrfstune -M|m|u|U operation. Signed-off-by: Anand Jain <anand.jain@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
9f6e0ab2a4
commit
66c4c9632f
@ -1513,6 +1513,9 @@ static struct btrfs_fs_info *__open_ctree_fd(int fp, struct open_ctree_args *oca
|
||||
if (flags & OPEN_CTREE_RECOVER_SUPER)
|
||||
ret = btrfs_read_dev_super(fs_devices->latest_bdev, disk_super,
|
||||
sb_bytenr, SBREAD_RECOVER);
|
||||
else if (flags & OPEN_CTREE_USE_LATEST_BDEV)
|
||||
ret = btrfs_read_dev_super(fs_devices->latest_bdev, disk_super,
|
||||
sb_bytenr, sbflags);
|
||||
else
|
||||
ret = btrfs_read_dev_super(fp, disk_super, sb_bytenr,
|
||||
sbflags);
|
||||
|
@ -104,6 +104,11 @@ enum btrfs_open_ctree_flags {
|
||||
* specific checks and only do the superficial checks.
|
||||
*/
|
||||
OPEN_CTREE_SKIP_LEAF_ITEM_CHECKS = (1U << 17),
|
||||
|
||||
/*
|
||||
* Use the superblock of the latest device for the transaction commit.
|
||||
*/
|
||||
OPEN_CTREE_USE_LATEST_BDEV = (1U << 18),
|
||||
};
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user