From patchwork Mon Oct 1 17:04:30 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: 10622435 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 89652112B for ; Mon, 1 Oct 2018 17:04:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6E1A4212D8 for ; Mon, 1 Oct 2018 17:04:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 60FF521C9A; Mon, 1 Oct 2018 17:04:36 +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 1194B212D8 for ; Mon, 1 Oct 2018 17:04:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725740AbeJAXnS (ORCPT ); Mon, 1 Oct 2018 19:43:18 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:47044 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725906AbeJAXnS (ORCPT ); Mon, 1 Oct 2018 19:43:18 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w91H41cQ011936; Mon, 1 Oct 2018 17:04:32 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=QFhPA0vXZac3g0As5bPPLe2AqY8dkyXQtcmXbq/N/NMse5HKos5hCraC3xkw++VVwshJ YA+vHTkJ63EUc5t7nb/S8cCjvcnkcEKAXE59JQQhHFTH3TZO4Jiixqc+uXU0YFlZRf/T e/5MZtTFY/FbGuJRgqNWdrvNSS2cBQfz3pfyTeo8DFnqLb/NKRrwet2wBGFLYUtYXo/s iCkte/xq2jYXxXKOwtLGD2V9PfE0TdyAsjuDg4WnihUYcP0gXEW/L6btjblljUsH6fnl OmaBG1LaJlO1Wn8zr8VqmHOlneAz8d0Iak2iq6rU9Wg4uGcTVT/ubBFL6XjKkOTpZkTo hw== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp2120.oracle.com with ESMTP id 2mt1bprptk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 01 Oct 2018 17:04:31 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w91H4VRB006914 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 1 Oct 2018 17:04:31 GMT Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w91H4VrS025617; Mon, 1 Oct 2018 17:04:31 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 01 Oct 2018 10:04:31 -0700 Subject: [PATCH 2/8] 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: Mon, 01 Oct 2018 10:04:30 -0700 Message-ID: <153841347016.27952.3018422758811687409.stgit@magnolia> In-Reply-To: <153841345236.27952.5050172703525712660.stgit@magnolia> References: <153841345236.27952.5050172703525712660.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9033 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=737 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1810010163 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);