bcachefs: Fix uninitialized var warning
authorKent Overstreet <kent.overstreet@linux.dev>
Tue, 28 May 2024 22:20:52 +0000 (18:20 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Tue, 28 May 2024 22:21:51 +0000 (18:21 -0400)
Can't actually be used uninitialized, but gcc was being silly.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/backpointers.c
fs/bcachefs/buckets.c

index 692b1c7d5018c876bb41883e8443e3517dbd3be8..4321f9fb73bd9f7e098b663e20f516b0c505f6d4 100644 (file)
@@ -690,7 +690,7 @@ static int check_extent_to_backpointers(struct btree_trans *trans,
 
        ptrs = bch2_bkey_ptrs_c(k);
        bkey_for_each_ptr_decode(k.k, ptrs, p, entry) {
-               struct bpos bucket_pos;
+               struct bpos bucket_pos = POS_MIN;
                struct bch_backpointer bp;
 
                if (p.ptr.cached)
index b469586517a86dbbf60110838208d3633f55cbe6..ed97712d0db1edc1b9564700342f2f8ffca06361 100644 (file)
@@ -1134,7 +1134,7 @@ static int __trigger_extent(struct btree_trans *trans,
        r.e.nr_required = 1;
 
        bkey_for_each_ptr_decode(k.k, ptrs, p, entry) {
-               s64 disk_sectors;
+               s64 disk_sectors = 0;
                ret = bch2_trigger_pointer(trans, btree_id, level, k, p, entry, &disk_sectors, flags);
                if (ret < 0)
                        return ret;