Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'bcachefs-2023-12-27' of https://evilpiepirate.org/git/bcachefs

Pull bcachefs fixes from Kent Overstreet:
"Just a few fixes: besides a few one liners, we have a fix for
snapshots + compression where the extent update path didn't account
for the fact that with snapshots, we might split an existing extent
into three, not just two; and a small fixup for promotes which were
broken by the recent changes in the data update path to correctly take
into account device durability"

* tag 'bcachefs-2023-12-27' of https://evilpiepirate.org/git/bcachefs:
bcachefs: Fix promotes
bcachefs: Fix leakage of internal error code
bcachefs: Fix insufficient disk reservation with compression + snapshots
bcachefs: fix BCH_FSCK_ERR enum

+16 -12
+8 -7
fs/bcachefs/btree_update.c
··· 186 186 enum btree_id btree_id = iter->btree_id; 187 187 struct bkey_i *update; 188 188 struct bpos new_start = bkey_start_pos(new.k); 189 - bool front_split = bkey_lt(bkey_start_pos(old.k), new_start); 190 - bool back_split = bkey_gt(old.k->p, new.k->p); 189 + unsigned front_split = bkey_lt(bkey_start_pos(old.k), new_start); 190 + unsigned back_split = bkey_gt(old.k->p, new.k->p); 191 + unsigned middle_split = (front_split || back_split) && 192 + old.k->p.snapshot != new.k->p.snapshot; 193 + unsigned nr_splits = front_split + back_split + middle_split; 191 194 int ret = 0, compressed_sectors; 192 195 193 196 /* ··· 198 195 * so that __bch2_trans_commit() can increase our disk 199 196 * reservation: 200 197 */ 201 - if (((front_split && back_split) || 202 - ((front_split || back_split) && old.k->p.snapshot != new.k->p.snapshot)) && 198 + if (nr_splits > 1 && 203 199 (compressed_sectors = bch2_bkey_sectors_compressed(old))) 204 - trans->extra_journal_res += compressed_sectors; 200 + trans->extra_journal_res += compressed_sectors * (nr_splits - 1); 205 201 206 202 if (front_split) { 207 203 update = bch2_bkey_make_mut_noupdate(trans, old); ··· 218 216 } 219 217 220 218 /* If we're overwriting in a different snapshot - middle split: */ 221 - if (old.k->p.snapshot != new.k->p.snapshot && 222 - (front_split || back_split)) { 219 + if (middle_split) { 223 220 update = bch2_bkey_make_mut_noupdate(trans, old); 224 221 if ((ret = PTR_ERR_OR_ZERO(update))) 225 222 return ret;
+2 -1
fs/bcachefs/data_update.c
··· 587 587 * Increasing replication is an explicit operation triggered by 588 588 * rereplicate, currently, so that users don't get an unexpected -ENOSPC 589 589 */ 590 - if (durability_have >= io_opts.data_replicas) { 590 + if (!(m->data_opts.write_flags & BCH_WRITE_CACHED) && 591 + durability_have >= io_opts.data_replicas) { 591 592 m->data_opts.kill_ptrs |= m->data_opts.rewrite_ptrs; 592 593 m->data_opts.rewrite_ptrs = 0; 593 594 /* if iter == NULL, it's just a promote */
+1 -1
fs/bcachefs/error.h
··· 157 157 #define fsck_err_on(cond, c, _err_type, ...) \ 158 158 __fsck_err_on(cond, c, FSCK_CAN_FIX|FSCK_CAN_IGNORE, _err_type, __VA_ARGS__) 159 159 160 + __printf(4, 0) 160 161 static inline void bch2_bkey_fsck_err(struct bch_fs *c, 161 162 struct printbuf *err_msg, 162 163 enum bch_sb_error_id err_type, ··· 168 167 va_start(args, fmt); 169 168 prt_vprintf(err_msg, fmt, args); 170 169 va_end(args); 171 - 172 170 } 173 171 174 172 #define bkey_fsck_err(c, _err_msg, _err_type, ...) \
+4 -2
fs/bcachefs/journal_io.c
··· 408 408 return 0; 409 409 } 410 410 411 - return journal_validate_key(c, jset, entry, 1, entry->btree_id, k, 412 - version, big_endian, flags); 411 + ret = journal_validate_key(c, jset, entry, 1, entry->btree_id, k, 412 + version, big_endian, flags); 413 + if (ret == FSCK_DELETED_KEY) 414 + ret = 0; 413 415 fsck_err: 414 416 return ret; 415 417 }
+1 -1
fs/bcachefs/sb-errors.h
··· 65 65 x(btree_node_bkey_out_of_order, 57) \ 66 66 x(btree_root_bkey_invalid, 58) \ 67 67 x(btree_root_read_error, 59) \ 68 - x(btree_root_bad_min_key, 50) \ 68 + x(btree_root_bad_min_key, 60) \ 69 69 x(btree_root_bad_max_key, 61) \ 70 70 x(btree_node_read_error, 62) \ 71 71 x(btree_node_topology_bad_min_key, 63) \