Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp702458ybz; Wed, 15 Apr 2020 17:04:17 -0700 (PDT) X-Google-Smtp-Source: APiQypL5VDR5YvGmkeqPAGz66XuWXB9wxFOyU35ksTVVW0PGXrRVQBVxVjtfLzeKtHTKb99dQZKz X-Received: by 2002:aa7:d745:: with SMTP id a5mr21632668eds.43.1586995457833; Wed, 15 Apr 2020 17:04:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586995457; cv=none; d=google.com; s=arc-20160816; b=SS8xWI+A+9Io6K0tjzxFDlUyQposw/lalOEkCtEbxe2KmaUSEp3O1SWpY5VNFAFOV9 IXBJLoPPTBSuAdJa1ke8SWZbFG1FQHLMvLU1Pqh1/zrR9ZVjPqrAcxNV9tWZdHErjuSL RzIOp5AaqwJuBTAlpb5hB7PAnOzQ5l+2ErJDFLzyDAZ5q+7CvFfn+jSURNTMOri8qju7 W0rjebBoPDxQrd+glgK7/Bi83rCdTvBNfhfhLZJJRfOqxF5Z6TigTjug2Q7IZHFJMyhq lVqxJomUIIkKoiva7Qc/s/xy5ML5ovHwPoEfVkF0U35KpAF4hN6v4Z4UDRW/iyvXgfad gVSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:mime-version:user-agent:date:message-id:subject :from:cc:to; bh=FpKeDxAVH7mmLgBiOv5DiLJoQdI4n/cPXlxkLVmr+wg=; b=YFTqpV+c4x22KvDuZeOHwA4PmgShQkPuTaQ7n9rRaJDHFC1HgC3zW5md1wgm23cWPC 61g6RhdB+Prpo4sNgK/NmQv/lFtFo/3Zm/po2XaJ5US0XfppIPBkZYaUSTgq049KEQQD EcU3L9c4nyBJSGf1EjjbMII/M6mI6Vn6u/d3b9M/HZLKRsN0aexWj8W0J9omo7ZGiya0 rNvHzzhEtkvakfoFnU16I4HnWqAmq19cRrLk1SdFWQHQ7wLA/VBII/wp+3m04v8SR1C8 YwZMU7+MJd2H5OgT6rlTudlZVrqmDS2GxpbG7JLhUzYxjCFzBObukWBFJAIpwdxUpUqM 36wg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bc1si11208536edb.526.2020.04.15.17.03.55; Wed, 15 Apr 2020 17:04:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2632736AbgDONU5 (ORCPT + 99 others); Wed, 15 Apr 2020 09:20:57 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:2330 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2506326AbgDONUt (ORCPT ); Wed, 15 Apr 2020 09:20:49 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 21A454C74A24939194E6; Wed, 15 Apr 2020 21:20:45 +0800 (CST) Received: from [127.0.0.1] (10.173.220.183) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.487.0; Wed, 15 Apr 2020 21:20:35 +0800 To: , , CC: , , , Yanxiaodan , Mingfangsen , "wubo (T)" From: Zhiqiang Liu Subject: [PATCH] dcache: unlock inode->i_lock before goto restart tag in, d_prune_aliases Message-ID: Date: Wed, 15 Apr 2020 21:20:33 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.173.220.183] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Zhiqiang Liu coccicheck reports: fs/dcache.c:1027:1-10: second lock on line 1027 In d_prune_aliases, before goto restart we should unlock inode->i_lock. Fixes: 29355c3904e ("d_prune_alias(): just lock the parent and call __dentry_kill()") Signed-off-by: Zhiqiang Liu Signed-off-by: Feilong Lin --- fs/dcache.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/dcache.c b/fs/dcache.c index b280e07e162b..1532ebe9d9ca 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -1030,6 +1030,7 @@ void d_prune_aliases(struct inode *inode) if (!dentry->d_lockref.count) { struct dentry *parent = lock_parent(dentry); if (likely(!dentry->d_lockref.count)) { + spin_unlock(&inode->i_lock); __dentry_kill(dentry); dput(parent); goto restart; -- 2.19.1