diff options
author | Dan Robertson <dan@dlrobertson.com> | 2021-05-14 20:02:44 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:03 -0400 |
commit | d125615a4e22194dff9cecd12ec5a608f8c0f920 (patch) | |
tree | 595668abd79b6e0c1fb295dce911a877e3171703 /fs/bcachefs/buckets.c | |
parent | e1036ce5810222620c98660d64ccc649652cf6c9 (diff) | |
download | lwn-d125615a4e22194dff9cecd12ec5a608f8c0f920.tar.gz lwn-d125615a4e22194dff9cecd12ec5a608f8c0f920.zip |
bcachefs: properly initialize used values
- Ensure the second key value in bch_hash_info is initialized to zero
if the info type is of type BCH_STR_HASH_SIPHASH.
- Initialize the possibly returned value in bch2_inode_create. Assuming
bch2_btree_iter_peek returns bkey_s_c_null, the uninitialized value
of ret could be returned to the user as an error pointer.
- Fix compiler warning in initialization of bkey_s_c_stripe
fs/bcachefs/buckets.c:1646:35: warning: suggest braces around initialization
of subobject [-Wmissing-braces]
struct bkey_s_c_stripe new_s = { NULL };
^~~~
Signed-off-by: Dan Robertson <dan@dlrobertson.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/buckets.c')
-rw-r--r-- | fs/bcachefs/buckets.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/bcachefs/buckets.c b/fs/bcachefs/buckets.c index 8806e8306e4e..dad1c7d27bab 100644 --- a/fs/bcachefs/buckets.c +++ b/fs/bcachefs/buckets.c @@ -1646,8 +1646,8 @@ static int bch2_trans_mark_stripe(struct btree_trans *trans, struct bkey_s_c old, struct bkey_s_c new, unsigned flags) { - struct bkey_s_c_stripe old_s = { NULL }; - struct bkey_s_c_stripe new_s = { NULL }; + struct bkey_s_c_stripe old_s = { .k = NULL }; + struct bkey_s_c_stripe new_s = { .k = NULL }; struct bch_replicas_padded r; unsigned i; int ret = 0; |