diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-02-05 14:07:34 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:50 -0400 |
commit | 464b415539cc543addb45b85e76c44da145b114c (patch) | |
tree | d24baa17293d6b4494df07c60731190e3fc4eb7c /fs/bcachefs/btree_update.h | |
parent | 4e3d18991a7d1138604f0975e7849d9a2d82c524 (diff) | |
download | linux-464b415539cc543addb45b85e76c44da145b114c.tar.gz linux-464b415539cc543addb45b85e76c44da145b114c.tar.bz2 linux-464b415539cc543addb45b85e76c44da145b114c.zip |
bcachefs: Fix bch2_trans_reset_updates()
This should have been resetting trans->fs_usage_deltas as well.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/btree_update.h')
-rw-r--r-- | fs/bcachefs/btree_update.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/bcachefs/btree_update.h b/fs/bcachefs/btree_update.h index 7e9f1f170d5f..9a3c859ea572 100644 --- a/fs/bcachefs/btree_update.h +++ b/fs/bcachefs/btree_update.h @@ -154,6 +154,14 @@ static inline void bch2_trans_reset_updates(struct btree_trans *trans) trans->nr_updates = 0; trans->hooks = NULL; trans->extra_journal_entries.nr = 0; + + if (trans->fs_usage_deltas) { + trans->fs_usage_deltas->used = 0; + memset((void *) trans->fs_usage_deltas + + offsetof(struct replicas_delta_list, memset_start), 0, + (void *) &trans->fs_usage_deltas->memset_end - + (void *) &trans->fs_usage_deltas->memset_start); + } } #endif /* _BCACHEFS_BTREE_UPDATE_H */ |