Received: by 10.223.185.116 with SMTP id b49csp4336945wrg; Mon, 26 Feb 2018 15:55:35 -0800 (PST) X-Google-Smtp-Source: AH8x227d2/JnfrdlClwJcuuUXlgubRkWzQ5AacM3lIOXbFIEF9iomlZyI1tx6lLk7LiVhJNAx5Sw X-Received: by 10.99.142.76 with SMTP id k73mr9717170pge.278.1519689335417; Mon, 26 Feb 2018 15:55:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519689335; cv=none; d=google.com; s=arc-20160816; b=0yUiUzwEO3S2I/wQTblMxVKREPOcfzOxHbi6PdIXjks7usJOZXi16vgYRXdosMaHuc wDZssg3hI+CIyVLV45ykBZunVRvz+sBQGSqbT9fsa4n2fKbSMAEIw/e3taybk2q8xwf0 QjC7ejR043CKQ0CnXeKLuAp/tc31O+j7fWbFgVKPP6ZFhKOm/zNpWch5rmjaKQzc70d0 taSzB9/S0msoQjfpnV5y9jPT+K6yG1AaOG7odF3IUIbe6V7p1kgMl0H9+wWqtlCRC8UE gHYIdgKft2pR8J3SQNoGKUczMx9U+R0rFZjUbuiS7SGFOSKFHf5UrEJPDWvI8FIluxR7 zqag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:references:in-reply-to:message-id :date:cc:to:from:arc-authentication-results; bh=PoQMTZX5rgZWu3uQluufbCM8INrkKE3YscK83HsPX68=; b=obtBFpIkpJvNYzAuKogXD3/TlnVLIE+Aj4gnDS32C/X/omdmNhL/E2sCXn+NsCyMwa saDAp53ej7adCXIjzdCW/63qpwXJCx9Yxx8/sQfU0j/LmT/2mIdou3v/lwQ8TYgcUNmB ZaCvH/XRU1uyqBSZU/xAeT7j2xhKJ4ibG1NIN8bDveSPWT/auNGfRsMbwbS9EydJkBgH 8P92XUMRveyk6MUpYzVNawXvtg91ecK79fdgilOHGuurqVzO5zUbBmfWONzAQP0PX4p7 B/igSS533Q5rjHQRQtb61KsQkutVzPffMIHbz5w7yNwT0LHZ1BHsGEY4iBYQs1K8OAeV 67gA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l9si6177688pgs.226.2018.02.26.15.55.21; Mon, 26 Feb 2018 15:55:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751713AbeBZXy1 (ORCPT + 99 others); Mon, 26 Feb 2018 18:54:27 -0500 Received: from out03.mta.xmission.com ([166.70.13.233]:37273 "EHLO out03.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751617AbeBZXyY (ORCPT ); Mon, 26 Feb 2018 18:54:24 -0500 Received: from in02.mta.xmission.com ([166.70.13.52]) by out03.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1eqSb9-00021B-P9; Mon, 26 Feb 2018 16:54:23 -0700 Received: from 174-19-85-160.omah.qwest.net ([174.19.85.160] helo=x220.int.ebiederm.org) by in02.mta.xmission.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1eqSb9-0005iL-7C; Mon, 26 Feb 2018 16:54:23 -0700 From: "Eric W. Biederman" To: Miklos Szeredi Cc: linux-kernel@vger.kernel.org, containers@lists.linux-foundation.org, linux-fsdevel@vger.kernel.org, Alban Crequy , Seth Forshee , Sargun Dhillon , Dongsu Park , "Serge E. Hallyn" , "Eric W. Biederman" Date: Mon, 26 Feb 2018 17:52:58 -0600 Message-Id: <20180226235302.12708-3-ebiederm@xmission.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <87po4rz4ui.fsf_-_@xmission.com> References: <87po4rz4ui.fsf_-_@xmission.com> X-XM-SPF: eid=1eqSb9-0005iL-7C;;;mid=<20180226235302.12708-3-ebiederm@xmission.com>;;;hst=in02.mta.xmission.com;;;ip=174.19.85.160;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX1+sVgvknIFd9LBW190FBDC1RLnbry6ijxc= X-SA-Exim-Connect-IP: 174.19.85.160 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on sa06.xmission.com X-Spam-Level: X-Spam-Status: No, score=0.6 required=8.0 tests=ALL_TRUSTED,BAYES_50, DCC_CHECK_NEGATIVE,TVD_RCVD_IP,T_TooManySym_01,XMSolicitRefs_0,XMSubLong autolearn=disabled version=3.4.1 X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.7 XMSubLong Long Subject * 0.0 TVD_RCVD_IP Message was received from an IP address * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.5000] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa06 1397; Body=1 Fuz1=1 Fuz2=1] * 0.1 XMSolicitRefs_0 Weightloss drug * 0.0 T_TooManySym_01 4+ unique symbols in subject X-Spam-DCC: XMission; sa06 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ;Miklos Szeredi X-Spam-Relay-Country: X-Spam-Timing: total 209 ms - load_scoreonly_sql: 0.04 (0.0%), signal_user_changed: 2.9 (1.4%), b_tie_ro: 2.0 (1.0%), parse: 0.99 (0.5%), extract_message_metadata: 13 (6.1%), get_uri_detail_list: 1.71 (0.8%), tests_pri_-1000: 6 (2.8%), tests_pri_-950: 1.19 (0.6%), tests_pri_-900: 1.02 (0.5%), tests_pri_-400: 18 (8.5%), check_bayes: 17 (8.0%), b_tokenize: 5 (2.6%), b_tok_get_all: 5 (2.6%), b_comp_prob: 1.94 (0.9%), b_tok_touch_all: 2.2 (1.1%), b_finish: 0.60 (0.3%), tests_pri_0: 159 (76.2%), check_dkim_signature: 0.61 (0.3%), check_dkim_adsp: 2.8 (1.3%), tests_pri_500: 4.6 (2.2%), rewrite_mail: 0.00 (0.0%) Subject: [PATCH v7 3/7] fs/posix_acl: Document that get_acl respects ACL_DONT_CACHE X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fuse is about to join overlayfs in relying on get_acl respecting ACL_DONT_CACHE so update the documentation in get_acl to reflect that fact. The comment and this change description should give people a clue that respecting ACL_DONT_CACHE in get_acl is important, and they should audit the filesystems before removing that support. Additionaly update the comment above the call to get_acl itself and remove the wrong information that an implementation of get_acl can prevent caching by calling forget_cached_acl. Replace that with the correct information that to prevent caching all that is necessary is to set inode->i_acl = inode->i_default_acl = ACL_DONT_CACHE when the inode is initialized. Signed-off-by: "Eric W. Biederman" --- fs/posix_acl.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/posix_acl.c b/fs/posix_acl.c index 2fd0fde16fe1..3c24fc263401 100644 --- a/fs/posix_acl.c +++ b/fs/posix_acl.c @@ -121,14 +121,17 @@ struct posix_acl *get_acl(struct inode *inode, int type) * could wait for that other task to complete its job, but it's easier * to just call ->get_acl to fetch the ACL ourself. (This is going to * be an unlikely race.) + * + * ACL_DONT_CACHE is treated as another task updating the acl and + * remains set. */ if (cmpxchg(p, ACL_NOT_CACHED, sentinel) != ACL_NOT_CACHED) /* fall through */ ; /* * Normally, the ACL returned by ->get_acl will be cached. - * A filesystem can prevent that by calling - * forget_cached_acl(inode, type) in ->get_acl. + * A filesystem can prevent that by calling setting + * inode->i_acl = inode->i_default_acl = ACL_DONT_CACHE. * * If the filesystem doesn't have a get_acl() function at all, we'll * just create the negative cache entry. -- 2.14.1