Skip to content

Commit dd018c2

Browse files
committed
Merge tag 'bcachefs-2024-07-22' of https://evilpiepirate.org/git/bcachefs
Pull bcachefs fixes from Kent Overstreet: - another fix for fsck getting stuck, from marcin - small syzbot fix - another undefined shift fix * tag 'bcachefs-2024-07-22' of https://evilpiepirate.org/git/bcachefs: bcachefs: Fix printbuf usage while atomic bcachefs: More informative error message in reattach_inode() bcachefs: kill btree_trans_too_many_iters() in bch2_bucket_alloc_freelist() bcachefs: mean_and_variance: Avoid too-large shift amounts
2 parents 5ea6d72 + 737759f commit dd018c2

File tree

4 files changed

+9
-11
lines changed

4 files changed

+9
-11
lines changed

fs/bcachefs/alloc_foreground.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -496,12 +496,6 @@ static struct open_bucket *bch2_bucket_alloc_freelist(struct btree_trans *trans,
496496
for (alloc_cursor = max(alloc_cursor, bkey_start_offset(k.k));
497497
alloc_cursor < k.k->p.offset;
498498
alloc_cursor++) {
499-
ret = btree_trans_too_many_iters(trans);
500-
if (ret) {
501-
ob = ERR_PTR(ret);
502-
break;
503-
}
504-
505499
s->buckets_seen++;
506500

507501
u64 bucket = alloc_cursor & ~(~0ULL << 56);

fs/bcachefs/fsck.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ static int reattach_inode(struct btree_trans *trans,
283283
struct bch_inode_unpacked *inode,
284284
u32 inode_snapshot)
285285
{
286+
struct bch_fs *c = trans->c;
286287
struct bch_hash_info dir_hash;
287288
struct bch_inode_unpacked lostfound;
288289
char name_buf[20];
@@ -317,7 +318,7 @@ static int reattach_inode(struct btree_trans *trans,
317318
return ret;
318319
}
319320

320-
dir_hash = bch2_hash_info_init(trans->c, &lostfound);
321+
dir_hash = bch2_hash_info_init(c, &lostfound);
321322

322323
name = (struct qstr) QSTR(name_buf);
323324

@@ -330,8 +331,10 @@ static int reattach_inode(struct btree_trans *trans,
330331
inode->bi_subvol ?: inode->bi_inum,
331332
&dir_offset,
332333
STR_HASH_must_create);
333-
if (ret)
334+
if (ret) {
335+
bch_err_msg(c, ret, "error creating dirent");
334336
return ret;
337+
}
335338

336339
inode->bi_dir = lostfound.bi_inum;
337340
inode->bi_dir_offset = dir_offset;

fs/bcachefs/journal_reclaim.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ void bch2_journal_space_available(struct journal *j)
206206

207207
if (nr_online < metadata_replicas_required(c)) {
208208
struct printbuf buf = PRINTBUF;
209+
buf.atomic++;
209210
prt_printf(&buf, "insufficient writeable journal devices available: have %u, need %u\n"
210211
"rw journal devs:", nr_online, metadata_replicas_required(c));
211212

fs/bcachefs/mean_and_variance.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,11 @@ static inline u128_u u128_shl(u128_u i, s8 shift)
111111
{
112112
u128_u r;
113113

114-
r.lo = i.lo << shift;
114+
r.lo = i.lo << (shift & 63);
115115
if (shift < 64)
116-
r.hi = (i.hi << shift) | (i.lo >> (64 - shift));
116+
r.hi = (i.hi << (shift & 63)) | (i.lo >> (-shift & 63));
117117
else {
118-
r.hi = i.lo << (shift - 64);
118+
r.hi = i.lo << (-shift & 63);
119119
r.lo = 0;
120120
}
121121
return r;

0 commit comments

Comments
 (0)