From: Alan Huang Date: Sat, 3 May 2025 20:03:42 +0000 (+0800) Subject: bcachefs: Fix inconsistent req->ec X-Git-Tag: v6.16-rc1~211^2~107 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3c97ebea61e3ebdbab5b2564296a86d601b632e6;p=thirdparty%2Fkernel%2Flinux.git bcachefs: Fix inconsistent req->ec There is req->ec = erasure_code above. Signed-off-by: Alan Huang Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/alloc_foreground.c b/fs/bcachefs/alloc_foreground.c index e87b95f609c53..2d7f32f9499e7 100644 --- a/fs/bcachefs/alloc_foreground.c +++ b/fs/bcachefs/alloc_foreground.c @@ -1255,6 +1255,9 @@ int bch2_alloc_sectors_start_trans(struct btree_trans *trans, if (unlikely(ret)) return ret; + if (!IS_ENABLED(CONFIG_BCACHEFS_ERASURE_CODING)) + erasure_code = false; + req->nr_replicas = nr_replicas; req->target = target; req->ec = erasure_code; @@ -1262,9 +1265,6 @@ int bch2_alloc_sectors_start_trans(struct btree_trans *trans, req->flags = flags; req->devs_have = devs_have; - if (!IS_ENABLED(CONFIG_BCACHEFS_ERASURE_CODING)) - erasure_code = false; - BUG_ON(!nr_replicas || !nr_replicas_required); retry: req->ptrs.nr = 0;