]> git.ipfire.org Git - thirdparty/linux.git/commit
filelock: fix break_lease() stub signature for CONFIG_FILE_LOCKING=n
authorChristian Brauner <brauner@kernel.org>
Sun, 7 Jun 2026 09:40:28 +0000 (11:40 +0200)
committerChristian Brauner <brauner@kernel.org>
Sun, 7 Jun 2026 09:40:28 +0000 (11:40 +0200)
commit4bbcff264b678859cc404669bd145bcd6819804b
tree8738ff5cdcd1559019d95c3dfa9dc4b1b48cad95
parent0da79c259ad0554b36761a7135d4f92eb7c46263
filelock: fix break_lease() stub signature for CONFIG_FILE_LOCKING=n

The CONFIG_FILE_LOCKING=n stub for break_lease() takes a 'bool wait'
argument, whereas the CONFIG_FILE_LOCKING=y version and every caller pass
an openmode as an 'unsigned int mode'. The mismatch was introduced when
__break_lease() was reworked to use flags: only the stub was switched to
'bool wait', a stray leftover from the neighbouring break_layout()
helper. The real prototype kept 'unsigned int mode'.

This was harmless until O_WRONLY changed from the octal literal 00000001
to (1 << 0). clang's -Wtautological-constant-compare then fires on the
implicit shift-to-bool conversion at the first FILE_LOCKING=n caller:

  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);

Restore the stub's parameter to 'unsigned int mode' so it matches the
real prototype and every caller. The stub still just returns 0, so there
is no functional change; it removes the type inconsistency and silences
the warning.

Root cause diagnosed by Nathan Chancellor.

Fixes: 4be9f3cc582a ("filelock: rework the __break_lease API to use flags")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202606071029.DKCs8WOs-lkp@intel.com/
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
include/linux/filelock.h