Content-Type: multipart/mixed; boundary="===============7640348494129546263==" MIME-Version: 1.0 From: kernel test robot To: kbuild-all@lists.01.org Subject: Re: [PATCH] net: missing lock releases in ipmr_base.c Date: Fri, 21 Jan 2022 15:58:16 +0800 Message-ID: <202201211542.TGuj5kMv-lkp@intel.com> In-Reply-To: <20220121032210.5829-1-ycaibb@gmail.com> List-Id: --===============7640348494129546263== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Hi ycaibb, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on net-next/master] [also build test WARNING on net/master horms-ipvs/master linus/master v5.16= next-20220121] [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/ycaibb/net-missing-lock-re= leases-in-ipmr_base-c/20220121-112603 base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git = 8aaaf2f3af2ae212428f4db1af34214225f5cec3 config: powerpc-allyesconfig (https://download.01.org/0day-ci/archive/20220= 121/202201211542.TGuj5kMv-lkp(a)intel.com/config) compiler: powerpc-linux-gcc (GCC) 11.2.0 reproduce (this is a W=3D1 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/33b03feacaf2155323b031274= d2d67dab0cf561c git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review ycaibb/net-missing-lock-releases-i= n-ipmr_base-c/20220121-112603 git checkout 33b03feacaf2155323b031274d2d67dab0cf561c # save the config file to linux build tree mkdir build_dir COMPILER_INSTALL_PATH=3D$HOME/0day COMPILER=3Dgcc-11.2.0 make.cross= O=3Dbuild_dir ARCH=3Dpowerpc SHELL=3D/bin/bash net/ipv4/ If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All warnings (new ones prefixed by >>): net/ipv4/ipmr_base.c: In function 'mr_mfc_seq_idx': >> net/ipv4/ipmr_base.c:156:17: warning: this 'if' clause does not guard...= [-Wmisleading-indentation] 156 | if (pos-- =3D=3D 0) | ^~ net/ipv4/ipmr_base.c:158:25: note: ...this statement, but the latter is = misleadingly indented as if it were guarded by the 'if' 158 | return mfc; | ^~~~~~ net/ipv4/ipmr_base.c:164:17: warning: this 'if' clause does not guard...= [-Wmisleading-indentation] 164 | if (pos-- =3D=3D 0) | ^~ net/ipv4/ipmr_base.c:166:25: note: ...this statement, but the latter is = misleadingly indented as if it were guarded by the 'if' 166 | return mfc; | ^~~~~~ vim +/if +156 net/ipv4/ipmr_base.c 3feda6b46f7347 Yuval Mintz 2018-02-28 146 = c8d61968032654 Yuval Mintz 2018-02-28 147 void *mr_mfc_seq_idx(struct net= *net, c8d61968032654 Yuval Mintz 2018-02-28 148 struct mr_mfc_iter *it, = loff_t pos) c8d61968032654 Yuval Mintz 2018-02-28 149 { c8d61968032654 Yuval Mintz 2018-02-28 150 struct mr_table *mrt =3D it->m= rt; c8d61968032654 Yuval Mintz 2018-02-28 151 struct mr_mfc *mfc; c8d61968032654 Yuval Mintz 2018-02-28 152 = c8d61968032654 Yuval Mintz 2018-02-28 153 rcu_read_lock(); c8d61968032654 Yuval Mintz 2018-02-28 154 it->cache =3D &mrt->mfc_cache_= list; c8d61968032654 Yuval Mintz 2018-02-28 155 list_for_each_entry_rcu(mfc, &= mrt->mfc_cache_list, list) c8d61968032654 Yuval Mintz 2018-02-28 @156 if (pos-- =3D=3D 0) 33b03feacaf215 Ryan Cai 2022-01-21 157 rcu_read_unlock(); c8d61968032654 Yuval Mintz 2018-02-28 158 return mfc; c8d61968032654 Yuval Mintz 2018-02-28 159 rcu_read_unlock(); c8d61968032654 Yuval Mintz 2018-02-28 160 = c8d61968032654 Yuval Mintz 2018-02-28 161 spin_lock_bh(it->lock); c8d61968032654 Yuval Mintz 2018-02-28 162 it->cache =3D &mrt->mfc_unres_= queue; c8d61968032654 Yuval Mintz 2018-02-28 163 list_for_each_entry(mfc, it->c= ache, list) c8d61968032654 Yuval Mintz 2018-02-28 164 if (pos-- =3D=3D 0) 33b03feacaf215 Ryan Cai 2022-01-21 165 spin_unlock_bh(it->lock); c8d61968032654 Yuval Mintz 2018-02-28 166 return mfc; c8d61968032654 Yuval Mintz 2018-02-28 167 spin_unlock_bh(it->lock); c8d61968032654 Yuval Mintz 2018-02-28 168 = c8d61968032654 Yuval Mintz 2018-02-28 169 it->cache =3D NULL; c8d61968032654 Yuval Mintz 2018-02-28 170 return NULL; c8d61968032654 Yuval Mintz 2018-02-28 171 } c8d61968032654 Yuval Mintz 2018-02-28 172 EXPORT_SYMBOL(mr_mfc_seq_idx); c8d61968032654 Yuval Mintz 2018-02-28 173 = --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org --===============7640348494129546263==--