mirror of
https://github.com/kdave/btrfs-progs
synced 2024-12-26 16:12:34 +00:00
btrfs-progs: fix extent key endian bug in repair
Extents rebuilt from backrefs can have their objectid mangled. The code tried to build a disk_key by hand and got the swabbing backwards. Signed-off-by: Zach Brown <zab@redhat.com> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
This commit is contained in:
parent
2cd95f945a
commit
47c072c2d8
@ -3931,9 +3931,12 @@ static int record_extent(struct btrfs_trans_handle *trans,
|
||||
bi = (struct btrfs_tree_block_info *)(ei + 1);
|
||||
memset_extent_buffer(leaf, 0, (unsigned long)bi,
|
||||
sizeof(*bi));
|
||||
memset(©_key, 0, sizeof(copy_key));
|
||||
|
||||
copy_key.objectid = le64_to_cpu(rec->info_objectid);
|
||||
btrfs_set_disk_key_objectid(©_key,
|
||||
rec->info_objectid);
|
||||
btrfs_set_disk_key_type(©_key, 0);
|
||||
btrfs_set_disk_key_offset(©_key, 0);
|
||||
|
||||
btrfs_set_tree_block_level(leaf, bi, rec->info_level);
|
||||
btrfs_set_tree_block_key(leaf, bi, ©_key);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user