From a7bbf186ec35e2f595cfe327e80502feca260b24 Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Thu, 4 Oct 2018 14:17:01 -0500 Subject: [PATCH] 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 --- mkfs/proto.c | 4 +++- mkfs/xfs_mkfs.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) 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); -- 2.47.2