]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
libxfs: fix libxfs_trans_alloc callsite problems
authorDarrick J. Wong <darrick.wong@oracle.com>
Thu, 4 Oct 2018 19:17:01 +0000 (14:17 -0500)
committerEric Sandeen <sandeen@redhat.com>
Thu, 4 Oct 2018 19:17:01 +0000 (14:17 -0500)
Fix some incorrect libxfs_trans_alloc callers to check return values
correctly.

[sandeen: tweaks to backport before libxfs updates]
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/proto.c
mkfs/xfs_mkfs.c

index 7186036e51ee3eb13f62ee06f05a1d09287f40d7..9eb15ab03059e38ade9cd8966fc72a60c2b2d611 100644 (file)
@@ -192,7 +192,9 @@ rsvfile(
        /*
         * update the inode timestamp, mode, and prealloc flag bits
         */
-       libxfs_trans_alloc(mp, &tres, 0, 0, 0, &tp);
+       error = -libxfs_trans_alloc(mp, &tres, 0, 0, 0, &tp);
+       if (error)
+               fail(_("allocating transaction for a file"), error);
        libxfs_trans_ijoin(tp, ip, 0);
 
        VFS_I(ip)->i_mode &= ~S_ISUID;
index 2e53c1e83b6a77c73307a508638b3dae51387d7c..c6ef3a710fd04c097895b021eed00da73ff16ff0 100644 (file)
@@ -3677,7 +3677,7 @@ initialise_ag_freespace(
        struct xfs_trans_res tres = {0};
        int                     c;
 
-       c = libxfs_trans_alloc(mp, &tres, worst_freelist, 0, 0, &tp);
+       c = -libxfs_trans_alloc(mp, &tres, worst_freelist, 0, 0, &tp);
        if (c)
                res_failed(c);