]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
mkfs: fix incorrect error message
authorDarrick J. Wong <darrick.wong@oracle.com>
Fri, 1 Nov 2019 19:49:08 +0000 (15:49 -0400)
committerEric Sandeen <sandeen@sandeen.net>
Fri, 1 Nov 2019 19:49:08 +0000 (15:49 -0400)
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 <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
mkfs/xfs_mkfs.c

index 10a40cd4cde6163cb516cc16ed94f0139ff564ad..18338a61476913a443f1f43f025a484925ce0e49 100644 (file)
@@ -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);
+       }
 }
 
 /*