btrfs: check status before the flags

Flags() uses fItem.
should help with #14486

Change-Id: I2593280f92e9843a2d57d66bf9b793748fb14f3d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5141
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
This commit is contained in:
Jérôme Duval
2022-03-23 15:52:34 +00:00
committed by waddlesplash
parent 69cab3d4f6
commit 06c5115cf0
@@ -413,7 +413,7 @@ BlockGroup::Initialize(uint64 flag)
while (true) {
status = fCurrentExtentTree->FindNext(&path, fKey, (void**)&fItem);
if ((Flags() & flag) == flag || status != B_OK)
if (status != B_OK || (Flags() & flag) == flag)
break;
fKey.SetObjectID(End());
fKey.SetOffset(0);