diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2020-12-17 15:08:58 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2020-12-17 15:55:45 -0500 |
commit | 6e007529f71ad21871f1d918b72378ed56af5cd4 (patch) | |
tree | 7d60ffc4d58be57f8fcd5923e982af7d06a3b8fd /fs/bcachefs/journal_io.c | |
parent | bc47a622bf2bb3bdb0e290f1cfe0ab5d3da75021 (diff) |
bcachefs: Reduce/kill BKEY_PADDED usetest
With various newer key types - stripe keys, inline data extents - the
old approach of calculating the maximum size of the value is becoming
more and more error prone. Better to switch to bkey_on_stack, which can
dynamically allocate if necessary to handle any size bkey.
In particular we also want to get rid of BKEY_EXTENT_VAL_U64s_MAX.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/journal_io.c')
-rw-r--r-- | fs/bcachefs/journal_io.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/bcachefs/journal_io.c b/fs/bcachefs/journal_io.c index 0e6fbe2f6a75..93a8bfcbcc53 100644 --- a/fs/bcachefs/journal_io.c +++ b/fs/bcachefs/journal_io.c @@ -990,6 +990,8 @@ static int journal_write_alloc(struct journal *j, struct journal_buf *w, done: rcu_read_unlock(); + BUG_ON(bkey_bytes(&w->key.k) > sizeof(w->key)); + return replicas >= c->opts.metadata_replicas_required ? 0 : -EROFS; } |