From: Darrick J. Wong Date: Fri, 1 Nov 2019 19:49:08 +0000 (-0400) Subject: mkfs: fix incorrect error message X-Git-Tag: v5.3.0-rc2~56 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5770b2f08d4ce8bf0c2f1708ff3937fce4f202cd;p=thirdparty%2Fxfsprogs-dev.git mkfs: fix incorrect error message If we encounter a failure while fixing the freelist during mkfs, we shouldn't print a misleading message about space reservation. Fix it so that we print something about what we were trying to do when the error happened. Signed-off-by: Darrick J. Wong Reviewed-by: Eric Sandeen Signed-off-by: Eric Sandeen --- diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c index 10a40cd4c..18338a614 100644 --- a/mkfs/xfs_mkfs.c +++ b/mkfs/xfs_mkfs.c @@ -3481,8 +3481,11 @@ initialise_ag_freespace( libxfs_alloc_fix_freelist(&args, 0); libxfs_perag_put(args.pag); c = -libxfs_trans_commit(tp); - if (c) - res_failed(c); + if (c) { + errno = c; + perror(_("initializing AG free space list")); + exit(1); + } } /*