Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp79252ybx; Thu, 31 Oct 2019 16:16:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqxFu8Gq5hDsAK/vZfQa2tHIALGpHyOJ7Mm+J4063Ok5aFFWL7tdtbc/YEQTFhhfEVrygeOr X-Received: by 2002:aa7:d305:: with SMTP id p5mr9457377edq.80.1572563762814; Thu, 31 Oct 2019 16:16:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572563762; cv=none; d=google.com; s=arc-20160816; b=ypAa8lflLNkZBEdP9yvIE+FM3R/qEIKqh/Q4VqYIiTjvVtReSiTiITg+hmgohSXGKS uAAK7Rml19KM/NEAQUMhC7paWuPRAStrSsMJPJPMqVBy6nwwAYb7fz3nE1aFXkhLgh+n sKddKGsvJQe8KxdVXS3oMmpJz8Z+qALu/E4RglmvvJ2yi6O+IapaD4DEuiJpoNzm8r0M PrP9XWjqbCGMu3fnBhQdjbfhxg/WlshDkxZzYKkS5fxp6fn5JZ/gUMPAUmqNzZ2sc//v L1I5sGjAupzZOU2WKLDZWDrD/k7SdpYTX0X2w1b4d/zWlln1/CaC1ROrw0hzHAaCUXFO D4tg== 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:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=L7PIPNwTpokXVUro30nAvcF3QqeHNnOPKiyU17Tyl8w=; b=CNJfpoRmZzYI4d8CXd9OQo9VqPfcQNCDxDw30STMO8/iKqKcnsMAUvPgxXuqbsw1II mvYxKR5r+r9pzZ/FDZcdXKGA8l7nIBCPm26kboONIIDCIr3UNWqoEK1D4y5JOTfqOkuf 6xiMUYGB10RamAVkkiDqshu3dtW8XEr43hRbA/hgord7eAl44xflVf+8g/Bq0OkrbfoG sJ2McYvApjFa2QYi5911yssMmlqga6wPrDhlkURKxECe6fsQorOMXYvOSFnvi8lRUHyB 5LrR/7AmNZnZLfd7AO71RLydgF+ro/OZShITLVEqlCS2pzZZy8pFKMP3EQF6eEpzIkJo kWYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XPiKPVsc; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z44si5875587edz.211.2019.10.31.16.15.38; Thu, 31 Oct 2019 16:16:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XPiKPVsc; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727648AbfJaWnP (ORCPT + 99 others); Thu, 31 Oct 2019 18:43:15 -0400 Received: from mail-yw1-f65.google.com ([209.85.161.65]:46157 "EHLO mail-yw1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727611AbfJaWnP (ORCPT ); Thu, 31 Oct 2019 18:43:15 -0400 Received: by mail-yw1-f65.google.com with SMTP id i2so2772689ywg.13 for ; Thu, 31 Oct 2019 15:43:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=L7PIPNwTpokXVUro30nAvcF3QqeHNnOPKiyU17Tyl8w=; b=XPiKPVscbO9G8foqjNsdvSjaAP1BgR/8GAllFraNT2fXXaCkO12fl164X2/vYr5M6Q rw0R3Xqp7PZVYekqH5IU+WuuqdzbKEe0jKXruioa8vuoouOar+BlZIShiro9JgGec6o4 Rv9IGIdM4QjHL06VUyoqQ0P2TxaCNrVh0ajRR2AdCerj81ojVdqiOZDfx3h0IpCmGy5M RJpA/f6j6StFlEEFG7BAFiEqwr3me/C1xSBJKJeEd9IEI8BAUjiJ1VjB7dDnRZSBC20Y MheA/vdvK37QYEdkrz4GtZrOPdwi1h2R89MvQRI/wYpWjPwjJ5tQRG/tsgF/BWADYLKN RjRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=L7PIPNwTpokXVUro30nAvcF3QqeHNnOPKiyU17Tyl8w=; b=g3m5Ru7UaerPkeJj2wQt19ibDB6XQRhew2ViAaBBn1GkOU4/g2RFQq5A0w4DyUu0f7 C0myNfZY/eqOIqSM7sNvS+Hc9f0JpVo1jhNl8ifdnA3zlcyURj3s9eKAlwIX7QKko12W YfFyOyBNQ7K/a1UPV2DDyFwC+36QMbyP6voc6ioXhbexVa1U6D54DnLYzJbi+FVP3jFV /5zPKxUz5cQukeOTBJe0+Zhg0rEgBBXs+sAC7G0DA1wgkevfMWhYMbzzqYBtnwLimyJU CXub0NUUtf2wYHlmiy6PV+QIwj2V2bkuWxrwq9vORpE94+hWAfPriRATf76Zerw1eF6U 83VA== X-Gm-Message-State: APjAAAWHG0QjBms3fVTgD61B9efriNspjMNSF5A+CoEh7kqB6Up05Cnd yzZiahGrSYm0BuxEIAESBtEqZeQ= X-Received: by 2002:a81:2d57:: with SMTP id t84mr6237469ywt.426.1572561794213; Thu, 31 Oct 2019 15:43:14 -0700 (PDT) Received: from localhost.localdomain ([50.105.87.1]) by smtp.gmail.com with ESMTPSA id d192sm1720287ywb.3.2019.10.31.15.43.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Oct 2019 15:43:13 -0700 (PDT) From: Trond Myklebust X-Google-Original-From: Trond Myklebust To: linux-nfs@vger.kernel.org Subject: [PATCH v2 08/20] NFSv4: Don't remove the delegation from the super_list more than once Date: Thu, 31 Oct 2019 18:40:39 -0400 Message-Id: <20191031224051.8923-9-trond.myklebust@hammerspace.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191031224051.8923-8-trond.myklebust@hammerspace.com> References: <20191031224051.8923-1-trond.myklebust@hammerspace.com> <20191031224051.8923-2-trond.myklebust@hammerspace.com> <20191031224051.8923-3-trond.myklebust@hammerspace.com> <20191031224051.8923-4-trond.myklebust@hammerspace.com> <20191031224051.8923-5-trond.myklebust@hammerspace.com> <20191031224051.8923-6-trond.myklebust@hammerspace.com> <20191031224051.8923-7-trond.myklebust@hammerspace.com> <20191031224051.8923-8-trond.myklebust@hammerspace.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Add a check to ensure that we haven't already removed the delegation from the inode after we take all the relevant locks. Signed-off-by: Trond Myklebust --- fs/nfs/delegation.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c index 0c9339d559f5..e80419a63fb5 100644 --- a/fs/nfs/delegation.c +++ b/fs/nfs/delegation.c @@ -298,6 +298,10 @@ nfs_detach_delegation_locked(struct nfs_inode *nfsi, return NULL; spin_lock(&delegation->lock); + if (!delegation->inode) { + spin_unlock(&delegation->lock); + return NULL; + } set_bit(NFS_DELEGATION_RETURNING, &delegation->flags); list_del_rcu(&delegation->super_list); delegation->inode = NULL; -- 2.23.0