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 <pulkomandy@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
This commit is contained in:
Jérôme Duval 2022-03-23 14:54:54 +01:00 committed by waddlesplash
parent 69cab3d4f6
commit 06c5115cf0

View File

@ -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);