From: Darrick J. Wong Date: Wed, 12 Dec 2018 17:42:40 +0000 (-0600) Subject: xfs_repair: skip block reservation when fixing freelist X-Git-Tag: v4.20.0-rc1~25 X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fxfsprogs-dev.git;a=commitdiff_plain;h=f9c9fd94fd87e8361e773c3e3e05a05066049067 xfs_repair: skip block reservation when fixing freelist 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 Reviewed-by: Allison Henderson Reviewed-by: Eric Sandeen Signed-off-by: Eric Sandeen --- diff --git a/repair/rmap.c b/repair/rmap.c index ebb5a3ad5..c5a866468 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);