Hello community, here is the log from the commit of package btrfsprogs for openSUSE:Leap:15.2 checked in at 2020-04-08 12:48:21 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Leap:15.2/btrfsprogs (Old) and /work/SRC/openSUSE:Leap:15.2/.btrfsprogs.new.3248 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "btrfsprogs" Wed Apr 8 12:48:21 2020 rev:41 rq:791339 version:4.19.1 Changes: -------- --- /work/SRC/openSUSE:Leap:15.2/btrfsprogs/btrfsprogs.changes 2020-01-15 14:49:03.533365419 +0100 +++ /work/SRC/openSUSE:Leap:15.2/.btrfsprogs.new.3248/btrfsprogs.changes 2020-04-08 12:49:02.918363037 +0200 @@ -1,0 +2,15 @@ +Fri Feb 7 10:14:26 UTC 2020 - Libor Pechacek <[email protected]> + +- btrfs-progs: check: fix segfault with -Q (bsc#1158560) +- Added patches: + * btrfs-progs-check-initialize-qgroup_item_count-in-ea.patch + +------------------------------------------------------------------- +Wed Jul 24 14:51:09 UTC 2019 - [email protected] + +- btrfs-progs: check: fixup_extent_flags needs to deal with non-skinny + metadata (bsc#1131334). +- Added patches: + * btrfs-progs-check-fixup_extent_flags-needs-to-deal-with-non-skinny-metadata.patch + +------------------------------------------------------------------- New: ---- btrfs-progs-check-fixup_extent_flags-needs-to-deal-with-non-skinny-metadata.patch btrfs-progs-check-initialize-qgroup_item_count-in-ea.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ btrfsprogs.spec ++++++ --- /var/tmp/diff_new_pack.LfVOhI/_old 2020-04-08 12:49:04.050363628 +0200 +++ /var/tmp/diff_new_pack.LfVOhI/_new 2020-04-08 12:49:04.050363628 +0200 @@ -58,6 +58,8 @@ Patch4: 0003-btrfs-progs-Remove-fsid-metdata_uuid-fields-from-fs_.patch Patch5: 0004-btrfs-progs-Remove-btrfs_fs_info-new_fsid.patch Patch6: 0005-btrfs-progs-Directly-pass-root-to-change_devices_uui.patch +Patch7: btrfs-progs-check-fixup_extent_flags-needs-to-deal-with-non-skinny-metadata.patch +Patch8: btrfs-progs-check-initialize-qgroup_item_count-in-ea.patch %if %build_docs BuildRequires: asciidoc @@ -188,6 +190,8 @@ %patch4 -p1 %patch5 -p1 %patch6 -p1 +%patch7 -p1 +%patch8 -p1 %build ./autogen.sh ++++++ btrfs-progs-check-fixup_extent_flags-needs-to-deal-with-non-skinny-metadata.patch ++++++ From: Jeff Mahoney <[email protected]> Subject: btrfs-progs: check: fixup_extent_flags needs to deal with non-skinny metadata Git-commit: 50faf73f22d12269614ecf55fc5ee48ab7d1cf3b Patch-mainline: v5.1 References: bsc#1131334 When repairing a file system created by a very old kernel, I ran into issues fixing up the extent flags since fixup_extent_flags assumed that a METADATA_ITEM would be present if the record was for metadata. Since METADATA_ITEMs don't exist without skinny metadata, we need to fall back to EXTENT_ITEMs. This also falls back to EXTENT_ITEMs even with skinny metadata enabled as other parts of the tools do. Reviewed-by: Filipe Manana <[email protected]> Signed-off-by: Jeff Mahoney <[email protected]> Signed-off-by: David Sterba <[email protected]> --- check/main.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/check/main.c b/check/main.c index 683c322e..e6b866f8 100644 --- a/check/main.c +++ b/check/main.c @@ -7634,9 +7634,13 @@ static int fixup_extent_flags(struct btrfs_fs_info *fs_info, struct btrfs_key key; u64 flags; int ret = 0; + bool metadata_item = rec->metadata; + if (!btrfs_fs_incompat(root->fs_info, SKINNY_METADATA)) + metadata_item = false; +retry: key.objectid = rec->start; - if (rec->metadata) { + if (metadata_item) { key.type = BTRFS_METADATA_ITEM_KEY; key.offset = rec->info_level; } else { @@ -7655,6 +7659,10 @@ static int fixup_extent_flags(struct btrfs_fs_info *fs_info, btrfs_commit_transaction(trans, root); return ret; } else if (ret) { + if (key.type == BTRFS_METADATA_ITEM_KEY) { + metadata_item = false; + goto retry; + } fprintf(stderr, "Didn't find extent for %llu\n", (unsigned long long)rec->start); btrfs_release_path(&path); ++++++ btrfs-progs-check-initialize-qgroup_item_count-in-ea.patch ++++++ >From b9b5d2c6ef280f15517350c7bbd85963b1cdd2a9 Mon Sep 17 00:00:00 2001 From: Naohiro Aota <[email protected]> Date: Tue, 23 Jul 2019 18:19:11 +0900 Subject: [PATCH] btrfs-progs: check: initialize qgroup_item_count in earlier stage Git-commit: 8ca6c0c3c718 Patch-mainline: v5.2.1 References: bsc#1158560 "btrfsck -Q" segfaults because it does not call qgroup_set_item_count_ptr() Properly: # btrfsck -Q /dev/sdk Opening filesystem to check... Checking filesystem on /dev/sdk UUID: 34a35bbc-43f8-40f0-8043-65ed33f2e6c3 Print quota groups for /dev/sdk UUID: 34a35bbc-43f8-40f0-8043-65ed33f2e6c3 Segmentation fault (core dumped) Since "struct task_ctx ctx" is global, we can just move qgroup_set_item_count_ptr() much earlier stage in the check process to avoid to forget initializing it. Signed-off-by: Naohiro Aota <[email protected]> Reviewed-by: Qu Wenruo <[email protected]> Signed-off-by: David Sterba <[email protected]> Acked-by: Libor Pechacek <[email protected]> --- check/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: btrfs-progs-v4.19.1/check/main.c =================================================================== --- btrfs-progs-v4.19.1.orig/check/main.c +++ btrfs-progs-v4.19.1/check/main.c @@ -9688,6 +9688,7 @@ int cmd_check(int argc, char **argv) radix_tree_init(); cache_tree_init(&root_cache); + qgroup_set_item_count_ptr(&ctx.item_count); ret = check_mounted(argv[optind]); if (!force) { @@ -10014,7 +10015,6 @@ int cmd_check(int argc, char **argv) } if (info->quota_enabled) { - qgroup_set_item_count_ptr(&ctx.item_count); if (!ctx.progress_enabled) { fprintf(stderr, "[7/7] checking quota groups\n"); } else {
