projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
87cb023
)
bcachefs: fix unsafety in bch2_extent_ptr_to_text()
author
Kent Overstreet
<kent.overstreet@linux.dev>
Fri, 12 Apr 2024 01:20:27 +0000
(21:20 -0400)
committer
Kent Overstreet
<kent.overstreet@linux.dev>
Sun, 14 Apr 2024 02:48:16 +0000
(22:48 -0400)
Need to check if we have a valid bucket before checking if ptr is stale
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/extents.c
patch
|
blob
|
history
diff --git
a/fs/bcachefs/extents.c
b/fs/bcachefs/extents.c
index 0e3ca99fbd2de1522c5e8dea8ac313232f60f7f3..36d12d2adb81e80207f63b7066f59f71a3c89f7c 100644
(file)
--- a/
fs/bcachefs/extents.c
+++ b/
fs/bcachefs/extents.c
@@
-998,7
+998,9
@@
void bch2_extent_ptr_to_text(struct printbuf *out, struct bch_fs *c, const struc
prt_str(out, " cached");
if (ptr->unwritten)
prt_str(out, " unwritten");
- if (ca && ptr_stale(ca, ptr))
+ if (b >= ca->mi.first_bucket &&
+ b < ca->mi.nbuckets &&
+ ptr_stale(ca, ptr))
prt_printf(out, " stale");
}
}