public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs: zoned: use local fs_info variable in btrfs_load_block_group_dup
@ 2026-01-23  8:14 Johannes Thumshirn
  2026-01-26 17:38 ` Daniel Vacek
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Johannes Thumshirn @ 2026-01-23  8:14 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Naohiro Aota, Johannes Thumshirn

btrfs_load_block_group_dup() has a local pointer to fs_info, yet the
error prints dereference fs_info from the block_group.

Use local fs_info variable to make the code more uniform.

Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
---
 fs/btrfs/zoned.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c
index 1ad4147d8bae..f74bd9099d8a 100644
--- a/fs/btrfs/zoned.c
+++ b/fs/btrfs/zoned.c
@@ -1438,13 +1438,13 @@ static int btrfs_load_block_group_dup(struct btrfs_block_group *bg,
 	bg->zone_capacity = min_not_zero(zone_info[0].capacity, zone_info[1].capacity);
 
 	if (unlikely(zone_info[0].alloc_offset == WP_MISSING_DEV)) {
-		btrfs_err(bg->fs_info,
+		btrfs_err(fs_info,
 			  "zoned: cannot recover write pointer for zone %llu",
 			  zone_info[0].physical);
 		return -EIO;
 	}
 	if (unlikely(zone_info[1].alloc_offset == WP_MISSING_DEV)) {
-		btrfs_err(bg->fs_info,
+		btrfs_err(fs_info,
 			  "zoned: cannot recover write pointer for zone %llu",
 			  zone_info[1].physical);
 		return -EIO;
@@ -1465,7 +1465,7 @@ static int btrfs_load_block_group_dup(struct btrfs_block_group *bg,
 	}
 
 	if (unlikely(zone_info[0].alloc_offset != zone_info[1].alloc_offset)) {
-		btrfs_err(bg->fs_info,
+		btrfs_err(fs_info,
 			  "zoned: write pointer offset mismatch of zones in DUP profile");
 		return -EIO;
 	}
-- 
2.52.0


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

* Re: [PATCH] btrfs: zoned: use local fs_info variable in btrfs_load_block_group_dup
  2026-01-23  8:14 [PATCH] btrfs: zoned: use local fs_info variable in btrfs_load_block_group_dup Johannes Thumshirn
@ 2026-01-26 17:38 ` Daniel Vacek
  2026-01-26 21:32 ` Qu Wenruo
  2026-01-28  5:44 ` Naohiro Aota
  2 siblings, 0 replies; 4+ messages in thread
From: Daniel Vacek @ 2026-01-26 17:38 UTC (permalink / raw)
  To: Johannes Thumshirn; +Cc: linux-btrfs, Naohiro Aota

On Fri, 23 Jan 2026 at 09:19, Johannes Thumshirn
<johannes.thumshirn@wdc.com> wrote:
>
> btrfs_load_block_group_dup() has a local pointer to fs_info, yet the
> error prints dereference fs_info from the block_group.
>
> Use local fs_info variable to make the code more uniform.
>
> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

Reviewed-by: Daniel Vacek <neelx@suse.com>

