Skip to content

Commit 840c2fb

Browse files
author
Kent Overstreet
committed
bcachefs: Fix assertion pop in bch2_ptr_swab()
This runs on extents that haven't yet been validated, so we don't want to assert that we have a valid entry type. Reported-by: [email protected] Signed-off-by: Kent Overstreet <[email protected]>
1 parent 657d428 commit 840c2fb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

fs/bcachefs/extents.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1364,7 +1364,7 @@ void bch2_ptr_swab(struct bkey_s k)
13641364
for (entry = ptrs.start;
13651365
entry < ptrs.end;
13661366
entry = extent_entry_next(entry)) {
1367-
switch (extent_entry_type(entry)) {
1367+
switch (__extent_entry_type(entry)) {
13681368
case BCH_EXTENT_ENTRY_ptr:
13691369
break;
13701370
case BCH_EXTENT_ENTRY_crc32:
@@ -1384,6 +1384,9 @@ void bch2_ptr_swab(struct bkey_s k)
13841384
break;
13851385
case BCH_EXTENT_ENTRY_rebalance:
13861386
break;
1387+
default:
1388+
/* Bad entry type: will be caught by validate() */
1389+
return;
13871390
}
13881391
}
13891392
}

0 commit comments

Comments
 (0)