LKML Archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Vasily Averin <vvs@virtuozzo.com>,
	Trond Myklebust <trond.myklebust@hammerspace.com>,
	Anna Schumaker <anna.schumaker@netapp.com>
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org, kernel@openvz.org,
	linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] nfs: local_lock: handle async processing of F_SETLK with FL_SLEEP
Date: Mon, 27 Dec 2021 20:59:31 +0800	[thread overview]
Message-ID: <202112272042.Xlz50x0x-lkp@intel.com> (raw)
In-Reply-To: <6613b17b-43bd-07d0-2ca7-1581a39cdf7b@virtuozzo.com>

Hi Vasily,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on trondmy-nfs/linux-next]
[also build test WARNING on v5.16-rc7 next-20211224]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Vasily-Averin/nfs-local_lock-handle-async-processing-of-F_SETLK-with-FL_SLEEP/20211227-184705
base:   git://git.linux-nfs.org/projects/trondmy/linux-nfs.git linux-next
config: i386-randconfig-r034-20211227 (https://download.01.org/0day-ci/archive/20211227/202112272042.Xlz50x0x-lkp@intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 511726c64d3b6cca66f7c54d457d586aa3129f67)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/00e7edbaaa914f1b049ab8a652c5a91483f4141d
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Vasily-Averin/nfs-local_lock-handle-async-processing-of-F_SETLK-with-FL_SLEEP/20211227-184705
        git checkout 00e7edbaaa914f1b049ab8a652c5a91483f4141d
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash fs/nfs/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> fs/nfs/file.c:772:25: warning: use of logical '&&' with constant operand [-Wconstant-logical-operand]
           else if ((fl->fl_flags && FL_SLEEP) && IS_SETLK(cmd))
                                  ^  ~~~~~~~~
   fs/nfs/file.c:772:25: note: use '&' for a bitwise operation
           else if ((fl->fl_flags && FL_SLEEP) && IS_SETLK(cmd))
                                  ^~
                                  &
   fs/nfs/file.c:772:25: note: remove constant to silence this warning
           else if ((fl->fl_flags && FL_SLEEP) && IS_SETLK(cmd))
                                 ~^~~~~~~~~~~
   1 warning generated.


vim +772 fs/nfs/file.c

   751	
   752	static int
   753	do_setlk(struct file *filp, int cmd, struct file_lock *fl, int is_local)
   754	{
   755		struct inode *inode = filp->f_mapping->host;
   756		int status;
   757	
   758		/*
   759		 * Flush all pending writes before doing anything
   760		 * with locks..
   761		 */
   762		status = nfs_sync_mapping(filp->f_mapping);
   763		if (status != 0)
   764			goto out;
   765	
   766		/*
   767		 * Use local locking if mounted with "-onolock" or with appropriate
   768		 * "-olocal_lock="
   769		 */
   770		if (!is_local)
   771			status = NFS_PROTO(inode)->lock(filp, cmd, fl);
 > 772		else if ((fl->fl_flags && FL_SLEEP) && IS_SETLK(cmd))
   773			status = posix_lock_file(filp, fl, NULL);
   774		else
   775			status = locks_lock_file_wait(filp, fl);
   776		if (status)
   777			goto out;
   778	
   779		/*
   780		 * Invalidate cache to prevent missing any changes.  If
   781		 * the file is mapped, clear the page cache as well so
   782		 * those mappings will be loaded.
   783		 *
   784		 * This makes locking act as a cache coherency point.
   785		 */
   786		nfs_sync_mapping(filp->f_mapping);
   787		if (!NFS_PROTO(inode)->have_delegation(inode, FMODE_READ)) {
   788			nfs_zap_caches(inode);
   789			if (mapping_mapped(filp->f_mapping))
   790				nfs_revalidate_mapping(inode, filp->f_mapping);
   791		}
   792	out:
   793		return status;
   794	}
   795	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

  reply	other threads:[~2021-12-27 13:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-27 10:45 [PATCH] nfs: local_lock: handle async processing of F_SETLK with FL_SLEEP Vasily Averin
2021-12-27 12:59 ` kernel test robot [this message]
2021-12-27 15:50   ` [PATCH v2] " Vasily Averin
2021-12-28  1:00     ` Vasily Averin
2022-01-06 10:29 ` [PATCH] " Dan Carpenter

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=202112272042.Xlz50x0x-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=anna.schumaker@netapp.com \
    --cc=kbuild-all@lists.01.org \
    --cc=kernel@openvz.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=trond.myklebust@hammerspace.com \
    --cc=vvs@virtuozzo.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).