* [axboe-block:pipe-nonblock.2 1/2] fs/splice.c:60:19: sparse: sparse: cast from restricted fmode_t
@ 2023-04-25 8:45 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-04-25 8:45 UTC (permalink / raw)
To: Jens Axboe; +Cc: oe-kbuild-all
tree: https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git pipe-nonblock.2
head: 09ad5feff1f4b3d12bf6a5aabf6752401043c471
commit: f10cbebf4dd7f77b0e87c77bb0191a5a07d5e7ac [1/2] splice: clear FMODE_NOWAIT on file if splice/vmsplice is used
config: m68k-randconfig-s033-20230423 (https://download.01.org/0day-ci/archive/20230425/202304251604.SwJpFdA1-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 12.1.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-39-gce1a6720-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git/commit/?id=f10cbebf4dd7f77b0e87c77bb0191a5a07d5e7ac
git remote add axboe-block https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git
git fetch --no-tags axboe-block pipe-nonblock.2
git checkout f10cbebf4dd7f77b0e87c77bb0191a5a07d5e7ac
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=m68k olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=m68k SHELL=/bin/bash
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202304251604.SwJpFdA1-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> fs/splice.c:60:19: sparse: sparse: cast from restricted fmode_t
>> fs/splice.c:60:19: sparse: sparse: cast from restricted fmode_t
>> fs/splice.c:60:19: sparse: sparse: cast to restricted fmode_t
vim +60 fs/splice.c
39
40 /*
41 * Splice doesn't support FMODE_NOWAIT. Since pipes may set this flag to
42 * indicate they support non-blocking reads or writes, we must clear it
43 * here if set to avoid blocking other users of this pipe if splice is
44 * being done on it.
45 */
46 static void pipe_clear_nowait(struct file *file)
47 {
48 fmode_t new_fmode, old_fmode;
49
50 /*
51 * We could get by with just doing an xchg() here as f_mode should
52 * not change in the file's lifetime, but let's be safe and use
53 * a cmpxchg() instead.
54 */
55 do {
56 old_fmode = READ_ONCE(file->f_mode);
57 if (!(old_fmode & FMODE_NOWAIT))
58 break;
59 new_fmode = old_fmode & ~FMODE_NOWAIT;
> 60 } while (!try_cmpxchg(&file->f_mode, &old_fmode, new_fmode));
61 }
62
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-04-25 8:45 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-25 8:45 [axboe-block:pipe-nonblock.2 1/2] fs/splice.c:60:19: sparse: sparse: cast from restricted fmode_t kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.