Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2935058ybl; Sun, 26 Jan 2020 14:34:00 -0800 (PST) X-Google-Smtp-Source: APXvYqwcw5jdgWNakN2wus5fOsRL0Mc3zuB4qgjb5xwPBXfHAQXOqC+XnwMUQ8RdzzhJVo+kq1ZJ X-Received: by 2002:aca:1c0d:: with SMTP id c13mr5584538oic.44.1580078040838; Sun, 26 Jan 2020 14:34:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580078040; cv=none; d=google.com; s=arc-20160816; b=uoOzJ/N6VxZs9B7OnPREr46mI/vJgAb7zzjwHmS2kmVNBxdy6ISjbzV04ibrY2p8hO DYcH7w+K+hkVBcJEsPV5mXI9mmWMl0OS7cy0AJlrtN5ivDZdP32ovcs6pheXqzefXQBH X8li1LzAySnOnFkO+hqty0kXFisQ/UJX0NnVj0Z4y1mTue/7MdX2rOi9wWponBggMY3E Bpx+UixlY6uPgz7waR0WJF/C3lATPw6clZJYq+6uKaTD9Fv3y9DI+j9Y0EaBhiWwlFS8 tV8nBuX+2QSBlIfOsagWu69qZTiU7TTbJ0kmXdwYWYnxHfKQTiY+Z5IuDAz6u/vdmVe/ msog== 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:cc:to:from :dkim-signature; bh=s9RDIMLtbcWBx2VkDk/Gm5VggXtsfniEimljSxvmt64=; b=lw8mtortOh1MAHxO+fPAMp2oQQFMaMdFV5clPN0uhwZzmD7Z7V7GwsQlMEjmcDvmnh uXCEd68NMMUFO6ikHQBAedRCj0UD4ZhAMIxbQvGRvOZwPHBSMJF3KNqxFDR7SHTxw31K 1xE6WiAtg94mNJ9lkbwk2Gzspq1ooo1Z9k0luBm5zaWjZUpBh5c3AMeZfcc0BnkqticY BEBdE9ewfulzTGIRvFJksiPShE7CAhDTpijiu4fLiV0z9VsOn4aliiXBn1GKVOBaVvg2 IUGW73Um8kBjTGRgbJgfAYWf7d1XzFLiEU0aX/mtXn//nNaWObX7r0YK6F9idXCXSAj9 8j3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=raPfpYXh; 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 k2si2602188oij.97.2020.01.26.14.33.50; Sun, 26 Jan 2020 14:34:00 -0800 (PST) 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=raPfpYXh; 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 S1727166AbgAZWd3 (ORCPT + 99 others); Sun, 26 Jan 2020 17:33:29 -0500 Received: from mail-yw1-f67.google.com ([209.85.161.67]:43301 "EHLO mail-yw1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726670AbgAZWd2 (ORCPT ); Sun, 26 Jan 2020 17:33:28 -0500 Received: by mail-yw1-f67.google.com with SMTP id v126so3901809ywc.10 for ; Sun, 26 Jan 2020 14:33:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=s9RDIMLtbcWBx2VkDk/Gm5VggXtsfniEimljSxvmt64=; b=raPfpYXhUyVn721GT0PtXDe0UKqvSpmUcd/mqbT+zs7JZLs9Swyi9IENCXQlcVmfwa pX9WgIaTR4hFQUgfD/mLN/i22IyM1Pay8puKrECiUbjsYGUPUzYqVeRS6hLIrSfb0GDY ovv7d1EkiPvnGaJTMCLyQ5Q97Q2hesjl/2Uxr7MHG/ewI47YoJTxWkUJvDUMe7VT3N7q SSm9tWJ24uoxWKzxW1YukU8wiM3XFM9AJYcjye0O2it5FWplJ1BnncPUDtIIyxQffpS+ Z5hGc9qB2khbSWlkJJesWffiA9cJ/Jgd8zz1g+JYwOEEInaOkCGTR37D7pB3Pp//bYOB C7ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=s9RDIMLtbcWBx2VkDk/Gm5VggXtsfniEimljSxvmt64=; b=BuygqcK1Fo7G6P8TCIdg6KMwvJHrrRiEgZu9EEhX8fx41bG1LjzleoXpvMWnCgrOwJ fb6eLKUmoMQJfqFX9BNryyKLki/pqtE7aGd3omedzvSkcf5dESJNiWzHASN7zTGP9BVz jsOAN4jsgB1Cb2f2/EzRfHPBi7pCNwyIA6X0ZCiy5f6sQhz+j4LTt9yJntQsvPqgyRCm 6oWkYCqEtjVqUkt+1yCeFtjcsa7ZnJ0TP1OITj4QUT0T6PdUWhaFLL4TLv+Pe0fT6Zt6 0Jq/WlgxDTYAZJjPixc2+WIxFHZX6N2Ma/8+LvZVWXxudbGUKJg3U/tiSgKokuG3tA/B 2oJQ== X-Gm-Message-State: APjAAAXGmKCUesf2aJM33nseEIsFYPPE5CNANyWtv8TlOzhbx6XU4ZzA y/vd15oQd+HAqpsHOEFOoQ== X-Received: by 2002:a81:a00a:: with SMTP id x10mr9984648ywg.475.1580078007765; Sun, 26 Jan 2020 14:33:27 -0800 (PST) Received: from localhost.localdomain (c-68-40-189-247.hsd1.mi.comcast.net. [68.40.189.247]) by smtp.gmail.com with ESMTPSA id d66sm4233951ywc.16.2020.01.26.14.33.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Jan 2020 14:33:27 -0800 (PST) From: Trond Myklebust X-Google-Original-From: Trond Myklebust To: Anna Schumaker Cc: linux-nfs@vger.kernel.org Subject: [PATCH 3/3] NFS: nfs_find_open_context() should use cred_fscmp() Date: Sun, 26 Jan 2020 17:31:15 -0500 Message-Id: <20200126223115.40476-3-trond.myklebust@hammerspace.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200126223115.40476-2-trond.myklebust@hammerspace.com> References: <20200126223115.40476-1-trond.myklebust@hammerspace.com> <20200126223115.40476-2-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 We want to find open contexts that match our filesystem access properties. They don't have to exactly match the cred. Signed-off-by: Trond Myklebust --- fs/nfs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 71dfc9d2fc3d..1309e6f47f3d 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c @@ -1061,7 +1061,7 @@ struct nfs_open_context *nfs_find_open_context(struct inode *inode, const struct rcu_read_lock(); list_for_each_entry_rcu(pos, &nfsi->open_files, list) { - if (cred != NULL && pos->cred != cred) + if (cred != NULL && cred_fscmp(pos->cred, cred) != 0) continue; if ((pos->mode & (FMODE_READ|FMODE_WRITE)) != mode) continue; -- 2.24.1