summaryrefslogtreecommitdiff
path: root/fs/bcachefs/replicas.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-11-26 05:42:08 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-11-29 01:18:24 +0300
commitd5bd37872a93e07ef3f9cbd4e2044ba4e17b5021 (patch)
tree384c3cf27f42ae8703eae10696a1e49ee4f3a2f7 /fs/bcachefs/replicas.h
parentbbc3a46065d08f9ab3412b1f26bbfa778c444833 (diff)
downloadlinux-d5bd37872a93e07ef3f9cbd4e2044ba4e17b5021.tar.xz
bcachefs: Add missing validation for jset_entry_data_usage
Validation was completely missing for replicas entries in the journal (not the superblock replicas section) - we can't have replicas entries pointing to invalid devices. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/replicas.h')
-rw-r--r--fs/bcachefs/replicas.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/bcachefs/replicas.h b/fs/bcachefs/replicas.h
index 4887675a86f0..f70a642775d1 100644
--- a/fs/bcachefs/replicas.h
+++ b/fs/bcachefs/replicas.h
@@ -9,6 +9,8 @@
void bch2_replicas_entry_sort(struct bch_replicas_entry *);
void bch2_replicas_entry_to_text(struct printbuf *,
struct bch_replicas_entry *);
+int bch2_replicas_entry_validate(struct bch_replicas_entry *,
+ struct bch_sb *, struct printbuf *);
void bch2_cpu_replicas_to_text(struct printbuf *, struct bch_replicas_cpu *);
static inline struct bch_replicas_entry *