tree: https://gitee.com/openeuler/kernel.git OLK-5.10 head: 5cdf8021f6f20b488b2592811728b3f934fae628 commit: 448fbeaf0f07ea578841346b938245f5c5220b9b [23170/30000] md: protect md_thread with rcu config: x86_64-randconfig-121-20240910 (https://download.01.org/0day-ci/archive/20240911/202409111647.nFxvLIVx-lkp@i...) compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240911/202409111647.nFxvLIVx-lkp@i...)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot lkp@intel.com | Closes: https://lore.kernel.org/oe-kbuild-all/202409111647.nFxvLIVx-lkp@intel.com/
sparse warnings: (new ones prefixed by >>) drivers/md/md.c:3392:29: sparse: sparse: self-comparison always evaluates to false drivers/md/md.c:3561:33: sparse: sparse: self-comparison always evaluates to false drivers/md/md.c:4341:36: sparse: sparse: self-comparison always evaluates to false
drivers/md/md.c:4884:38: sparse: sparse: dereference of noderef expression
drivers/md/md.c:5247:30: sparse: sparse: self-comparison always evaluates to false drivers/md/md.c:5284:30: sparse: sparse: self-comparison always evaluates to false drivers/md/md.c:5326:30: sparse: sparse: self-comparison always evaluates to false
vim +4884 drivers/md/md.c
24dd469d728dae NeilBrown 2005-11-08 4857 e98a235fdfce57 Yu Kuai 2023-05-31 4858 static void stop_sync_thread(struct mddev *mddev) 24dd469d728dae NeilBrown 2005-11-08 4859 { e98a235fdfce57 Yu Kuai 2023-05-31 4860 if (!test_bit(MD_RECOVERY_RUNNING, &mddev->recovery)) e98a235fdfce57 Yu Kuai 2023-05-31 4861 return; 7eec314d7512d5 NeilBrown 2005-11-08 4862 e98a235fdfce57 Yu Kuai 2023-05-31 4863 if (mddev_lock(mddev)) e98a235fdfce57 Yu Kuai 2023-05-31 4864 return; e98a235fdfce57 Yu Kuai 2023-05-31 4865 e98a235fdfce57 Yu Kuai 2023-05-31 4866 /* e98a235fdfce57 Yu Kuai 2023-05-31 4867 * Check again in case MD_RECOVERY_RUNNING is cleared before lock is e98a235fdfce57 Yu Kuai 2023-05-31 4868 * held. e98a235fdfce57 Yu Kuai 2023-05-31 4869 */ e98a235fdfce57 Yu Kuai 2023-05-31 4870 if (!test_bit(MD_RECOVERY_RUNNING, &mddev->recovery)) { e98a235fdfce57 Yu Kuai 2023-05-31 4871 mddev_unlock(mddev); e98a235fdfce57 Yu Kuai 2023-05-31 4872 return; e98a235fdfce57 Yu Kuai 2023-05-31 4873 } 56ccc1125bc141 NeilBrown 2015-05-28 4874 cc1ffe61c026e2 Guoqing Jiang 2020-04-04 4875 if (work_pending(&mddev->del_work)) f851b60db0fd83 NeilBrown 2014-12-11 4876 flush_workqueue(md_misc_wq); e98a235fdfce57 Yu Kuai 2023-05-31 4877 7eec314d7512d5 NeilBrown 2005-11-08 4878 set_bit(MD_RECOVERY_INTR, &mddev->recovery); 1ade24b66e5223 Yu Kuai 2023-05-31 4879 /* 1ade24b66e5223 Yu Kuai 2023-05-31 4880 * Thread might be blocked waiting for metadata update which will now 1ade24b66e5223 Yu Kuai 2023-05-31 4881 * never happen. 1ade24b66e5223 Yu Kuai 2023-05-31 4882 */ 1ade24b66e5223 Yu Kuai 2023-05-31 4883 if (mddev->sync_thread) 1ade24b66e5223 Yu Kuai 2023-05-31 @4884 wake_up_process(mddev->sync_thread->tsk); e98a235fdfce57 Yu Kuai 2023-05-31 4885 8e8e2518fceca4 NeilBrown 2015-06-12 4886 mddev_unlock(mddev); 7eec314d7512d5 NeilBrown 2005-11-08 4887 } e98a235fdfce57 Yu Kuai 2023-05-31 4888
:::::: The code at line 4884 was first introduced by commit :::::: 1ade24b66e52235723afa4554f8cf6ecc2fb29b4 md: refactor idle/frozen_sync_thread()
:::::: TO: Yu Kuai yukuai3@huawei.com :::::: CC: Jialin Zhang zhangjialin11@huawei.com