diff mbox series

[3/6] xfs_repair: skip block reservation when fixing freelist

Message ID 154181073309.3727.6459189318125795042.stgit@magnolia (mailing list archive)
State Accepted
Headers show
Series xfsprogs-4.20: various fixes | expand

Commit Message

Darrick J. Wong Nov. 10, 2018, 12:45 a.m. UTC
From: Darrick J. Wong <darrick.wong@oracle.com>

AGFL blocks are considered to be part of the fdblocks count, so there's
no need to obtain a block reservation when fixing the AGFL as part of
repair.  Asking for a reservation can cause repair to fail if the
superblock claims zero fdblocks because we haven't gotten far enough
into phase 5 to have reset the superblock counters.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 repair/rmap.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Allison Henderson Nov. 10, 2018, 7:22 a.m. UTC | #1
On 11/9/18 5:45 PM, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> AGFL blocks are considered to be part of the fdblocks count, so there's
> no need to obtain a block reservation when fixing the AGFL as part of
> repair.  Asking for a reservation can cause repair to fail if the
> superblock claims zero fdblocks because we haven't gotten far enough
> into phase 5 to have reset the superblock counters.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
>   repair/rmap.c |    3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> 
> diff --git a/repair/rmap.c b/repair/rmap.c
> index ebb5a3ad..c5a86646 100644
> --- a/repair/rmap.c
> +++ b/repair/rmap.c
> @@ -1374,8 +1374,7 @@ fix_freelist(
>   	args.agno = agno;
>   	args.alignment = 1;
>   	args.pag = libxfs_perag_get(mp, agno);
> -	error = -libxfs_trans_alloc_rollable(mp,
> -			libxfs_alloc_min_freelist(mp, args.pag), &tp);
> +	error = -libxfs_trans_alloc_rollable(mp, 0, &tp);
>   	if (error)
>   		do_error(_("failed to fix AGFL on AG %d, error %d\n"),
>   				agno, error);
> 

Ok, you can add my review:
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Eric Sandeen Nov. 28, 2018, 11:34 p.m. UTC | #2
On 11/9/18 6:45 PM, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> AGFL blocks are considered to be part of the fdblocks count, so there's
> no need to obtain a block reservation when fixing the AGFL as part of
> repair.  Asking for a reservation can cause repair to fail if the
> superblock claims zero fdblocks because we haven't gotten far enough
> into phase 5 to have reset the superblock counters.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

OK, makes sense to me.

Reviewed-by: Eric Sandeen <sandeen@redhat.com>

> ---
>  repair/rmap.c |    3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> 
> diff --git a/repair/rmap.c b/repair/rmap.c
> index ebb5a3ad..c5a86646 100644
> --- a/repair/rmap.c
> +++ b/repair/rmap.c
> @@ -1374,8 +1374,7 @@ fix_freelist(
>  	args.agno = agno;
>  	args.alignment = 1;
>  	args.pag = libxfs_perag_get(mp, agno);
> -	error = -libxfs_trans_alloc_rollable(mp,
> -			libxfs_alloc_min_freelist(mp, args.pag), &tp);
> +	error = -libxfs_trans_alloc_rollable(mp, 0, &tp);
>  	if (error)
>  		do_error(_("failed to fix AGFL on AG %d, error %d\n"),
>  				agno, error);
>
diff mbox series

Patch

diff --git a/repair/rmap.c b/repair/rmap.c
index ebb5a3ad..c5a86646 100644
--- a/repair/rmap.c
+++ b/repair/rmap.c
@@ -1374,8 +1374,7 @@  fix_freelist(
 	args.agno = agno;
 	args.alignment = 1;
 	args.pag = libxfs_perag_get(mp, agno);
-	error = -libxfs_trans_alloc_rollable(mp,
-			libxfs_alloc_min_freelist(mp, args.pag), &tp);
+	error = -libxfs_trans_alloc_rollable(mp, 0, &tp);
 	if (error)
 		do_error(_("failed to fix AGFL on AG %d, error %d\n"),
 				agno, error);