From patchwork Fri Mar 1 23:29:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 10836253 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 6C3231390 for ; Fri, 1 Mar 2019 23:29:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 534852E050 for ; Fri, 1 Mar 2019 23:29:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 479A92E062; Fri, 1 Mar 2019 23:29:15 +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 E6D272E050 for ; Fri, 1 Mar 2019 23:29:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725982AbfCAX3O (ORCPT ); Fri, 1 Mar 2019 18:29:14 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:47794 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725966AbfCAX3O (ORCPT ); Fri, 1 Mar 2019 18:29:14 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x21NSvqu126397 for ; Fri, 1 Mar 2019 23:29:13 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=qZgyeIk8o3X4Go7JfwznkcrjCkPJSqpp2rs1pqBZDxk=; b=wPoIjfbQbahpDUSzoqnmRT+Na879IjFMEmz+jCPD/QxDPY/yQGB9+aP1bHWgHMpiqpIn 8oxCfyIxKQDLZ1U4h5vfIzBTvfjXbspN/wnHZWL2nKTA+XR9AW056e8l4eJG67OsT+f5 jEhubTy6omQ/lcRTJ3URtr4UoVYYzcrKy5se5/HDkI4I9G7eo8OJrHfzQ9P/H3O009IO SenrYagyz5z4Hf1s78nxZDxpKZZC7DT5BRsx3MNoR+8h8N+lNkRI7bAi82Fa4A8DxOSf Ra3FOD9+62C3XyOKCppVf/BWQkFNAZQcNejGqo/YekKUnQToWf1lHgWwNdc/SvulEEO4 rQ== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2130.oracle.com with ESMTP id 2qtwkut94e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 01 Mar 2019 23:29:13 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id x21NTBKw023624 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 1 Mar 2019 23:29:12 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x21NTBd2008190 for ; Fri, 1 Mar 2019 23:29:11 GMT Received: from localhost (/10.159.229.175) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 01 Mar 2019 15:29:11 -0800 Subject: [PATCH 22/23] libxfs: free inode item when committing transaction From: "Darrick J. Wong" To: darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org Date: Fri, 01 Mar 2019 15:29:10 -0800 Message-ID: <155148295044.16677.1265114091017067700.stgit@magnolia> In-Reply-To: <155148280859.16677.6057998944865066232.stgit@magnolia> References: <155148280859.16677.6057998944865066232.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9182 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=3 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1903010162 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 When we commit a transaction with a dirtied inode, free the inode item once we're done, and check that we never ijoin a transaction twice. Signed-off-by: Darrick J. Wong --- libxfs/trans.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/libxfs/trans.c b/libxfs/trans.c index b0a04ecd..0f9f12b6 100644 --- a/libxfs/trans.c +++ b/libxfs/trans.c @@ -380,6 +380,7 @@ libxfs_trans_ijoin( xfs_inode_log_item_t *iip; ASSERT(ip->i_transp == NULL); + ASSERT(ip->i_temp == NULL); if (ip->i_itemp == NULL) xfs_inode_item_init(ip, ip->i_mount); iip = ip->i_itemp; @@ -842,11 +843,8 @@ inode_item_done( mp = iip->ili_item.li_mountp; ASSERT(ip != NULL); - if (!(iip->ili_fields & XFS_ILOG_ALL)) { - ip->i_transp = NULL; /* disassociate from transaction */ - iip->ili_flags = 0; /* reset all flags */ - return; - } + if (!(iip->ili_fields & XFS_ILOG_ALL)) + goto free; /* * Get the buffer containing the on-disk inode. @@ -867,7 +865,6 @@ inode_item_done( return; } - ip->i_transp = NULL; /* disassociate from transaction */ bp->b_log_item = NULL; /* remove log item */ bp->b_transp = NULL; /* remove xact ptr */ libxfs_writebuf(bp, 0); @@ -875,6 +872,10 @@ inode_item_done( fprintf(stderr, "flushing dirty inode %llu, buffer %p\n", ip->i_ino, bp); #endif +free: + ip->i_transp = NULL; /* disassociate from transaction */ + ip->i_itemp = NULL; + kmem_zone_free(xfs_ili_zone, iip); } static void