summaryrefslogtreecommitdiff
path: root/libbcachefs/lru.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-11-26 22:33:04 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2023-11-27 21:04:03 -0500
commit97c86db4f286fef4c7c18b5b96940e64c97e31b4 (patch)
tree6f8f0dfd31a6f0a4f23e23b76552575bf1b0f532 /libbcachefs/lru.c
parent7465d1934c0c1538b0be0ec348364a95e948a651 (diff)
Update bcachefs sources to feaca6edbd24 mean and variance: Promote to lib/math
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'libbcachefs/lru.c')
-rw-r--r--libbcachefs/lru.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libbcachefs/lru.c b/libbcachefs/lru.c
index 5340f2d0..82c08a98 100644
--- a/libbcachefs/lru.c
+++ b/libbcachefs/lru.c
@@ -123,9 +123,11 @@ int bch2_check_lru_key(struct btree_trans *trans,
if (lru_k.k->type != KEY_TYPE_set ||
lru_pos_time(lru_k.k->p) != idx) {
if (!bpos_eq(*last_flushed_pos, lru_k.k->p)) {
- *last_flushed_pos = lru_k.k->p;
- ret = bch2_btree_write_buffer_flush_sync(trans) ?:
- -BCH_ERR_transaction_restart_write_buffer_flush;
+ ret = bch2_btree_write_buffer_flush_sync(trans);
+ if (!ret) {
+ *last_flushed_pos = lru_k.k->p;
+ ret = -BCH_ERR_transaction_restart_write_buffer_flush;
+ }
goto out;
}