bcachefs: Fix bucket data type for stripe buckets
authorKent Overstreet <kent.overstreet@linux.dev>
Sun, 26 Nov 2023 04:55:26 +0000 (23:55 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Tue, 28 Nov 2023 22:18:24 +0000 (17:18 -0500)
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/buckets.c

index 61e4cc09ad831b56de3b4405c01e9cc9d4d6530b..5a91d3189fcf7ea95615d46dd11a9ad83f8e8363 100644 (file)
@@ -854,8 +854,12 @@ static int __mark_pointer(struct btree_trans *trans,
                return ret;
 
        *dst_sectors += sectors;
-       *bucket_data_type = *dirty_sectors || *cached_sectors
-               ? ptr_data_type : 0;
+
+       if (!*dirty_sectors && !*cached_sectors)
+               *bucket_data_type = 0;
+       else if (*bucket_data_type != BCH_DATA_stripe)
+               *bucket_data_type = ptr_data_type;
+
        return 0;
 }