Content-Type: multipart/mixed; boundary="===============7782920752094809671==" MIME-Version: 1.0 From: Ming Lei To: kbuild-all@lists.01.org Subject: Re: [PATCH 2/2] kobject: wait until kobject is cleaned up before freeing module Date: Fri, 05 Nov 2021 22:54:36 +0800 Message-ID: In-Reply-To: <202111052230.7LkeiKvG-lkp@intel.com> List-Id: --===============7782920752094809671== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On Fri, Nov 05, 2021 at 10:10:07PM +0800, kernel test robot wrote: > Hi Ming, > = > Thank you for the patch! Yet something to improve: > = > [auto build test ERROR on driver-core/driver-core-testing] > [also build test ERROR on v5.15 next-20211105] > [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/Ming-Lei/kobject-avoid-t= o-cleanup-kobject-after-module-is-unloaded/20211105-144026 > base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-cor= e.git 27e0bcd02990f7291adb0f111e300f06c495d509 > config: mips-buildonly-randconfig-r003-20211105 (attached as .config) > compiler: mipsel-linux-gcc (GCC) 11.2.0 > reproduce (this is a W=3D1 build): > wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbi= n/make.cross -O ~/bin/make.cross > chmod +x ~/bin/make.cross > # https://github.com/0day-ci/linux/commit/4a9e015dd3d3e39d5723ea4= 6579ba21f5394806a > git remote add linux-review https://github.com/0day-ci/linux > git fetch --no-tags linux-review Ming-Lei/kobject-avoid-to-cleanu= p-kobject-after-module-is-unloaded/20211105-144026 > git checkout 4a9e015dd3d3e39d5723ea46579ba21f5394806a > # save the attached .config to linux build tree > mkdir build_dir > COMPILER_INSTALL_PATH=3D$HOME/0day COMPILER=3Dgcc-11.2.0 make.cro= ss O=3Dbuild_dir ARCH=3Dmips SHELL=3D/bin/bash > = > If you fix the issue, kindly add following tag as appropriate > Reported-by: kernel test robot > = > All errors (new ones prefixed by >>): > = > lib/kobject.c: In function 'kobj_module_callback': > >> lib/kobject.c:741:20: error: 'MODULE_STATE_GOING' undeclared (first us= e in this function) > 741 | if (val !=3D MODULE_STATE_GOING) > | ^~~~~~~~~~~~~~~~~~ > lib/kobject.c:741:20: note: each undeclared identifier is reported onl= y once for each function it appears in Hello, Thanks for the report! This must be triggered when CONFIG_MODULES is off, and the following patch should kill the failure: diff --git a/lib/kobject.c b/lib/kobject.c index f5fd6017d8ce..c054dca0001a 100644 --- a/lib/kobject.c +++ b/lib/kobject.c @@ -738,8 +738,10 @@ static int kobj_module_callback(struct notifier_block = *nb, { LIST_HEAD(pending); = +#ifdef CONFIG_MODULES if (val !=3D MODULE_STATE_GOING) return NOTIFY_DONE; +#endif = spin_lock_irq(&kobj_cleanup_lock); list_splice_init(&kobj_cleanup_list, &pending); Thanks, Ming --===============7782920752094809671==--