From: Darrick J. Wong Date: Sun, 1 Mar 2020 17:33:38 +0000 (-0500) Subject: xfs_repair: check that metadata updates have been committed X-Git-Tag: v5.5.0-rc1~29 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=14fb361365078a9950dcb919a652c3f5b60b4fff;p=users%2Fhch%2Fxfsprogs.git xfs_repair: check that metadata updates have been committed Make sure that any metadata that we repaired or regenerated has been written to disk. If that fails, exit with 1 to signal that there are still errors in the filesystem. Signed-off-by: Darrick J. Wong Reviewed-by: Brian Foster Signed-off-by: Eric Sandeen --- diff --git a/repair/xfs_repair.c b/repair/xfs_repair.c index 2c15125f6..6b4635349 100644 --- a/repair/xfs_repair.c +++ b/repair/xfs_repair.c @@ -703,6 +703,7 @@ main(int argc, char **argv) struct xfs_sb psb; int rval; struct xfs_ino_geometry *igeo; + int error; progname = basename(argv[0]); setlocale(LC_ALL, ""); @@ -1104,7 +1105,13 @@ _("Note - stripe unit (%d) and width (%d) were copied from a backup superblock.\ */ libxfs_bcache_flush(); format_log_max_lsn(mp); - libxfs_umount(mp); + + /* Report failure if anything failed to get written to our fs. */ + error = -libxfs_umount(mp); + if (error) + do_error( + _("File system metadata writeout failed, err=%d. Re-run xfs_repair."), + error); libxfs_destroy(&x);