> ---
>  fs/btrfs/zoned.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c
> index 1ad4147d8bae..f74bd9099d8a 100644
> --- a/fs/btrfs/zoned.c
> +++ b/fs/btrfs/zoned.c
> @@ -1438,13 +1438,13 @@ static int btrfs_load_block_group_dup(struct btrfs_block_group *bg,
>         bg->zone_capacity = min_not_zero(zone_info[0].capacity, zone_info[1].capacity);
>
>         if (unlikely(zone_info[0].alloc_offset == WP_MISSING_DEV)) {
> -               btrfs_err(bg->fs_info,
> +               btrfs_err(fs_info,
>                           "zoned: cannot recover write pointer for zone %llu",
>                           zone_info[0].physical);
>                 return -EIO;
>         }
>         if (unlikely(zone_info[1].alloc_offset == WP_MISSING_DEV)) {
> -               btrfs_err(bg->fs_info,
> +               btrfs_err(fs_info,
>                           "zoned: cannot recover write pointer for zone %llu",
>                           zone_info[1].physical);
>                 return -EIO;
> @@ -1465,7 +1465,7 @@ static int btrfs_load_block_group_dup(struct btrfs_block_group *bg,
>         }
>
>         if (unlikely(zone_info[0].alloc_offset != zone_info[1].alloc_offset)) {
> -               btrfs_err(bg->fs_info,
> +               btrfs_err(fs_info,
>                           "zoned: write pointer offset mismatch of zones in DUP profile");
>                 return -EIO;
>         }
> --
> 2.52.0
>
>

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

* Re: [PATCH] btrfs: zoned: use local fs_info variable in btrfs_load_block_group_dup
  2026-01-23  8:14 [PATCH] btrfs: zoned: use local fs_info variable in btrfs_load_block_group_dup Johannes Thumshirn
  2026-01-26 17:38 ` Daniel Vacek
@ 2026-01-26 21:32 ` Qu Wenruo
  2026-01-28  5:44 ` Naohiro Aota
  2 siblings, 0 replies; 4+ messages in thread
From: Qu Wenruo @ 2026-01-26 21:32 UTC (permalink / raw)
  To: Johannes Thumshirn, linux-btrfs; +Cc: Naohiro Aota



在 2026/1/23 18:44, Johannes Thumshirn 写道:
> btrfs_load_block_group_dup() has a local pointer to fs_info, yet the
> error prints dereference fs_info from the block_group.
> 
> Use local fs_info variable to make the code more uniform.
> 
> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

Reviewed-by: Qu Wenruo <wqu@suse.com>

Thanks,
Qu

> ---
>   fs/btrfs/zoned.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c
> index 1ad4147d8bae..f74bd9099d8a 100644
> --- a/fs/btrfs/zoned.c
> +++ b/fs/btrfs/zoned.c
> @@ -1438,13 +1438,13 @@ static int btrfs_load_block_group_dup(struct btrfs_block_group *bg,
>   	bg->zone_capacity = min_not_zero(zone_info[0].capacity, zone_info[1].capacity);
>   
>   	if (unlikely(zone_info[0].alloc_offset == WP_MISSING_DEV)) {
> -		btrfs_err(bg->fs_info,
> +		btrfs_err(fs_info,
>   			  "zoned: cannot recover write pointer for zone %llu",
>   			  zone_info[0].physical);
>   		return -EIO;
>   	}
>   	if (unlikely(zone_info[1].alloc_offset == WP_MISSING_DEV)) {
> -		btrfs_err(bg->fs_info,
> +		btrfs_err(fs_info,
>   			  "zoned: cannot recover write pointer for zone %llu",
>   			  zone_info[1].physical);
>   		return -EIO;
> @@ -1465,7 +1465,7 @@ static int btrfs_load_block_group_dup(struct btrfs_block_group *bg,
>   	}
>   
>   	if (unlikely(zone_info[0].alloc_offset != zone_info[1].alloc_offset)) {
> -		btrfs_err(bg->fs_info,
> +		btrfs_err(fs_info,
>   			  "zoned: write pointer offset mismatch of zones in DUP profile");
>   		return -EIO;
>   	}


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

* Re: [PATCH] btrfs: zoned: use local fs_info variable in btrfs_load_block_group_dup
  2026-01-23  8:14 [PATCH] btrfs: zoned: use local fs_info variable in btrfs_load_block_group_dup Johannes Thumshirn
  2026-01-26 17:38 ` Daniel Vacek
  2026-01-26 21:32 ` Qu Wenruo
@ 2026-01-28  5:44 ` Naohiro Aota
  2 siblings, 0 replies; 4+ messages in thread
From: Naohiro Aota @ 2026-01-28  5:44 UTC (permalink / raw)
  To: Johannes Thumshirn, linux-btrfs@vger.kernel.org; +Cc: Naohiro Aota

On Fri Jan 23, 2026 at 5:14 PM JST, Johannes Thumshirn wrote:
> btrfs_load_block_group_dup() has a local pointer to fs_info, yet the
> error prints dereference fs_info from the block_group.
>
> Use local fs_info variable to make the code more uniform.
>
> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

Looks good.

Reviewed-by: Naohiro Aota <naohiro.aota@wdc.com>

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

end of thread, other threads:[~2026-01-28  5:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-23  8:14 [PATCH] btrfs: zoned: use local fs_info variable in btrfs_load_block_group_dup Johannes Thumshirn
2026-01-26 17:38 ` Daniel Vacek
2026-01-26 21:32 ` Qu Wenruo
2026-01-28  5:44 ` Naohiro Aota

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