Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3362224iob; Mon, 16 May 2022 20:42:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzx9O/eXW2sBrcpporZW6mDFxW+rA68nKs329LphD2crPMjJ9v/YJBvcc6JSsGaalM1UL9y X-Received: by 2002:a17:907:8a20:b0:6f4:bb5d:9e19 with SMTP id sc32-20020a1709078a2000b006f4bb5d9e19mr17686538ejc.190.1652758928792; Mon, 16 May 2022 20:42:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652758928; cv=none; d=google.com; s=arc-20160816; b=gEEspvnTfLu8vNu50C/+KoiuQn+hVC3nPcwA3Nbbx1MAd6si+kfMU/ZKO5Tswdv0Jj 9zDy4zGE4FCtC6q//D7UUA77v2gBSrKBIITFuqe3ntiquixQno76pg/wb91QU8eS5Eqb CqtnV1Ihdi6/wnJSk/dgSJ6+neotRegHIFuRQfkbDtN4QDycTUfoijdo+a5cOf+xsuCM aKzpSHYpXUUJfrSHhZspND2W3ZFY21V4KOGZReY9+hNKaA6ioyBMta6x6IOtOfpBTGms rTM65zddVoiQbflLomc5zQUqx8l7Pe1pdekevG5ISggHs2W67OzBVih/t/2qOkDfcxry Hd6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:references:in-reply-to:subject :cc:to:from:mime-version:content-transfer-encoding:dkim-signature :dkim-signature; bh=scQnDjoLKU4pjfnT0aivMiZ7kDb62DWxcjpUPAEH8+g=; b=rLw7boniuOB0zz2KGK4zfdquAr7DHqM0EJGGwFs50otDyRov9tWWpvj+i5+rL2Ynsk 7ZgK+wXT1O4atvz12N53qqu5KBZyZmoHu0bpuWvTrS5JUPbrUf1yFHWhew+vEW3P1qtP euYw3koLSwuBUBzwhw/w4GvWl9KjOHL4yyrgCd/A9EUtaJUD5Q8nYhiszBNtnQG8wSRT QzCp2VR3At89uRlRzhvSFcojefN/3kbeCa1PEw4dbiRwwJZQW4AQtpzcDK1FaeuD3JA8 USWjXGoOIRKHrkBt/JndynXSxxdfz+bMu7TWvRwRKs7DCx7hgTzYnI6MjfATuylVcuxr OsGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=A+Q7PHFs; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b="LqHaB/VL"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qw32-20020a1709066a2000b006f458a898ddsi1352067ejc.42.2022.05.16.20.41.44; Mon, 16 May 2022 20:42:08 -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; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=A+Q7PHFs; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b="LqHaB/VL"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233285AbiEQAFT (ORCPT + 99 others); Mon, 16 May 2022 20:05:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239398AbiEQAFP (ORCPT ); Mon, 16 May 2022 20:05:15 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2FE2A40A0C for ; Mon, 16 May 2022 17:05:14 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 0926922035; Tue, 17 May 2022 00:05:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1652745913; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=scQnDjoLKU4pjfnT0aivMiZ7kDb62DWxcjpUPAEH8+g=; b=A+Q7PHFsLbb+a7lA8WjEIRRzn20I477cdQeWfIel3kVnYj2dlpx8YI4ZyQGoUieVTLlOy7 Scs5UHI1w2SjzCxqANt7RufEJ6MgOSQ9TRed5fgd752xHUWntUplF5FtuW9BSC7THzMYe/ EN5Ft2bGUKICmYzw7ocJPkKGu4mkam0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1652745913; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=scQnDjoLKU4pjfnT0aivMiZ7kDb62DWxcjpUPAEH8+g=; b=LqHaB/VLSdA/Zmo6qopwuCSYoKD0UhPS3DZMpREloHlGCGHh8IRoJ3kg+t+MFE5Nr1JY0d ZPrkFPwwnMU60wBQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id E393D139EC; Tue, 17 May 2022 00:05:11 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id WlKVJ7fmgmITZwAAMHmgww (envelope-from ); Tue, 17 May 2022 00:05:11 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 From: "NeilBrown" To: "Trond Myklebust" , "Anna Schumaker" Cc: linux-nfs@vger.kernel.org Subject: Re: [PATCH 0/2] NFS: limit use of ACCESS cache for negative responses In-reply-to: <165110909570.7595.8578730126480600782.stgit@noble.brown> References: <165110909570.7595.8578730126480600782.stgit@noble.brown> Date: Tue, 17 May 2022 10:05:08 +1000 Message-id: <165274590805.17247.12823419181284113076@noble.neil.brown.name> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 Hi, any thoughts on these patches? Thanks, NeilBrown On Thu, 28 Apr 2022, NeilBrown wrote: > Since Commit 57b691819ee2 ("NFS: Cache access checks more aggressively") > (Linux 4.8) NFS has cached the results of ACCESS indefinitely while the > inode isn't changing. > > This is often a good choice, but doesn't take into account the > possibility that changes out side of the inode can change effective > permissions. > > Depending on configuration, some servers can map the user provided in > the RPC credential to a group list at time of request. If the group > list for a user is changed, the result of ACCESS can change. > > This is particularly a problem when extra permissions are given on the > server. The client may make decisions based on outdated ACCESS results > and not even try operations which would in fact succeed. > > These two patches change the ACCESS cache so that when the cache grants > an access, that is trusted indefinitely just as it currently does. > However when the cache denies an access, that is only trusted if the > cached data is less than acmin seconds old. Otherwise a new ACCESS > request is made. > > This allows additions to group membership to become effective with > only a modest delay. > > The second patch contains even more explanatory detail. > > Thanks, > NeilBrown > > --- > > NeilBrown (2): > NFS: change nfs_access_get_cached() to nfs_access_check_cached() > NFS: limit use of ACCESS cache for negative responses > > > fs/nfs/dir.c | 80 +++++++++++++++++++++++++----------------- > fs/nfs/nfs4proc.c | 25 ++++++------- > include/linux/nfs_fs.h | 5 +-- > 3 files changed, 61 insertions(+), 49 deletions(-) > > -- > Signature > >