From: Darrick J. Wong Date: Thu, 4 Oct 2018 19:17:01 +0000 (-0500) Subject: libxfs: fix libxfs_trans_alloc callsite problems X-Git-Tag: v4.19.0-rc0~92 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a7bbf186ec35e2f595cfe327e80502feca260b24;p=thirdparty%2Fxfsprogs-dev.git libxfs: fix libxfs_trans_alloc callsite problems 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 Reviewed-by: Eric Sandeen Signed-off-by: Eric Sandeen --- diff --git a/mkfs/proto.c b/mkfs/proto.c index 7186036e5..9eb15ab03 100644 --- a/mkfs/proto.c +++ b/mkfs/proto.c @@ -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; diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c index 2e53c1e83..c6ef3a710 100644 --- a/mkfs/xfs_mkfs.c +++ b/mkfs/xfs_mkfs.c @@ -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);