Update bcachefs sources to 0389c09b2fb7 bcachefs: Fix bio alloc in check_extent_checksum()

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2024-04-17 17:34:18 -04:00
parent 59e04ddf40
commit 0e0aa31912
7 changed files with 11 additions and 8 deletions

View File

@ -1 +1 @@
10ca1f99f8c99a3d992b686cdc29d427807070e5 0389c09b2fb702ca7924ddf550ce0c8af708b8be

View File

@ -254,6 +254,7 @@ update-bcachefs-sources:
test -d libbcachefs || mkdir libbcachefs test -d libbcachefs || mkdir libbcachefs
cp $(LINUX_DIR)/fs/bcachefs/*.[ch] libbcachefs/ cp $(LINUX_DIR)/fs/bcachefs/*.[ch] libbcachefs/
git add libbcachefs/*.[ch] git add libbcachefs/*.[ch]
git rm -f libbcachefs/mean_and_variance_test.c
cp $(LINUX_DIR)/include/linux/closure.h include/linux/ cp $(LINUX_DIR)/include/linux/closure.h include/linux/
git add include/linux/closure.h git add include/linux/closure.h
cp $(LINUX_DIR)/lib/closure.c linux/ cp $(LINUX_DIR)/lib/closure.c linux/

View File

@ -470,7 +470,7 @@ found:
goto err; goto err;
} }
bio = bio_alloc(ca->disk_sb.bdev, 1, REQ_OP_READ, GFP_KERNEL); bio = bio_alloc(ca->disk_sb.bdev, buf_pages(data_buf, bytes), REQ_OP_READ, GFP_KERNEL);
bio->bi_iter.bi_sector = p.ptr.offset; bio->bi_iter.bi_sector = p.ptr.offset;
bch2_bio_map(bio, data_buf, bytes); bch2_bio_map(bio, data_buf, bytes);
ret = submit_bio_wait(bio); ret = submit_bio_wait(bio);

View File

@ -1504,7 +1504,8 @@ enum btree_id_flags {
BIT_ULL(KEY_TYPE_stripe)) \ BIT_ULL(KEY_TYPE_stripe)) \
x(reflink, 7, BTREE_ID_EXTENTS|BTREE_ID_DATA, \ x(reflink, 7, BTREE_ID_EXTENTS|BTREE_ID_DATA, \
BIT_ULL(KEY_TYPE_reflink_v)| \ BIT_ULL(KEY_TYPE_reflink_v)| \
BIT_ULL(KEY_TYPE_indirect_inline_data)) \ BIT_ULL(KEY_TYPE_indirect_inline_data)| \
BIT_ULL(KEY_TYPE_error)) \
x(subvolumes, 8, 0, \ x(subvolumes, 8, 0, \
BIT_ULL(KEY_TYPE_subvolume)) \ BIT_ULL(KEY_TYPE_subvolume)) \
x(snapshots, 9, 0, \ x(snapshots, 9, 0, \

View File

@ -1587,7 +1587,7 @@ static int bch2_gc_write_reflink_key(struct btree_trans *trans,
struct bkey_i *new = bch2_bkey_make_mut_noupdate(trans, k); struct bkey_i *new = bch2_bkey_make_mut_noupdate(trans, k);
ret = PTR_ERR_OR_ZERO(new); ret = PTR_ERR_OR_ZERO(new);
if (ret) if (ret)
return ret; goto out;
if (!r->refcount) if (!r->refcount)
new->k.type = KEY_TYPE_deleted; new->k.type = KEY_TYPE_deleted;
@ -1595,6 +1595,7 @@ static int bch2_gc_write_reflink_key(struct btree_trans *trans,
*bkey_refcount(bkey_i_to_s(new)) = cpu_to_le64(r->refcount); *bkey_refcount(bkey_i_to_s(new)) = cpu_to_le64(r->refcount);
ret = bch2_trans_update(trans, iter, new, 0); ret = bch2_trans_update(trans, iter, new, 0);
} }
out:
fsck_err: fsck_err:
printbuf_exit(&buf); printbuf_exit(&buf);
return ret; return ret;

View File

@ -463,8 +463,8 @@ static void __bch2_dev_btree_bitmap_mark(struct bch_sb_field_members_v2 *mi, uns
m->btree_bitmap_shift += resize; m->btree_bitmap_shift += resize;
} }
for (unsigned bit = sectors >> m->btree_bitmap_shift; for (unsigned bit = start >> m->btree_bitmap_shift;
bit << m->btree_bitmap_shift < end; (u64) bit << m->btree_bitmap_shift < end;
bit++) bit++)
bitmap |= BIT_ULL(bit); bitmap |= BIT_ULL(bit);

View File

@ -238,8 +238,8 @@ static inline bool bch2_dev_btree_bitmap_marked_sectors(struct bch_dev *ca, u64
if (end > 64ULL << ca->mi.btree_bitmap_shift) if (end > 64ULL << ca->mi.btree_bitmap_shift)
return false; return false;
for (unsigned bit = sectors >> ca->mi.btree_bitmap_shift; for (unsigned bit = start >> ca->mi.btree_bitmap_shift;
bit << ca->mi.btree_bitmap_shift < end; (u64) bit << ca->mi.btree_bitmap_shift < end;
bit++) bit++)
if (!(ca->mi.btree_allocated_bitmap & BIT_ULL(bit))) if (!(ca->mi.btree_allocated_bitmap & BIT_ULL(bit)))
return false; return false;