Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP2:Update
btrfsprogs
btrfs-progs-backref-allow-backref-walk-to-handl...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File btrfs-progs-backref-allow-backref-walk-to-handle-direct-parent-ref.patch of Package btrfsprogs
From: Qu Wenruo <wqu@suse.com> Subject: btrfs-progs: backref: Allow backref walk to handle direct parent ref Git-commit: e6055097d12220c455468f01023e80c457b4e344 Patch-mainline: v4.14.2 References: bsc#1125340 [BUG] Btrfs lowmem mode fails with the following ASSERT() on certain valid image. ------ backref.c:466: __add_missing_keys: Assertion `ref->root_id` failed, value 0 ------ [REASON] Lowmem mode uses btrfs_find_all_roots() when walking down fs trees. However if a tree block with only shared parent backref like below, backref code from btrfs-progs doesn't handle it correct. ------ item 72 key (604653731840 METADATA_ITEM 0) itemoff 13379 itemsize 60 refs 4 gen 7198 flags TREE_BLOCK|FULL_BACKREF tree block skinny level 0 shared block backref parent 604498477056 shared block backref parent 604498460672 shared block backref parent 604498444288 shared block backref parent 604498411520 ------ Such shared block ref is *direct* ref, which means we don't need to solve its key, nor its rootid. As the objective of backref walk is to find all direct parents until it reaches tree root. So for such direct ref, it should be pended to pref_stat->pending, other than pending it to pref_stat->pending_missing_key. [FIX] For direct ref, pending it to pref_state->pending directly to solve the problem. Reported-by: Chris Murphy <chris@colorremedies.com> Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com> Acked-by: Jeff Mahoney <jeffm@suse.com> --- backref.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backref.c b/backref.c index 8615f6b8..27309e07 100644 --- a/backref.c +++ b/backref.c @@ -206,6 +206,9 @@ static int __add_prelim_ref(struct pref_state *prefstate, u64 root_id, if (key) { ref->key_for_search = *key; head = &prefstate->pending; + } else if (parent) { + memset(&ref->key_for_search, 0, sizeof(ref->key_for_search)); + head = &prefstate->pending; } else { memset(&ref->key_for_search, 0, sizeof(ref->key_for_search)); head = &prefstate->pending_missing_keys;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor