From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from zeniv.linux.org.uk ([195.92.253.2]:45894 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726025AbeJMMNU (ORCPT ); Sat, 13 Oct 2018 08:13:20 -0400 Date: Sat, 13 Oct 2018 05:37:38 +0100 From: Al Viro To: Andreas Dilger Cc: Andreas =?iso-8859-1?Q?Gr=FCnbacher?= , Andreas Gruenbacher , Linux FS-devel Mailing List Subject: Re: posix_acl_permission() and MAY_* flags Message-ID: <20181013043738.GO32577@ZenIV.linux.org.uk> References: <1254FD78-8392-4B97-A191-EDA01B719635@whamcloud.com> <20181013035611.GL32577@ZenIV.linux.org.uk> <0C0A87C5-C1B8-42F8-A9C4-C355DDBC1B8F@dilger.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0C0A87C5-C1B8-42F8-A9C4-C355DDBC1B8F@dilger.ca> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Fri, Oct 12, 2018 at 10:08:57PM -0600, Andreas Dilger wrote: > It's not that I'm _so_ worried about the values changing, just > that I was following the ACL code paths around, and the caller > is passing in MAY_* flags on the one side, but then comparing > them to values set from S_I*OTH flags on disk and it made me > wonder if something was broken, or if it might break in the future. > > I would definitely agree that S_I* flags are set in stone, but > I've never really thought of MAY_* flags as being directly tied > to on-disk values because there are so many more than just > MAY_{READ,WRITE,EXECUTE} - MAY_APPEND, MAY_OPEN, etc. I'd always > thought of them like the EXT4_IMMUTABLE_FL on-disk flags vs. > the S_IMMUTABLE inode flags in memory. In theory - yes, in practice... imm/append-only are nowhere near as common and didn't have universal values on-disk (ext* ones are different from ufs ones, for example). It might be worth a comment (near the definition of MAY_..., probably mentioning that MAY_READ/MAY_WRITE/MAY_EXEC are also equal to R_OK/W_OK/X_OK), but that's about it.