mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 07:04:24 +00:00
bcachefs: Trust btree alloc info at runtime
This lets us avoid a cache miss in the write path. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
c4e065c23c
commit
ff929515cc
3 changed files with 4 additions and 1 deletions
|
@ -499,6 +499,7 @@ enum {
|
|||
/* misc: */
|
||||
BCH_FS_BDEV_MOUNTED,
|
||||
BCH_FS_FIXED_GENS,
|
||||
BCH_FS_ALLOC_WRITTEN,
|
||||
BCH_FS_REBUILD_REPLICAS,
|
||||
BCH_FS_HOLD_BTREE_WRITES,
|
||||
};
|
||||
|
|
|
@ -1456,7 +1456,7 @@ static int bch2_trans_mark_pointer(struct btree_trans *trans,
|
|||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
if (!ret) {
|
||||
if (!ret && unlikely(!test_bit(BCH_FS_ALLOC_WRITTEN, &c->flags))) {
|
||||
/*
|
||||
* During journal replay, and if gc repairs alloc info at
|
||||
* runtime, the alloc info in the btree might not be up to date
|
||||
|
|
|
@ -864,6 +864,8 @@ int bch2_fs_recovery(struct bch_fs *c)
|
|||
goto err;
|
||||
}
|
||||
bch_verbose(c, "alloc write done");
|
||||
|
||||
set_bit(BCH_FS_ALLOC_WRITTEN, &c->flags);
|
||||
}
|
||||
|
||||
if (!c->sb.clean) {
|
||||
|
|
Loading…
Reference in a new issue