From 5770b2f08d4ce8bf0c2f1708ff3937fce4f202cd Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Fri, 1 Nov 2019 15:49:08 -0400 Subject: [PATCH] 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 --- mkfs/xfs_mkfs.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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); + } } /* -- 2.47.2