Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp79907ybx; Thu, 31 Oct 2019 16:16:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqzw0tsyaDbPz6wzjkJDt5ck/aLzPHP2EnXFTCk5cvTmjaqtXbmT6V6jgYaRIAfy8n0D8Kji X-Received: by 2002:aa7:d7c6:: with SMTP id e6mr8150211eds.79.1572563812393; Thu, 31 Oct 2019 16:16:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572563812; cv=none; d=google.com; s=arc-20160816; b=oIhfDKuPfqfc+rOCvLMVg7tfVvu8Vnr7Timu9aq7PC5cVDxmWR0Z5o2mzvq3j25lgQ OKAZqMfPnqoSUlFYvzfJKtRURkem/6tY4Kn+hQu6/zvu3SdJNxroPy+WgL5M3ZZ3wQmD 1daCe2VE6FAZUf/krtLtyhdtUKASdaJbHkWlvMhG/MX0DxAe91CIeWkRVEgVNON/FJZC Ml20K6LrPFImE4JOSP/qCcbqhXd/DMdiT4nzUZ6Uwo76TbgzQ6HgHStmPMsuiIFV3YI/ xr18xAh7FNf3GCJRYSG57EXjmbhxlOUWEb6DgQAQ78NniM0PCo81YNojEaj9RKAngfqh nT4A== 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=aOsiBYJF0l/VKWVtAB4TMzJF5AIwWrJk7gYaSmC5YBE=; b=QSJ0gQHFosl9gBp0z6jMfSKhm5SRp7OoBT6sqz915qZMRWjqDufZmnfUvyY/lsQccQ m/BPqkfCJCEBwQvsBM4UnpxZa7635K1eu5vo3Bdhx1+UVdJJN72qubXknCBsRV9QztDW sIztB8iYKWKKJFWK4zC4OW46S1YGoQ+6FtiekhU5XUOMSLYGJtZp7ZWsZm2quo+UWCO/ bkZVz90/qu36WTjpJ3ncJTexH2DiRLuQ+8ZVjp5+Q/Aqvs03xKEGvTSY6qpinS6Q/esr hYshRNNuajgo4JQJNlUOWO506N4GOAMAv+wMyNaERRz07ywU6M8G6dThoCBThQIvEjFm 7ypw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pUw6daur; 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.16.28; Thu, 31 Oct 2019 16:16:52 -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=pUw6daur; 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 S1727700AbfJaWnR (ORCPT + 99 others); Thu, 31 Oct 2019 18:43:17 -0400 Received: from mail-yb1-f194.google.com ([209.85.219.194]:45993 "EHLO mail-yb1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727611AbfJaWnQ (ORCPT ); Thu, 31 Oct 2019 18:43:16 -0400 Received: by mail-yb1-f194.google.com with SMTP id q143so3089016ybg.12 for ; Thu, 31 Oct 2019 15:43:16 -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=aOsiBYJF0l/VKWVtAB4TMzJF5AIwWrJk7gYaSmC5YBE=; b=pUw6daurKLdYcI3ttsS2R1+v8huzbX/wuM1gpHWnXeYa4MFsLHjACnw5FVFCAQ3UxG qzAXTRJkt/FbzPdl3UQIOz3ln1cUe9LE159DSYUbi6xXeqLDshvvz1goYkKX8fMQE/sY 1EQY+M4eSC/YGVkjmh140QmIdbT6onJ0d0WG6SGAn5WgZNtifLfS6L+I0b85a6vlC57l l/pCJpBJsoyhWxFZVX3GOE603eF5e7aKPsBL47w+CxV1YCr+pLwrk5HP2htR2BFIezHB Lz3ddnk8jWMINU8noP1heXQrpCtEE/6e0t+JhgnLQV7cllKIVVv5Lqk5F8T36eY64JLT WP2g== 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=aOsiBYJF0l/VKWVtAB4TMzJF5AIwWrJk7gYaSmC5YBE=; b=W3c+TccFP34QxDCCqI/iFENvusWmSSLuPOR9B0DdEu19mGOGIxPa20wLs8btBk6mM6 BwVfLujpH6hFj4BGZrf/kaD1tqThweCWheMA9iaUd8c7CzCH96AZ7R7tKTHfOroU+DG5 BH+8IrLLF5pPYPl3tO+iYgAcelEJBZ0kOuc6Bi7m3Kr4pTxTvJuRTxPxk5RgxW/ukcc3 iUkeiTHGg0B3SjjuBOys341z7XGZOWuK1AKAdMF5xg7Kyd4EVumwSqQUbahvphGq7rli n2NJmw/Jd7MaeyUqodOWggDMINFd4QLvhv5QmLQbWhG7ArY6ybBdM2pvNvlj3RggZ6eu Bc8w== X-Gm-Message-State: APjAAAXc0rvC3mv6RNug02MqUtS5vUtkwj+E7h1K+eBf1VidTtn6mdSb B6mGsfvHsstNVdLxhKqpe9vTKLU= X-Received: by 2002:a25:c5c1:: with SMTP id v184mr6651909ybe.457.1572561795433; Thu, 31 Oct 2019 15:43:15 -0700 (PDT) Received: from localhost.localdomain ([50.105.87.1]) by smtp.gmail.com with ESMTPSA id d192sm1720287ywb.3.2019.10.31.15.43.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Oct 2019 15:43:14 -0700 (PDT) From: Trond Myklebust X-Google-Original-From: Trond Myklebust To: linux-nfs@vger.kernel.org Subject: [PATCH v2 09/20] NFSv4: Hold the delegation spinlock when updating the seqid Date: Thu, 31 Oct 2019 18:40:40 -0400 Message-Id: <20191031224051.8923-10-trond.myklebust@hammerspace.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191031224051.8923-9-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> <20191031224051.8923-9-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 Signed-off-by: Trond Myklebust --- fs/nfs/delegation.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c index e80419a63fb5..7ebeb57cb597 100644 --- a/fs/nfs/delegation.c +++ b/fs/nfs/delegation.c @@ -387,8 +387,10 @@ int nfs_inode_set_delegation(struct inode *inode, const struct cred *cred, /* Is this an update of the existing delegation? */ if (nfs4_stateid_match_other(&old_delegation->stateid, &delegation->stateid)) { + spin_lock(&old_delegation->lock); nfs_update_inplace_delegation(old_delegation, delegation); + spin_unlock(&old_delegation->lock); goto out; } /* -- 2.23.0