From patchwork Fri Jan 12 22:04:12 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: 10161827 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 26EAC602B3 for ; Fri, 12 Jan 2018 22:14:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 16BD228ABB for ; Fri, 12 Jan 2018 22:14:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 07FDE28AE7; Fri, 12 Jan 2018 22:14:17 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, 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 67C4628ABB for ; Fri, 12 Jan 2018 22:14:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965203AbeALWOP (ORCPT ); Fri, 12 Jan 2018 17:14:15 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:35224 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965156AbeALWOP (ORCPT ); Fri, 12 Jan 2018 17:14:15 -0500 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w0CMCMuq063588 for ; Fri, 12 Jan 2018 22:14:14 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-2017-10-26; bh=zp8TZD3J37BpAhfyff7BJzbdFMWkXUKZzJn8X2DRO4Y=; b=iZIdsEzHIaYNKO3z9W2K+FT7JC56yVHawoWB19ZVZMXMdq8kgpdgprkjwGW10k2oFKVD /LT/igZDq+FBGU74dnCaiPNzLf5dEydCRT72cy6PreGd6JCLR+z7ap6qFOvM3/Cz3WI5 +rfonnEH7wqEIy05R7sfSuHGbgCGCK6kQLvAQUY028AG4sxuyu/eOcm577WM5pH5tmq0 dxNAFMSgLFp1/r14bCqpnRFvg6VKRAIOYSs7xeYgFelH4O9Cbpi+rGrRfg5CkwpozfgL DsepGH8lihCMrhdA/9RiNdmNy97vQ6R8z7BBSnIHoNAQOfvCUQqZ1Bu5BzF7vwW52inO Bg== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp2130.oracle.com with ESMTP id 2ff5e302tp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 12 Jan 2018 22:14:14 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w0CM4Dnr025543 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 12 Jan 2018 22:04:13 GMT Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w0CM4DSL017409 for ; Fri, 12 Jan 2018 22:04:13 GMT Received: from localhost (/10.159.242.57) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 12 Jan 2018 14:04:12 -0800 Subject: [PATCH 2/5] xfs: don't iunlock unlocked inodes From: "Darrick J. Wong" To: darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org Date: Fri, 12 Jan 2018 14:04:12 -0800 Message-ID: <151579465207.8694.2459805113822761321.stgit@magnolia> In-Reply-To: <151579463950.8694.320025813242574491.stgit@magnolia> References: <151579463950.8694.320025813242574491.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8772 signatures=668652 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=521 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1801120294 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 Don't iunlock an unlocked inode, which can happen if the parent pointer scrubber bails out with sc->ip unlocked while trying to grab the parent directory inode. Signed-off-by: Darrick J. Wong Reviewed-by: Brian Foster --- fs/xfs/scrub/scrub.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/xfs/scrub/scrub.c b/fs/xfs/scrub/scrub.c index 9c177ea..89178b9 100644 --- a/fs/xfs/scrub/scrub.c +++ b/fs/xfs/scrub/scrub.c @@ -193,7 +193,8 @@ xfs_scrub_teardown( sc->fs_frozen = false; } if (sc->ip) { - xfs_iunlock(sc->ip, sc->ilock_flags); + if (sc->ilock_flags) + xfs_iunlock(sc->ip, sc->ilock_flags); if (sc->ip != ip_in && !xfs_internal_inum(sc->mp, sc->ip->i_ino)) iput(VFS_I(sc->ip));