From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [62.89.141.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A999813AD32 for ; Thu, 31 Oct 2024 22:28:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.89.141.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730413726; cv=none; b=lAJxBACcRWTVuRpuWkBF1yc53YQkjDgjVCEHGIOecGsMu7ZV8SD7g3L/TqJMTEUCLPvD2ghPn1MHA1qJRT81d/j1Yzv9ZAw7npGc5ggkPfWqqFksnqbi36QjhvMzHqEpoeFBr3ns5WJg6+kXoh5xIDdC+A2PcwPKP/EFDJAgq00= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730413726; c=relaxed/simple; bh=LvKoIHCsCvgYesGGOiaSa6NeCXPNG3fGPMi90MNprX4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=lB391+IkelDc4x6NZvYCVXP8z6HbvJJaEybieVl0ER3gCDqTJS77HQndr74dNamTw7eqX77+noMs1yFt/oJj8gy3oEZAECcHxhplbPo0AjmUkQTJdCkyqm3/fRdhxqu2PlhCmovsfGWUCMK/owbvTgZgIdY/tbzBtqVxFfrpZ20= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zeniv.linux.org.uk; spf=none smtp.mailfrom=ftp.linux.org.uk; dkim=pass (2048-bit key) header.d=linux.org.uk header.i=@linux.org.uk header.b=bTJ9KSYb; arc=none smtp.client-ip=62.89.141.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zeniv.linux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ftp.linux.org.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linux.org.uk header.i=@linux.org.uk header.b="bTJ9KSYb" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=iQmtlwpjoBuhDIKrVX2ROSacAEL4zQOlW3vjcGcm8YA=; b=bTJ9KSYbbWYhngnYaOIi9Ke/sq XIpXgKyjuVpJ/TZsiM1ma0xDntrTflaRdOn0TTY6WO0g+rOEOKX9Z3ZaI3xPd4UoxziYPhf2jGaX8 +7Ij34UZjoy7meHhCLDjphY9ueTQOdqpg99/+0MrHRT9Aclixp4D6zOQO3WUeoRZvWGPX7rhNXyiV N6Pu3pi1tnSni1wQJOeHcqfiYqRiVlrKSU7dM1+LPVTuOlPGPlHlzTpL2v1r0c0I5xz5rk6pNSf0p b/JpAYfGwyaMxthsJx8ZyEBavPZtulG7RYd43nGB7uy/fDFKyCNF6yKsrGqUnZ+UfLksKYbnrMbE5 2xUTEnEQ==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.98 #2 (Red Hat Linux)) id 1t6def-00000009uCi-3drG; Thu, 31 Oct 2024 22:28:37 +0000 Date: Thu, 31 Oct 2024 22:28:37 +0000 From: Al Viro To: Linus Torvalds Cc: Christian Brauner , linux-fsdevel Subject: Re: generic_permission() optimization Message-ID: <20241031222837.GM1350452@ZenIV> References: <20241031060507.GJ1350452@ZenIV> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Al Viro On Thu, Oct 31, 2024 at 08:14:59AM -1000, Linus Torvalds wrote: > On Wed, 30 Oct 2024 at 20:42, Linus Torvalds > wrote: > > > > I was kind of hoping that such cases would use 'cache_no_acl()' which > > makes that inode->i_acl be NULL. Wouldn't that be the right model > > anyway for !IS_POSIXACL()? > > Alternatively, just initialize it to NULL in inode_init_always_gfp(), eg like > > - inode->i_acl = inode->i_default_acl = ACL_NOT_CACHED; > + inode->i_acl = inode->i_default_acl = > + (sb->s_flags & SB_POSIXACL) ? ACL_NOT_CACHED : NULL; IIRC, the reason we do not do that was the possibility of mount -o remount,acl Not that it makes much sense, but it's currently supported and POSIX ACLs don't make much sense to start with... Anyway, patch looks sane; I still think that adding || !IS_POSIXACL(inode) wouldn't hurt (yes, it's a dereference of ->i_sb in case when ->i_acl is ACL_NOT_CACHED, but we are going to dereference it shortly after in case we don't take the fast path. OTOH, that probably matters only for fairly specific loads - massive accesses to procfs and sysfs, mostly.