[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=widhgJ=hB=dOcQMJzPL9mX+8TdbcAspBXs4FSdiLk2jMw@mail.gmail.com>
Date: Fri, 13 Mar 2020 17:32:32 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Al Viro <viro@...iv.linux.org.uk>
Cc: linux-fsdevel <linux-fsdevel@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [RFC][PATCH v4 15/69] new step_into() flag: WALK_NOFOLLOW
I mentioned this last time (perhaps for a different sequence):
On Fri, Mar 13, 2020 at 4:54 PM Al Viro <viro@...iv.linux.org.uk> wrote:
>
> if (likely(!d_is_symlink(path->dentry)) ||
> - !(flags & WALK_FOLLOW || nd->flags & LOOKUP_FOLLOW)) {
> + !(flags & WALK_FOLLOW || nd->flags & LOOKUP_FOLLOW) ||
> + flags & WALK_NOFOLLOW) {
Yes, I know that bitwise operations have higher precedence than the
logical ones. And I know & (and &&) have higher precedence than | (and
||).
But I have to _think_ about it every time I see code like this.
I'd really prefer to see
if ((a & BIT) || (b & ANOTHER_BIT))
over the "equivalent" and shorter
if (a & BIT || b & ANOTHER_BIT)
Please make it explicit. It wasn't before either, but it _could_ be.
Linus
Powered by blists - more mailing lists