From: Darrick J. Wong Date: Fri, 1 Nov 2019 19:48:56 +0000 (-0400) Subject: xfs_repair: print better information when metadata updates fail X-Git-Tag: v5.3.0-rc2~58 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=af06261f3b09e42d69d65d4f4a70a620d8494eb5;p=thirdparty%2Fxfsprogs-dev.git xfs_repair: print better information when metadata updates fail If a metadata update fails during phase 6, we should print an error message that can be traced back to a specific line of code. Also, res_failed spits out a general message about "xfs_trans_reserve failed", which is probably not where the failure happened. Fix two incorrect call sites. Signed-off-by: Darrick J. Wong Reviewed-by: Eric Sandeen Signed-off-by: Eric Sandeen --- diff --git a/repair/phase6.c b/repair/phase6.c index 28e633deb..91d208a67 100644 --- a/repair/phase6.c +++ b/repair/phase6.c @@ -1354,7 +1354,8 @@ longform_dir2_rebuild( error = dir_binval(tp, ip, XFS_DATA_FORK); if (error) - res_failed(error); + do_error(_("error %d invalidating directory %llu blocks\n"), + error, (unsigned long long)ip->i_ino); if ((error = -libxfs_bmap_last_offset(ip, &lastblock, XFS_DATA_FORK))) do_error(_("xfs_bmap_last_offset failed -- error - %d\n"), @@ -2972,7 +2973,10 @@ process_dir_inode( XFS_ILOG_CORE | XFS_ILOG_DDATA); error = -libxfs_trans_commit(tp); if (error) - res_failed(error); + do_error( +_("error %d fixing shortform directory %llu\n"), + error, + (unsigned long long)ip->i_ino); } else { libxfs_trans_cancel(tp); }