Commit c763c433 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'bcachefs-2024-09-04' of git://evilpiepirate.org/bcachefs

Pull bcachefs fixes from Kent Overstreet:

 - Fix a typo in the rebalance accounting changes

 - BCH_SB_MEMBER_INVALID: small on disk format feature which will be
   needed for full erasure coding support; this is only the minimum so
   that 6.11 can handle future versions without barfing.

* tag 'bcachefs-2024-09-04' of git://evilpiepirate.org/bcachefs:
  bcachefs: BCH_SB_MEMBER_INVALID
  bcachefs: fix rebalance accounting
parents 2adad548 53f66195
...@@ -876,7 +876,7 @@ int bch2_trigger_extent(struct btree_trans *trans, ...@@ -876,7 +876,7 @@ int bch2_trigger_extent(struct btree_trans *trans,
need_rebalance_delta -= s != 0; need_rebalance_delta -= s != 0;
need_rebalance_sectors_delta -= s; need_rebalance_sectors_delta -= s;
s = bch2_bkey_sectors_need_rebalance(c, old); s = bch2_bkey_sectors_need_rebalance(c, new.s_c);
need_rebalance_delta += s != 0; need_rebalance_delta += s != 0;
need_rebalance_sectors_delta += s; need_rebalance_sectors_delta += s;
......
...@@ -82,7 +82,8 @@ int bch2_replicas_entry_validate(struct bch_replicas_entry_v1 *r, ...@@ -82,7 +82,8 @@ int bch2_replicas_entry_validate(struct bch_replicas_entry_v1 *r,
} }
for (unsigned i = 0; i < r->nr_devs; i++) for (unsigned i = 0; i < r->nr_devs; i++)
if (!bch2_member_exists(sb, r->devs[i])) { if (r->devs[i] != BCH_SB_MEMBER_INVALID &&
!bch2_member_exists(sb, r->devs[i])) {
prt_printf(err, "invalid device %u in entry ", r->devs[i]); prt_printf(err, "invalid device %u in entry ", r->devs[i]);
goto bad; goto bad;
} }
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
void bch2_dev_missing(struct bch_fs *c, unsigned dev) void bch2_dev_missing(struct bch_fs *c, unsigned dev)
{ {
if (dev != BCH_SB_MEMBER_INVALID)
bch2_fs_inconsistent(c, "pointer to nonexistent device %u", dev); bch2_fs_inconsistent(c, "pointer to nonexistent device %u", dev);
} }
......
...@@ -8,6 +8,11 @@ ...@@ -8,6 +8,11 @@
*/ */
#define BCH_SB_MEMBERS_MAX 64 #define BCH_SB_MEMBERS_MAX 64
/*
* Sentinal value - indicates a device that does not exist
*/
#define BCH_SB_MEMBER_INVALID 255
#define BCH_MIN_NR_NBUCKETS (1 << 6) #define BCH_MIN_NR_NBUCKETS (1 << 6)
#define BCH_IOPS_MEASUREMENTS() \ #define BCH_IOPS_MEASUREMENTS() \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment