All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [axboe-block:pipe-nonblock.2 1/2] fs/splice.c:60:19: sparse: sparse: cast from restricted fmode_t
Date: Tue, 25 Apr 2023 16:45:19 +0800	[thread overview]
Message-ID: <202304251604.SwJpFdA1-lkp@intel.com> (raw)

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

                 reply	other threads:[~2023-04-25  8:45 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202304251604.SwJpFdA1-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=axboe@kernel.dk \
    --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 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.