From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934067AbdK1KzG (ORCPT ); Tue, 28 Nov 2017 05:55:06 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:43673 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932214AbdK1KzC (ORCPT ); Tue, 28 Nov 2017 05:55:02 -0500 X-Google-Smtp-Source: AGs4zMa9EgeXbdQY8P7koFsuMP+obZ7aQ3aEs9nSw7yr952XScnHjjWfT+JvPL7ceRjel6oMCnhVCA== Date: Tue, 28 Nov 2017 11:54:58 +0100 From: Ingo Molnar To: Linus Torvalds Cc: Peter Zijlstra , Thomas Gleixner , LKML , Dave Hansen , Andy Lutomirski , Borislav Petkov , Brian Gerst , Denys Vlasenko , "H. Peter Anvin" , Josh Poimboeuf , Rik van Riel , Daniel Gruss , Hugh Dickins , Kees Cook , linux-mm , michael.schwarz@iaik.tugraz.at, moritz.lipp@iaik.tugraz.at, richard.fellner@student.tugraz.at Subject: Re: [PATCH] vfs: Add PERM_* symbolic helpers for common file mode/permissions Message-ID: <20171128105458.7pxbt2kabb5po5ho@gmail.com> References: <20171126231403.657575796@linutronix.de> <20171126232414.563046145@linutronix.de> <20171127094156.rbq7i7it7ojsblfj@hirez.programming.kicks-ass.net> <20171127100635.kfw2nspspqbrf2qm@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Linus Torvalds wrote: > On Mon, Nov 27, 2017 at 2:06 AM, Ingo Molnar wrote: > > > > > > +/* > > + * Human readable symbolic definitions for common > > + * file permissions: > > + */ > > +#define PERM_r________ 0400 > > +#define PERM_r__r_____ 0440 > > +#define PERM_r__r__r__ 0444 > > I'm not a fan. Particularly as you have a very random set of > permissions (rx and wx? Not very common), but also because it's just > not that legible. > > I've argued several times that we shouldn't use the defines at all. > The octal format isn't any less legible than any #define I've ever > seen, and is generally _more_ legible. > > What's wrong with just using 0400 for "read by user"? Yeah, the octal format isn't all that bad - at least relative to the symbolic obfuscation defines. Thanks, Ingo