From: Jeff Layton <jlayton@kernel.org>
To: Nathan Chancellor <nathan@kernel.org>, kernel test robot <lkp@intel.com>
Cc: Jori Koolstra <jkoolstra@xs4all.nl>,
llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
Christian Brauner <christianvanbrauner@gmail.com>,
Christian Brauner <brauner@kernel.org>
Subject: Re: [brauner-github:vfs-7.2.misc 28/28] fs/open.c:112:29: warning: converting the result of '<<' to a boolean always evaluates to true
Date: Sun, 07 Jun 2026 06:07:04 -0400 [thread overview]
Message-ID: <00c74d4ecd2f5357e6ffd3fbfa4bacfd941099b3.camel@kernel.org> (raw)
In-Reply-To: <20260607041414.GA2161204@ax162>
On Sat, 2026-06-06 at 21:14 -0700, Nathan Chancellor wrote:
> On Sun, Jun 07, 2026 at 10:49:04AM +0800, kernel test robot wrote:
> > Hi Jori,
> >
> > FYI, the error/warning was bisected to this commit, please ignore it if it's irrelevant.
> >
> > tree: https://github.com/brauner/linux.git vfs-7.2.misc
> > head: 0da79c259ad0554b36761a7135d4f92eb7c46263
> > commit: 0da79c259ad0554b36761a7135d4f92eb7c46263 [28/28] vfs: uapi: retire octal and hex numbers in favor of (1 << n) for O_ flags
> > config: powerpc64-randconfig-001-20260607 (https://download.01.org/0day-ci/archive/20260607/202606071029.DKCs8WOs-lkp@intel.com/config)
> > compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project 7917772d7d61384696c61102c08c2ea158e610fa)
> > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260607/202606071029.DKCs8WOs-lkp@intel.com/reproduce)
> >
> > If you fix the issue in a separate patch/commit (i.e. not just a new version of
> > the same patch/commit), kindly add following tags
> > > Reported-by: kernel test robot <lkp@intel.com>
> > > Closes: https://lore.kernel.org/oe-kbuild-all/202606071029.DKCs8WOs-lkp@intel.com/
> >
> > All warnings (new ones prefixed by >>):
> >
> > > > fs/open.c:112:29: warning: converting the result of '<<' to a boolean always evaluates to true [-Wtautological-constant-compare]
> > 112 | error = break_lease(inode, O_WRONLY);
> > | ^
> > include/uapi/asm-generic/fcntl.h:20:21: note: expanded from macro 'O_WRONLY'
> > 20 | #define O_WRONLY (1 << 0)
> > | ^
>
> Hmmm, this appears to be pointing out an inconsistency between the
> different versions of break_lease(), depending on whether
> CONFIG_FILE_LOCKING is set or not. The CONFIG_FILE_LOCKING=n stub has a
> second parameter of 'bool wait' whereas the CONFIG_FILE_LOCKING=y case
> has a second parameter of 'unsigned int mode'. 4be9f3cc582a ("filelock:
> rework the __break_lease API to use flags") changed this, which seems
> incorrect to me.
Good catch. I missed updating the stub when CONFIG_FILE_LOCKING=n. I'll
send Christian a follow-on patch to fix that.
Maybe this is another sign that we should just kill CONFIG_FILE_LOCKING
and just always enable it? It's not like it increases the size of the
binary much, and I imagine only the tiniest embedded systems disable
it.
Thanks,
--
Jeff Layton <jlayton@kernel.org>
prev parent reply other threads:[~2026-06-07 10:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-07 2:49 [brauner-github:vfs-7.2.misc 28/28] fs/open.c:112:29: warning: converting the result of '<<' to a boolean always evaluates to true kernel test robot
2026-06-07 4:14 ` Nathan Chancellor
2026-06-07 10:07 ` Jeff Layton [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=00c74d4ecd2f5357e6ffd3fbfa4bacfd941099b3.camel@kernel.org \
--to=jlayton@kernel.org \
--cc=brauner@kernel.org \
--cc=christianvanbrauner@gmail.com \
--cc=jkoolstra@xs4all.nl \
--cc=lkp@intel.com \
--cc=llvm@lists.linux.dev \
--cc=nathan@kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox