]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_repair: print better information when metadata updates fail
authorDarrick J. Wong <darrick.wong@oracle.com>
Fri, 1 Nov 2019 19:48:56 +0000 (15:48 -0400)
committerEric Sandeen <sandeen@sandeen.net>
Fri, 1 Nov 2019 19:48:56 +0000 (15:48 -0400)
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 <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
repair/phase6.c

index 28e633deb2cd4c0534da882f86be2907a2783b8b..91d208a6708cb9d7889f6aec4bf660f31ea0acdc 100644 (file)
@@ -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);
                        }