public inbox for linux-bcachefs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bcachefs: Fix inconsistent req->ec
@ 2025-05-03 20:03 Alan Huang
  2025-05-03 20:08 ` Kent Overstreet
  0 siblings, 1 reply; 2+ messages in thread
From: Alan Huang @ 2025-05-03 20:03 UTC (permalink / raw)
  To: kent.overstreet; +Cc: linux-bcachefs, Alan Huang

There is req->ec = erasure_code above.

Signed-off-by: Alan Huang <mmpgouride@gmail.com>
---
 fs/bcachefs/alloc_foreground.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/bcachefs/alloc_foreground.c b/fs/bcachefs/alloc_foreground.c
index a0f92daa44cf..c17c5733526d 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;
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] bcachefs: Fix inconsistent req->ec
  2025-05-03 20:03 [PATCH] bcachefs: Fix inconsistent req->ec Alan Huang
@ 2025-05-03 20:08 ` Kent Overstreet
  0 siblings, 0 replies; 2+ messages in thread
From: Kent Overstreet @ 2025-05-03 20:08 UTC (permalink / raw)
  To: Alan Huang; +Cc: linux-bcachefs

On Sun, May 04, 2025 at 04:03:42AM +0800, Alan Huang wrote:
> There is req->ec = erasure_code above.
> 
> Signed-off-by: Alan Huang <mmpgouride@gmail.com>

Thanks, I screwed this up when I was reducing stack usage in the
allocator path - it was only busted in -next, fortunately.

> ---
>  fs/bcachefs/alloc_foreground.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/bcachefs/alloc_foreground.c b/fs/bcachefs/alloc_foreground.c
> index a0f92daa44cf..c17c5733526d 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;
> -- 
> 2.48.1
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-05-03 20:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-03 20:03 [PATCH] bcachefs: Fix inconsistent req->ec Alan Huang
2025-05-03 20:08 ` Kent Overstreet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox