From patchwork Mon Apr 22 15:45:40 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: 10911225 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 CE8D414DB for ; Mon, 22 Apr 2019 15:47:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BF32C286F2 for ; Mon, 22 Apr 2019 15:47:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B345E286FF; Mon, 22 Apr 2019 15:47:43 +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 60988286F2 for ; Mon, 22 Apr 2019 15:47:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727463AbfDVPrn (ORCPT ); Mon, 22 Apr 2019 11:47:43 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:40972 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726132AbfDVPrm (ORCPT ); Mon, 22 Apr 2019 11:47:42 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x3MFiFJ3049326; Mon, 22 Apr 2019 15:47:40 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=Xd++3Prbs62/SAh/aX+euktD+mZn9+MO6d+yEiR4lG0=; b=s2egViZ4Hg0wdPBdw/3vFHxXnAimxyoW8YG03Wvj7jDdJ+qPJAZZF+lnuUxV/p/UbGnk eIUl1N1H0oN3ms6sd0GW6DNrcQ9O7Yd+cVEwdccCbS1AZ+j2zxJfB/zMsEVDhzvk83Rh 3dKq5bue5WfkftY4y/lKy5NcrjnMPaZsKnMfZi9/gnlzm6LLuNvgKl0JObRbgJ7tJC3R CEzAbDh96tN9I6Y8KnjciAVhZEdxErr6FuVsSgLMfpcebXneI/JaESN66o0KH3hIEfLS vMVmo94OvFwjbMHX3MqCOyw4MzGbOck/+UGR6kDAvm/14M+Ej0LnBKKWiTl2hTOMXQtk Zw== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by aserp2130.oracle.com with ESMTP id 2ryrxcq65h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 22 Apr 2019 15:47:40 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x3MFiL0H185553; Mon, 22 Apr 2019 15:45:40 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3030.oracle.com with ESMTP id 2s0f0v0krx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 22 Apr 2019 15:45:40 +0000 Received: from abhmp0020.oracle.com (abhmp0020.oracle.com [141.146.116.26]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x3MFjdW4017477; Mon, 22 Apr 2019 15:45:39 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 22 Apr 2019 08:45:39 -0700 Subject: [PATCH 08/10] libxfs: don't touch buffer log item pointer when flushing inode log item From: "Darrick J. Wong" To: sandeen@sandeen.net, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org Date: Mon, 22 Apr 2019 08:45:40 -0700 Message-ID: <155594794076.115924.11541140246431884889.stgit@magnolia> In-Reply-To: <155594788997.115924.16224143537288136652.stgit@magnolia> References: <155594788997.115924.16224143537288136652.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9235 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1904220118 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9235 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 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-1904220119 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're flushing an inode log item, it is not necessary to mess with the inode cluster buffer's log item because the iflush code paths pass the inode log item directly. The unconditional reset causes us to leak buffer log items. Signed-off-by: Darrick J. Wong Reviewed-by: Eric Sandeen Reviewed-by: Bill O'Donnell --- libxfs/trans.c | 2 -- libxfs/util.c | 1 - 2 files changed, 3 deletions(-) diff --git a/libxfs/trans.c b/libxfs/trans.c index 629501f8..d562cdc0 100644 --- a/libxfs/trans.c +++ b/libxfs/trans.c @@ -826,10 +826,8 @@ inode_item_done( * of whether the flush succeed or not. If we fail the flush, make sure * we still release the buffer reference we currently hold. */ - bp->b_log_item = iip; error = libxfs_iflush_int(ip, bp); ip->i_transp = NULL; /* disassociate from transaction */ - bp->b_log_item = NULL; /* remove log item */ bp->b_transp = NULL; /* remove xact ptr */ if (error) { diff --git a/libxfs/util.c b/libxfs/util.c index ea75fa20..9fe9a367 100644 --- a/libxfs/util.c +++ b/libxfs/util.c @@ -394,7 +394,6 @@ libxfs_iflush_int(xfs_inode_t *ip, xfs_buf_t *bp) xfs_dinode_t *dip; xfs_mount_t *mp; - ASSERT(bp-b_log_item != NULL); ASSERT(ip->i_d.di_format != XFS_DINODE_FMT_BTREE || ip->i_d.di_nextents > ip->i_df.if_ext_max); ASSERT(ip->i_d.di_version > 1);