Re: [PATCH 05/12] xfs_repair: inject lost blocks back into the fs no matter the owner

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jun 01, 2020 at 09:27:24PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@xxxxxxxxxx>
> 
> In repair phase 5, inject_lost_blocks takes the blocks that we allocated
> but didn't use for constructing the new AG btrees and puts them back in
> the filesystem by adding them to the free space.  The only btree that
> can overestimate like that are the free space btrees, but in principle,
> any of the btrees can do that.  If the others did, the rmap record owner
> for those blocks won't necessarily be OWNER_AG, and if it isn't, repair
> will fail.
> 
> Get rid of this logic bomb so that we can use it for /any/ block count
> overestimation, and then we can use it to clean up after all
> reconstruction of any btree type.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx>
> ---

Reviewed-by: Brian Foster <bfoster@xxxxxxxxxx>

>  repair/phase5.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> 
> diff --git a/repair/phase5.c b/repair/phase5.c
> index 44a6bda8..75c480fd 100644
> --- a/repair/phase5.c
> +++ b/repair/phase5.c
> @@ -2516,8 +2516,8 @@ inject_lost_blocks(
>  		if (error)
>  			goto out_cancel;
>  
> -		error = -libxfs_free_extent(tp, *fsb, 1, &XFS_RMAP_OINFO_AG,
> -					    XFS_AG_RESV_NONE);
> +		error = -libxfs_free_extent(tp, *fsb, 1,
> +				&XFS_RMAP_OINFO_ANY_OWNER, XFS_AG_RESV_NONE);
>  		if (error)
>  			goto out_cancel;
>  
> 




[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux