All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Dai Ngo <dai.ngo@oracle.com>
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org
Subject: Re: [PATCH RFC v21 2/7] NFSD: add support for share reservation conflict to courteous server
Date: Sun, 24 Apr 2022 20:18:35 +0800	[thread overview]
Message-ID: <202204242040.x20oF5fR-lkp@intel.com> (raw)
In-Reply-To: <1650739455-26096-3-git-send-email-dai.ngo@oracle.com>

Hi Dai,

[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on linus/master]
[also build test WARNING on v5.18-rc3 next-20220422]
[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/intel-lab-lkp/linux/commits/Dai-Ngo/NFSD-Initial-implementation-of-NFSv4-Courteous-Server/20220424-024653
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 45ab9400e73f34103e73c18a73280c9aa1650e98
config: s390-randconfig-c005-20220424 (https://download.01.org/0day-ci/archive/20220424/202204242040.x20oF5fR-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 1cddcfdc3c683b393df1a5c9063252eb60e52818)
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
        # install s390 cross compiling tool for clang build
        # apt-get install binutils-s390x-linux-gnu
        # https://github.com/intel-lab-lkp/linux/commit/1d73d8e1a14e5e742fe00605d515a338af7af59b
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Dai-Ngo/NFSD-Initial-implementation-of-NFSv4-Courteous-Server/20220424-024653
        git checkout 1d73d8e1a14e5e742fe00605d515a338af7af59b
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=s390 SHELL=/bin/bash fs/nfsd/

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

   In file included from fs/nfsd/nfs4state.c:42:
   In file included from include/linux/sunrpc/svcauth_gss.h:14:
   In file included from include/linux/sunrpc/xdr.h:17:
   In file included from include/linux/scatterlist.h:9:
   In file included from arch/s390/include/asm/io.h:75:
   include/asm-generic/io.h:464:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __raw_readb(PCI_IOBASE + addr);
                             ~~~~~~~~~~ ^
   include/asm-generic/io.h:477:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
                                                           ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/big_endian.h:37:59: note: expanded from macro '__le16_to_cpu'
   #define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
                                                             ^
   include/uapi/linux/swab.h:102:54: note: expanded from macro '__swab16'
   #define __swab16(x) (__u16)__builtin_bswap16((__u16)(x))
                                                        ^
   In file included from fs/nfsd/nfs4state.c:42:
   In file included from include/linux/sunrpc/svcauth_gss.h:14:
   In file included from include/linux/sunrpc/xdr.h:17:
   In file included from include/linux/scatterlist.h:9:
   In file included from arch/s390/include/asm/io.h:75:
   include/asm-generic/io.h:490:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
                                                           ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/big_endian.h:35:59: note: expanded from macro '__le32_to_cpu'
   #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
                                                             ^
   include/uapi/linux/swab.h:115:54: note: expanded from macro '__swab32'
   #define __swab32(x) (__u32)__builtin_bswap32((__u32)(x))
                                                        ^
   In file included from fs/nfsd/nfs4state.c:42:
   In file included from include/linux/sunrpc/svcauth_gss.h:14:
   In file included from include/linux/sunrpc/xdr.h:17:
   In file included from include/linux/scatterlist.h:9:
   In file included from arch/s390/include/asm/io.h:75:
   include/asm-generic/io.h:501:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writeb(value, PCI_IOBASE + addr);
                               ~~~~~~~~~~ ^
   include/asm-generic/io.h:511:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
                                                         ~~~~~~~~~~ ^
   include/asm-generic/io.h:521:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
                                                         ~~~~~~~~~~ ^
   include/asm-generic/io.h:609:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           readsb(PCI_IOBASE + addr, buffer, count);
                  ~~~~~~~~~~ ^
   include/asm-generic/io.h:617:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           readsw(PCI_IOBASE + addr, buffer, count);
                  ~~~~~~~~~~ ^
   include/asm-generic/io.h:625:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           readsl(PCI_IOBASE + addr, buffer, count);
                  ~~~~~~~~~~ ^
   include/asm-generic/io.h:634:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           writesb(PCI_IOBASE + addr, buffer, count);
                   ~~~~~~~~~~ ^
   include/asm-generic/io.h:643:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           writesw(PCI_IOBASE + addr, buffer, count);
                   ~~~~~~~~~~ ^
   include/asm-generic/io.h:652:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           writesl(PCI_IOBASE + addr, buffer, count);
                   ~~~~~~~~~~ ^
   In file included from fs/nfsd/nfs4state.c:42:
   In file included from include/linux/sunrpc/svcauth_gss.h:14:
   include/linux/sunrpc/xdr.h:734:10: warning: result of comparison of constant 4611686018427387903 with expression of type '__u32' (aka 'unsigned int') is always false [-Wtautological-constant-out-of-range-compare]
           if (len > SIZE_MAX / sizeof(*p))
           ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:56:47: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                              ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:58:86: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                                       ~~~~~~~~~~~~~~~~~^~~~~
   include/linux/compiler.h:69:3: note: expanded from macro '__trace_if_value'
           (cond) ?                                        \
            ^~~~
   In file included from fs/nfsd/nfs4state.c:42:
   In file included from include/linux/sunrpc/svcauth_gss.h:14:
   include/linux/sunrpc/xdr.h:734:10: warning: result of comparison of constant 4611686018427387903 with expression of type '__u32' (aka 'unsigned int') is always false [-Wtautological-constant-out-of-range-compare]
           if (len > SIZE_MAX / sizeof(*p))
           ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:56:47: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                              ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:58:52: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                      ^~~~
   In file included from fs/nfsd/nfs4state.c:42:
   In file included from include/linux/sunrpc/svcauth_gss.h:14:
   include/linux/sunrpc/xdr.h:734:10: warning: result of comparison of constant 4611686018427387903 with expression of type '__u32' (aka 'unsigned int') is always false [-Wtautological-constant-out-of-range-compare]
           if (len > SIZE_MAX / sizeof(*p))
           ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:56:47: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                              ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:58:61: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                               ^~~~
>> fs/nfsd/nfs4state.c:5056:22: warning: variable 'clp' set but not used [-Wunused-but-set-variable]
           struct nfs4_client *clp;
                               ^
   16 warnings generated.


vim +/clp +5056 fs/nfsd/nfs4state.c

  5046	
  5047	static __be32 nfs4_get_vfs_file(struct svc_rqst *rqstp, struct nfs4_file *fp,
  5048			struct svc_fh *cur_fh, struct nfs4_ol_stateid *stp,
  5049			struct nfsd4_open *open, bool new_stp)
  5050	{
  5051		struct nfsd_file *nf = NULL;
  5052		__be32 status;
  5053		int oflag = nfs4_access_to_omode(open->op_share_access);
  5054		int access = nfs4_access_to_access(open->op_share_access);
  5055		unsigned char old_access_bmap, old_deny_bmap;
> 5056		struct nfs4_client *clp;
  5057	
  5058		spin_lock(&fp->fi_lock);
  5059	
  5060		/*
  5061		 * Are we trying to set a deny mode that would conflict with
  5062		 * current access?
  5063		 */
  5064		status = nfs4_file_check_deny(fp, open->op_share_deny);
  5065		if (status != nfs_ok) {
  5066			if (status != nfserr_share_denied) {
  5067				spin_unlock(&fp->fi_lock);
  5068				goto out;
  5069			}
  5070			clp = stp->st_stid.sc_client;
  5071			if (nfs4_resolve_deny_conflicts_locked(fp, new_stp,
  5072					stp, open->op_share_deny, false))
  5073				status = nfserr_jukebox;
  5074			spin_unlock(&fp->fi_lock);
  5075			goto out;
  5076		}
  5077	
  5078		/* set access to the file */
  5079		status = nfs4_file_get_access(fp, open->op_share_access);
  5080		if (status != nfs_ok) {
  5081			if (status != nfserr_share_denied) {
  5082				spin_unlock(&fp->fi_lock);
  5083				goto out;
  5084			}
  5085			clp = stp->st_stid.sc_client;
  5086			if (nfs4_resolve_deny_conflicts_locked(fp, new_stp,
  5087					stp, open->op_share_access, true))
  5088				status = nfserr_jukebox;
  5089			spin_unlock(&fp->fi_lock);
  5090			goto out;
  5091		}
  5092	
  5093		/* Set access bits in stateid */
  5094		old_access_bmap = stp->st_access_bmap;
  5095		set_access(open->op_share_access, stp);
  5096	
  5097		/* Set new deny mask */
  5098		old_deny_bmap = stp->st_deny_bmap;
  5099		set_deny(open->op_share_deny, stp);
  5100		fp->fi_share_deny |= (open->op_share_deny & NFS4_SHARE_DENY_BOTH);
  5101	
  5102		if (!fp->fi_fds[oflag]) {
  5103			spin_unlock(&fp->fi_lock);
  5104			status = nfsd_file_acquire(rqstp, cur_fh, access, &nf);
  5105			if (status)
  5106				goto out_put_access;
  5107			spin_lock(&fp->fi_lock);
  5108			if (!fp->fi_fds[oflag]) {
  5109				fp->fi_fds[oflag] = nf;
  5110				nf = NULL;
  5111			}
  5112		}
  5113		spin_unlock(&fp->fi_lock);
  5114		if (nf)
  5115			nfsd_file_put(nf);
  5116	
  5117		status = nfserrno(nfsd_open_break_lease(cur_fh->fh_dentry->d_inode,
  5118									access));
  5119		if (status)
  5120			goto out_put_access;
  5121	
  5122		status = nfsd4_truncate(rqstp, cur_fh, open);
  5123		if (status)
  5124			goto out_put_access;
  5125	out:
  5126		return status;
  5127	out_put_access:
  5128		stp->st_access_bmap = old_access_bmap;
  5129		nfs4_file_put_access(fp, open->op_share_access);
  5130		reset_union_bmap_deny(bmap_to_share_mode(old_deny_bmap), stp);
  5131		goto out;
  5132	}
  5133	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

  reply	other threads:[~2022-04-24 12:18 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-23 18:44 [PATCH RFC v21 0/7] NFSD: Initial implementation of NFSv4 Courteous Server Dai Ngo
2022-04-23 18:44 ` [PATCH RFC v21 1/7] NFSD: add courteous server support for thread with only delegation Dai Ngo
2022-04-25 18:51   ` J. Bruce Fields
2022-04-25 19:42     ` dai.ngo
2022-04-25 20:40       ` J. Bruce Fields
2022-04-25 21:35         ` dai.ngo
2022-04-25 21:48           ` J. Bruce Fields
2022-04-25 22:24             ` dai.ngo
2022-04-25 23:17               ` J. Bruce Fields
2022-04-23 18:44 ` [PATCH RFC v21 2/7] NFSD: add support for share reservation conflict to courteous server Dai Ngo
2022-04-24 12:18   ` kernel test robot [this message]
2022-04-25 13:15   ` Chuck Lever III
2022-04-25 15:08     ` dai.ngo
2022-04-23 18:44 ` [PATCH RFC v21 3/7] NFSD: move create/destroy of laundry_wq to init_nfsd and exit_nfsd Dai Ngo
2022-04-25 15:27   ` dai.ngo
2022-04-25 19:35     ` J. Bruce Fields
2022-04-25 19:46       ` dai.ngo
2022-04-23 18:44 ` [PATCH RFC v21 4/7] fs/lock: add helper locks_owner_has_blockers to check for blockers Dai Ngo
2022-04-23 18:44 ` [PATCH RFC v21 5/7] fs/lock: add 2 callbacks to lock_manager_operations to resolve conflict Dai Ngo
2022-04-23 18:44 ` [PATCH RFC v21 6/7] NFSD: add support for lock conflict to courteous server Dai Ngo
2022-04-23 18:44 ` [PATCH RFC v21 7/7] NFSD: Show state of courtesy client in client info Dai Ngo
2022-04-25 16:17 ` [PATCH RFC v21 0/7] NFSD: Initial implementation of NFSv4 Courteous Server J. Bruce Fields
2022-04-25 17:53   ` J. Bruce Fields
2022-04-25 18:16     ` dai.ngo
2022-04-25 19:19       ` J. Bruce Fields

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=202204242040.x20oF5fR-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=dai.ngo@oracle.com \
    --cc=kbuild-all@lists.01.org \
    --cc=llvm@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.