[1/3] xfs: xrep_reap_extents should not destroy the bitmap
diff mbox series

Message ID 157063972033.2913192.3828052500812376869.stgit@magnolia
State New
Headers show
Series
  • xfs: fix online repair block reaping
Related show

Commit Message

Darrick J. Wong Oct. 9, 2019, 4:48 p.m. UTC
From: Darrick J. Wong <darrick.wong@oracle.com>

Remove the xfs_bitmap_destroy call from the end of xrep_reap_extents
because this sort of violates our rule that the function initializing a
structure should destroy it.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 fs/xfs/scrub/agheader_repair.c |    2 +-
 fs/xfs/scrub/repair.c          |    4 +---
 2 files changed, 2 insertions(+), 4 deletions(-)

Comments

Brian Foster Oct. 17, 2019, 12:54 p.m. UTC | #1
On Wed, Oct 09, 2019 at 09:48:40AM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Remove the xfs_bitmap_destroy call from the end of xrep_reap_extents
> because this sort of violates our rule that the function initializing a
> structure should destroy it.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  fs/xfs/scrub/agheader_repair.c |    2 +-
>  fs/xfs/scrub/repair.c          |    4 +---
>  2 files changed, 2 insertions(+), 4 deletions(-)
> 
> 
> diff --git a/fs/xfs/scrub/agheader_repair.c b/fs/xfs/scrub/agheader_repair.c
> index 7a1a38b636a9..8fcd43040c96 100644
> --- a/fs/xfs/scrub/agheader_repair.c
> +++ b/fs/xfs/scrub/agheader_repair.c
> @@ -698,7 +698,7 @@ xrep_agfl(
>  		goto err;
>  
>  	/* Dump any AGFL overflow. */
> -	return xrep_reap_extents(sc, &agfl_extents, &XFS_RMAP_OINFO_AG,
> +	error = xrep_reap_extents(sc, &agfl_extents, &XFS_RMAP_OINFO_AG,
>  			XFS_AG_RESV_AGFL);
>  err:
>  	xfs_bitmap_destroy(&agfl_extents);
> diff --git a/fs/xfs/scrub/repair.c b/fs/xfs/scrub/repair.c
> index b70a88bc975e..3a58788e0bd8 100644
> --- a/fs/xfs/scrub/repair.c
> +++ b/fs/xfs/scrub/repair.c
> @@ -613,11 +613,9 @@ xrep_reap_extents(
>  
>  		error = xrep_reap_block(sc, fsbno, oinfo, type);
>  		if (error)
> -			goto out;
> +			break;
>  	}
>  
> -out:
> -	xfs_bitmap_destroy(bitmap);
>  	return error;
>  }
>  
>

Patch
diff mbox series

diff --git a/fs/xfs/scrub/agheader_repair.c b/fs/xfs/scrub/agheader_repair.c
index 7a1a38b636a9..8fcd43040c96 100644
--- a/fs/xfs/scrub/agheader_repair.c
+++ b/fs/xfs/scrub/agheader_repair.c
@@ -698,7 +698,7 @@  xrep_agfl(
 		goto err;
 
 	/* Dump any AGFL overflow. */
-	return xrep_reap_extents(sc, &agfl_extents, &XFS_RMAP_OINFO_AG,
+	error = xrep_reap_extents(sc, &agfl_extents, &XFS_RMAP_OINFO_AG,
 			XFS_AG_RESV_AGFL);
 err:
 	xfs_bitmap_destroy(&agfl_extents);
diff --git a/fs/xfs/scrub/repair.c b/fs/xfs/scrub/repair.c
index b70a88bc975e..3a58788e0bd8 100644
--- a/fs/xfs/scrub/repair.c
+++ b/fs/xfs/scrub/repair.c
@@ -613,11 +613,9 @@  xrep_reap_extents(
 
 		error = xrep_reap_block(sc, fsbno, oinfo, type);
 		if (error)
-			goto out;
+			break;
 	}
 
-out:
-	xfs_bitmap_destroy(bitmap);
 	return error;
 }