mirror of
https://github.com/torvalds/linux.git
synced 2026-06-03 20:14:06 +02:00
bcachefs: copygc shouldn't try moving buckets on error
Co-developed-by: Kent Overstreet <kent.overstreet@linux.dev> Signed-off-by: Daniel Hill <daniel@gluo.nz> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
3f0e297d86
commit
a79e1b6dea
|
|
@ -170,15 +170,23 @@ static int bch2_copygc_get_buckets(struct moving_context *ctxt,
|
|||
|
||||
saw++;
|
||||
|
||||
if (!bch2_bucket_is_movable(trans, &b, lru_pos_time(k.k->p)))
|
||||
ret2 = bch2_bucket_is_movable(trans, &b, lru_pos_time(k.k->p));
|
||||
if (ret2 < 0)
|
||||
goto err;
|
||||
|
||||
if (!ret2)
|
||||
not_movable++;
|
||||
else if (bucket_in_flight(buckets_in_flight, b.k))
|
||||
in_flight++;
|
||||
else {
|
||||
ret2 = darray_push(buckets, b) ?: buckets->nr >= nr_to_get;
|
||||
if (ret2 >= 0)
|
||||
sectors += b.sectors;
|
||||
ret2 = darray_push(buckets, b);
|
||||
if (ret2)
|
||||
goto err;
|
||||
sectors += b.sectors;
|
||||
}
|
||||
|
||||
ret2 = buckets->nr >= nr_to_get;
|
||||
err:
|
||||
ret2;
|
||||
}));
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user