Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1188102rwb; Thu, 11 Aug 2022 18:06:05 -0700 (PDT) X-Google-Smtp-Source: AA6agR4qfWU6XM4oNGo7yqIAYnQFn3+rqG8HFN0Mv4TLHQPrWTbBWx7Jn9G+UAK4JXhvEQBZyJtb X-Received: by 2002:a17:907:7214:b0:731:465d:a77c with SMTP id dr20-20020a170907721400b00731465da77cmr1045179ejc.308.1660266365655; Thu, 11 Aug 2022 18:06:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660266365; cv=none; d=google.com; s=arc-20160816; b=YqH3KNEkXuBM4vX/NGdYhrYo1tlL+hqbDvUtACbpGTKYhR0U/+d1R6Sw4HvJ5IqnM/ X+M8PPbfgGvKvimbI57Jy1kQsBHNVD70/i0IN7wmzcnD+XfTtJ1YiKTLyJHVPziaRQ90 BXzXruNgG4DaXr7dhHk3fEQkTVUC2yM6LbNNjmMV2EmZ7wBjd/gnRjFaiGv2feofCohI bE6iXTYLO3h0fJENArMF1ydl6Wk9XFPC27MrTbts8moqbJ+N3JrrYsqEb2eS6LrNlnV2 n7pdvcVsIrHhjWxTO4ml95DXuZMvyjyaNnnaXxJWnhkjBPNiVIJzOX+FEpag94iW8WyL 7dpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=eJnqE/k4R0z3WCgm7WO+4wBRTWXW6Zxtv3BipeKDGbw=; b=Ieo9eELQ69C+7UJIuDq8O3iT9/s9RY+HRxVINruTCR5LZeqYdOQ2H0YiFYcRVftO66 R5aVt3Y5vWBHRJZDLblTV2erw7np8a2w+BBiAMvbDfIc8Ax5oLyGUAb6W+p9v2uYBo5S gqd7Tzi2Patt+SyHwzhyStS2nMUR+ZY6gQaYuIb2+3CzjJNCFQ3zQoPHOIPveOA+CkPW Gnqgrx7sa3EOHX8KzWTm3qIdWKUFlkXhnZFV1BYsR92OZJBdw1X0BhpnV7HsJm1cJHTZ opwSuU3+4r1O8ch/8Ve/y+7xzeTBdUfkxDNB5X/bet3jzFKUGoRjG6qP9faPix6uTi9e QUVQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bk19-20020a170906b0d300b00730951e6030si549732ejb.188.2022.08.11.18.05.26; Thu, 11 Aug 2022 18:06:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235116AbiHLBDD (ORCPT + 99 others); Thu, 11 Aug 2022 21:03:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231131AbiHLBDC (ORCPT ); Thu, 11 Aug 2022 21:03:02 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2981774DF3; Thu, 11 Aug 2022 18:03:01 -0700 (PDT) Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4M3lfy5LGkzXdNB; Fri, 12 Aug 2022 08:58:50 +0800 (CST) Received: from kwepemm600010.china.huawei.com (7.193.23.86) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 12 Aug 2022 09:02:58 +0800 Received: from huawei.com (10.175.127.227) by kwepemm600010.china.huawei.com (7.193.23.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 12 Aug 2022 09:02:57 +0800 From: Sun Ke To: , CC: , , Subject: [PATCH] NFS: Fix missing unlock in nfs_unlink() Date: Fri, 12 Aug 2022 09:14:40 +0800 Message-ID: <20220812011440.3602849-1-sunke32@huawei.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.127.227] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemm600010.china.huawei.com (7.193.23.86) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Add the missing unlock before goto. Fixes: 3c59366c207e ("NFS: don't unhash dentry during unlink/rename") Signed-off-by: Sun Ke --- fs/nfs/dir.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index dbab3caa15ed..1b879584d4fe 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -2484,8 +2484,10 @@ int nfs_unlink(struct inode *dir, struct dentry *dentry) */ error = -ETXTBSY; if (WARN_ON(dentry->d_flags & DCACHE_NFSFS_RENAMED) || - WARN_ON(dentry->d_fsdata == NFS_FSDATA_BLOCKED)) + WARN_ON(dentry->d_fsdata == NFS_FSDATA_BLOCKED)) { + spin_unlock(&dentry->d_lock); goto out; + } if (dentry->d_fsdata) /* old devname */ kfree(dentry->d_fsdata); -- 2.31.1