From patchwork Fri Sep 28 01:04:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 10618827 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 61242913 for ; Fri, 28 Sep 2018 01:04:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 518EA2ACE7 for ; Fri, 28 Sep 2018 01:04:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 43BED2AE4C; Fri, 28 Sep 2018 01:04:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EAF8A2ACE7 for ; Fri, 28 Sep 2018 01:04:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726091AbeI1HZv (ORCPT ); Fri, 28 Sep 2018 03:25:51 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:44578 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726060AbeI1HZv (ORCPT ); Fri, 28 Sep 2018 03:25:51 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w8S149Y3070654; Fri, 28 Sep 2018 01:04:44 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=ubhz/02qfz6wTpghiHgfgnDNnCNtmfm3FUfxOugGI/0=; b=xgu0rro3XA6r5spMzGipsNU+IuAkIXpQvkIY/Bm8p2Sb/Prp3ahgZD2bOTlqjK9up5jM MLcix3XnUCMhibLr09LesRAUm1ANQ7R5eC4gM9CK1bnUR/kjB7c/Krlr4sLNlT2Am98B WJz1wOzK5qVye+AMe8rJsU7R/YUhCoYkEO7CZckxP/Fd3PW4oCGSqZz8TG6S8RL91be1 Um8Soxwv+3g1O90OguEWazkUumbXXawM1eIBvjbTf297RXxlwWR9LmZvCuQ7czVTBv/7 ZrKXO1TqlK6RGnMjfJ+W3Ax/j2z8V/aA2G9cxk71MGAbvtpGl6/396YyQQXoqZcG3NA4 OA== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2120.oracle.com with ESMTP id 2mnvtv3xdr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 28 Sep 2018 01:04:44 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w8S14hTR016634 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 28 Sep 2018 01:04:43 GMT Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w8S14hT4020600; Fri, 28 Sep 2018 01:04:43 GMT Received: from localhost (/10.159.248.246) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 27 Sep 2018 18:04:43 -0700 Subject: [PATCH 2/6] libxfs: fix libxfs_trans_alloc callsite problems From: "Darrick J. Wong" To: sandeen@redhat.com, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org Date: Thu, 27 Sep 2018 18:04:39 -0700 Message-ID: <153809667939.32548.12481129952390241683.stgit@magnolia> In-Reply-To: <153809666117.32548.6836488790026631787.stgit@magnolia> References: <153809666117.32548.6836488790026631787.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9029 signatures=668707 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=747 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1809280010 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Darrick J. Wong Fix some incorrect libxfs_trans_alloc callers to check return values correctly. Signed-off-by: Darrick J. Wong --- 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 c13e3644..07d019d6 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 2e53c1e8..c6ef3a71 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);