mailweb.openeuler.org
Manage this list

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

Kernel

Threads by month
  • ----- 2025 -----
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2021 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2020 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2019 -----
  • December
kernel@openeuler.org

  • 59 participants
  • 19362 discussions
[PATCH OLK-6.6 0/8] support poison recover from migrate folio
by Tong Tiangen 18 Sep '24

18 Sep '24
The folio migration is widely used in kernel, memory compaction, memory hotplug, soft offline page, numa balance, memory demote/promotion, etc, but once access a poisoned source folio when migrating, the kernel will panic. There is a mechanism in the kernel to recover from uncorrectable memory errors, ARCH_HAS_COPY_MC(eg, Machine Check Safe Memory Copy on x86), which is already used in NVDIMM or core-mm paths(eg, CoW, khugepaged, coredump, ksm copy), see copy_mc_to_{user,kernel}, copy_mc_{user_}highpage callers. This series of patches provide the recovery mechanism from folio copy for the widely used folio migration. Please note, because folio migration is no guarantee of success, so we could chose to make folio migration tolerant of memory failures, adding folio_mc_copy() which is a #MC versions of folio_copy(), once accessing a poisoned source folio, we could return error and make the folio migration fail, and this could avoid the similar panic shown below. CPU: 1 PID: 88343 Comm: test_softofflin Kdump: loaded Not tainted 6.6.0 pc : copy_page+0x10/0xc0 lr : copy_highpage+0x38/0x50 ... Call trace: copy_page+0x10/0xc0 folio_copy+0x78/0x90 migrate_folio_extra+0x54/0xa0 move_to_new_folio+0xd8/0x1f0 migrate_folio_move+0xb8/0x300 migrate_pages_batch+0x528/0x788 migrate_pages_sync+0x8c/0x258 migrate_pages+0x440/0x528 soft_offline_in_use_page+0x2ec/0x3c0 soft_offline_page+0x238/0x310 soft_offline_page_store+0x6c/0xc0 dev_attr_store+0x20/0x40 sysfs_kf_write+0x4c/0x68 kernfs_fop_write_iter+0x130/0x1c8 new_sync_write+0xa4/0x138 vfs_write+0x238/0x2d8 ksys_write+0x74/0x110 Kefeng Wang (8): mm: migrate: simplify __buffer_migrate_folio() mm: migrate_device: unify migrate folio for MIGRATE_SYNC_NO_COPY mm: migrate: remove migrate_folio_extra() mm: move memory_failure_queue() into copy_mc_[user]_highpage() mm: add folio_mc_copy() mm: migrate: split folio_migrate_mapping() mm: migrate: support poisoned recover from migrate folio fs: hugetlbfs: support poisoned recover from hugetlbfs_migrate_folio() fs/hugetlbfs/inode.c | 5 +- include/linux/highmem.h | 6 +++ include/linux/migrate.h | 2 - include/linux/mm.h | 1 + mm/ksm.c | 1 - mm/memory.c | 13 ++--- mm/migrate.c | 102 ++++++++++++++++++++-------------------- mm/migrate_device.c | 16 ++++--- mm/util.c | 17 +++++++ 9 files changed, 88 insertions(+), 75 deletions(-) -- 2.25.1
2 9
0 0
[openeuler:openEuler-1.0-LTS 20295/23714] drivers/net/bonding/bond_sysctl.c:9:25: sparse: sparse: symbol 'bond_broadcast_arp_or_nd_table_header' was not declared. Should it be static?
by kernel test robot 17 Sep '24

17 Sep '24
tree: https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS head: 37aeb7e817053fbf532b214aa02858b3c23af0b1 commit: 0397c33121652647d544d4bcdceb9f2d868146af [20295/23714] anolis: bond: broadcast ARP or ND messages to all slaves config: x86_64-randconfig-123-20240915 (https://download.01.org/0day-ci/archive/20240917/202409170243.8clAJD1d-lkp@…) compiler: gcc-12 (Debian 12.2.0-14) 12.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240917/202409170243.8clAJD1d-lkp@…) 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(a)intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202409170243.8clAJD1d-lkp@intel.com/ sparse warnings: (new ones prefixed by >>) >> drivers/net/bonding/bond_sysctl.c:9:25: sparse: sparse: symbol 'bond_broadcast_arp_or_nd_table_header' was not declared. Should it be static? vim +/bond_broadcast_arp_or_nd_table_header +9 drivers/net/bonding/bond_sysctl.c 8 > 9 struct ctl_table_header *bond_broadcast_arp_or_nd_table_header; 10 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
1 0
0 0
[openeuler:openEuler-1.0-LTS 19376/23714] net/ax25/ax25_dev.o: warning: objtool: missing symbol for section .exit.text
by kernel test robot 17 Sep '24

17 Sep '24
tree: https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS head: 37aeb7e817053fbf532b214aa02858b3c23af0b1 commit: 5ba8a3eb026f02aa75f4a22099250bfd4db659cb [19376/23714] ax25: add refcount in ax25_dev to avoid UAF bugs config: x86_64-buildonly-randconfig-005-20240915 (https://download.01.org/0day-ci/archive/20240917/202409170005.Q9skpI8V-lkp@…) compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240917/202409170005.Q9skpI8V-lkp@…) 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(a)intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202409170005.Q9skpI8V-lkp@intel.com/ All warnings (new ones prefixed by >>): >> net/ax25/ax25_dev.o: warning: objtool: missing symbol for section .exit.text -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
1 0
0 0
[openeuler:openEuler-1.0-LTS 9570/23714] drivers/scsi/scsi_logging.o: warning: objtool: missing symbol for section .text
by kernel test robot 16 Sep '24

16 Sep '24
Hi Bart, FYI, the error/warning still remains. tree: https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS head: 37aeb7e817053fbf532b214aa02858b3c23af0b1 commit: 63b053c4efdb2e27f350bc9c1db4fed08a30801d [9570/23714] scsi: core: Reduce memory required for SCSI logging config: x86_64-buildonly-randconfig-002-20240915 (https://download.01.org/0day-ci/archive/20240916/202409162223.ddty3va3-lkp@…) compiler: gcc-12 (Debian 12.2.0-14) 12.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240916/202409162223.ddty3va3-lkp@…) 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(a)intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202409162223.ddty3va3-lkp@intel.com/ All warnings (new ones prefixed by >>): >> drivers/scsi/scsi_logging.o: warning: objtool: missing symbol for section .text -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
1 0
0 0
[openeuler:openEuler-1.0-LTS 17157/23714] drivers/md/bcache/request.c:1333:27: sparse: sparse: incorrect type in argument 1 (different address spaces)
by kernel test robot 16 Sep '24

16 Sep '24
tree: https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS head: 37aeb7e817053fbf532b214aa02858b3c23af0b1 commit: cb004e127a5500466043986dbc4cc43ec63d849e [17157/23714] Add traffic policy for low cache available. config: x86_64-randconfig-123-20240915 (https://download.01.org/0day-ci/archive/20240916/202409162232.mD47BzHq-lkp@…) compiler: gcc-12 (Debian 12.2.0-14) 12.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240916/202409162232.mD47BzHq-lkp@…) 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(a)intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202409162232.mD47BzHq-lkp@intel.com/ sparse warnings: (new ones prefixed by >>) drivers/md/bcache/request.c: note: in included file (through drivers/md/bcache/bcache.h): include/uapi/linux/bcache.h:294:38: sparse: sparse: array of flexible structures drivers/md/bcache/request.c: note: in included file (through drivers/md/bcache/bcache.h): drivers/md/bcache/bset.h:231:36: sparse: sparse: array of flexible structures >> drivers/md/bcache/request.c:1333:27: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void [noderef] <asn:1> *to @@ got struct get_bcache_status * @@ drivers/md/bcache/request.c:1333:27: sparse: expected void [noderef] <asn:1> *to drivers/md/bcache/request.c:1333:27: sparse: got struct get_bcache_status * >> drivers/md/bcache/request.c:1346:33: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] <asn:1> *from @@ got struct set_bcache_status * @@ drivers/md/bcache/request.c:1346:33: sparse: expected void const [noderef] <asn:1> *from drivers/md/bcache/request.c:1346:33: sparse: got struct set_bcache_status * vim +1333 drivers/md/bcache/request.c 1315 1316 static int bcache_get_write_status(struct cached_dev *dc, unsigned long arg) 1317 { 1318 struct get_bcache_status a; 1319 uint64_t cache_sectors; 1320 struct cache_set *c = dc->disk.c; 1321 1322 if (c == NULL) 1323 return -ENODEV; 1324 1325 a.writeback_sector_size_per_sec = dc->writeback_sector_size_per_sec; 1326 a.writeback_io_num_per_sec = dc->writeback_io_num_per_sec; 1327 a.front_io_num_per_sec = dc->front_io_num_per_sec; 1328 cache_sectors = c->nbuckets * c->sb.bucket_size - 1329 atomic_long_read(&c->flash_dev_dirty_sectors); 1330 a.dirty_rate = div64_u64(bcache_dev_sectors_dirty(&dc->disk) * 100, 1331 cache_sectors); 1332 a.available = 100 - c->gc_stats.in_use; > 1333 if (copy_to_user((struct get_bcache_status *)arg, &a, 1334 sizeof(struct get_bcache_status))) 1335 return -EFAULT; 1336 return 0; 1337 } 1338 1339 static int bcache_set_write_status(struct cached_dev *dc, unsigned long arg) 1340 { 1341 struct set_bcache_status a; 1342 struct cache_set *c = dc->disk.c; 1343 1344 if (c == NULL) 1345 return -ENODEV; > 1346 if (copy_from_user(&a, (struct set_bcache_status *)arg, 1347 sizeof(struct set_bcache_status))) 1348 return -EFAULT; 1349 1350 if (c->traffic_policy_start != a.traffic_policy_start) 1351 pr_info("%s traffic policy %s", dc->disk.disk->disk_name, 1352 (a.traffic_policy_start == true) ? "enable" : "disable"); 1353 if (c->force_write_through != a.force_write_through) 1354 pr_info("%s force write through %s", dc->disk.disk->disk_name, 1355 (a.force_write_through == true) ? "enable" : "disable"); 1356 if (a.trigger_gc) { 1357 pr_info("trigger %s gc", dc->disk.disk->disk_name); 1358 atomic_set(&c->sectors_to_gc, -1); 1359 wake_up_gc(c); 1360 } 1361 if ((a.cutoff_writeback_sync >= MIN_CUTOFF_WRITEBACK_SYNC) && 1362 (a.cutoff_writeback_sync <= MAX_CUTOFF_WRITEBACK_SYNC)) { 1363 c->cutoff_writeback_sync = a.cutoff_writeback_sync; 1364 } 1365 1366 dc->max_sector_size = a.write_token_sector_size; 1367 dc->max_io_num = a.write_token_io_num; 1368 c->traffic_policy_start = a.traffic_policy_start; 1369 c->force_write_through = a.force_write_through; 1370 c->gc_sectors = a.gc_sectors; 1371 dc->writeback_state = a.writeback_state; 1372 return 0; 1373 } 1374 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
1 0
0 0
[openeuler:openEuler-1.0-LTS 15748/23714] include/linux/uaccess.h:112:17: warning: 'kmask' may be used uninitialized
by kernel test robot 16 Sep '24

16 Sep '24
tree: https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS head: 37aeb7e817053fbf532b214aa02858b3c23af0b1 commit: b77633c8236f2383f8d994249b40ed1bd3d012c0 [15748/23714] signal: simplify set_user_sigmask/restore_user_sigmask config: arm64-randconfig-001-20240913 (https://download.01.org/0day-ci/archive/20240916/202409162133.aY7fqmYk-lkp@…) compiler: aarch64-linux-gcc (GCC) 14.1.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240916/202409162133.aY7fqmYk-lkp@…) 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(a)intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202409162133.aY7fqmYk-lkp@intel.com/ Note: it may well be a FALSE warning. FWIW you are at least aware of it now. http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings All warnings (new ones prefixed by >>): | ^~~~~~~~~~~ In file included from include/asm-generic/termios.h:6, from ./arch/arm64/include/generated/uapi/asm/termios.h:1, from include/uapi/linux/termios.h:6, from include/linux/tty.h:7, from kernel/signal.c:23: In function '_copy_from_user', inlined from 'copy_from_user' at include/linux/uaccess.h:144:7, inlined from '__do_sys_sigaltstack' at kernel/signal.c:3635:13, inlined from '__se_sys_sigaltstack' at kernel/signal.c:3631:1: include/linux/uaccess.h:112:17: warning: 'new' may be used uninitialized [-Wmaybe-uninitialized] 112 | kasan_check_write(to, n); | ^~~~~~~~~~~~~~~~~~~~~~~~ In file included from include/linux/compiler.h:251, from include/asm-generic/bug.h:5, from arch/arm64/include/asm/bug.h:37, from include/linux/bug.h:5, from include/linux/mmdebug.h:5, from include/linux/gfp.h:5, from include/linux/slab.h:15, from kernel/signal.c:13: include/linux/kasan-checks.h: In function '__se_sys_sigaltstack': include/linux/kasan-checks.h:7:6: note: by argument 1 of type 'const volatile void *' to 'kasan_check_write' declared here 7 | void kasan_check_write(const volatile void *p, unsigned int size); | ^~~~~~~~~~~~~~~~~ kernel/signal.c:3633:17: note: 'new' declared here 3633 | stack_t new, old; | ^~~ In function '_copy_from_user', inlined from 'copy_from_user' at include/linux/uaccess.h:144:7, inlined from 'do_compat_sigaltstack' at kernel/signal.c:3678:7: include/linux/uaccess.h:112:17: warning: 'uss32' may be used uninitialized [-Wmaybe-uninitialized] 112 | kasan_check_write(to, n); | ^~~~~~~~~~~~~~~~~~~~~~~~ include/linux/kasan-checks.h: In function 'do_compat_sigaltstack': include/linux/kasan-checks.h:7:6: note: by argument 1 of type 'const volatile void *' to 'kasan_check_write' declared here 7 | void kasan_check_write(const volatile void *p, unsigned int size); | ^~~~~~~~~~~~~~~~~ kernel/signal.c:3677:32: note: 'uss32' declared here 3677 | compat_stack_t uss32; | ^~~~~ In function '_copy_from_user', inlined from 'copy_from_user' at include/linux/uaccess.h:144:7, inlined from '__do_sys_rt_tgsigqueueinfo' at kernel/signal.c:3496:6, inlined from '__se_sys_rt_tgsigqueueinfo' at kernel/signal.c:3491:1: include/linux/uaccess.h:112:17: warning: 'info' may be used uninitialized [-Wmaybe-uninitialized] 112 | kasan_check_write(to, n); | ^~~~~~~~~~~~~~~~~~~~~~~~ include/linux/kasan-checks.h: In function '__se_sys_rt_tgsigqueueinfo': include/linux/kasan-checks.h:7:6: note: by argument 1 of type 'const volatile void *' to 'kasan_check_write' declared here 7 | void kasan_check_write(const volatile void *p, unsigned int size); | ^~~~~~~~~~~~~~~~~ kernel/signal.c:3494:19: note: 'info' declared here 3494 | siginfo_t info; | ^~~~ In function '_copy_from_user', inlined from 'copy_from_user' at include/linux/uaccess.h:144:7, inlined from '__do_sys_rt_sigqueueinfo' at kernel/signal.c:3454:6, inlined from '__se_sys_rt_sigqueueinfo' at kernel/signal.c:3450:1: include/linux/uaccess.h:112:17: warning: 'info' may be used uninitialized [-Wmaybe-uninitialized] 112 | kasan_check_write(to, n); | ^~~~~~~~~~~~~~~~~~~~~~~~ include/linux/kasan-checks.h: In function '__se_sys_rt_sigqueueinfo': include/linux/kasan-checks.h:7:6: note: by argument 1 of type 'const volatile void *' to 'kasan_check_write' declared here 7 | void kasan_check_write(const volatile void *p, unsigned int size); | ^~~~~~~~~~~~~~~~~ kernel/signal.c:3453:19: note: 'info' declared here 3453 | siginfo_t info; | ^~~~ In function '_copy_from_user', inlined from 'copy_from_user' at include/linux/uaccess.h:144:7, inlined from '__do_sys_sigprocmask' at kernel/signal.c:3783:7, inlined from '__se_sys_sigprocmask' at kernel/signal.c:3774:1: include/linux/uaccess.h:112:17: warning: 'new_set' may be used uninitialized [-Wmaybe-uninitialized] 112 | kasan_check_write(to, n); | ^~~~~~~~~~~~~~~~~~~~~~~~ include/linux/kasan-checks.h: In function '__se_sys_sigprocmask': include/linux/kasan-checks.h:7:6: note: by argument 1 of type 'const volatile void *' to 'kasan_check_write' declared here 7 | void kasan_check_write(const volatile void *p, unsigned int size); | ^~~~~~~~~~~~~~~~~ kernel/signal.c:3777:31: note: 'new_set' declared here 3777 | old_sigset_t old_set, new_set; | ^~~~~~~ In function '_copy_from_user', inlined from 'copy_from_user' at include/linux/uaccess.h:144:7, inlined from '__do_sys_rt_sigprocmask' at kernel/signal.c:2887:7, inlined from '__se_sys_rt_sigprocmask' at kernel/signal.c:2874:1: include/linux/uaccess.h:112:17: warning: 'new_set' may be used uninitialized [-Wmaybe-uninitialized] 112 | kasan_check_write(to, n); | ^~~~~~~~~~~~~~~~~~~~~~~~ include/linux/kasan-checks.h: In function '__se_sys_rt_sigprocmask': include/linux/kasan-checks.h:7:6: note: by argument 1 of type 'const volatile void *' to 'kasan_check_write' declared here 7 | void kasan_check_write(const volatile void *p, unsigned int size); | ^~~~~~~~~~~~~~~~~ kernel/signal.c:2877:27: note: 'new_set' declared here 2877 | sigset_t old_set, new_set; | ^~~~~~~ In function '_copy_from_user', inlined from 'copy_from_user' at include/linux/uaccess.h:144:7, inlined from 'set_user_sigmask' at kernel/signal.c:2836:6: >> include/linux/uaccess.h:112:17: warning: 'kmask' may be used uninitialized [-Wmaybe-uninitialized] 112 | kasan_check_write(to, n); | ^~~~~~~~~~~~~~~~~~~~~~~~ include/linux/kasan-checks.h: In function 'set_user_sigmask': include/linux/kasan-checks.h:7:6: note: by argument 1 of type 'const volatile void *' to 'kasan_check_write' declared here 7 | void kasan_check_write(const volatile void *p, unsigned int size); | ^~~~~~~~~~~~~~~~~ kernel/signal.c:2830:18: note: 'kmask' declared here 2830 | sigset_t kmask; | ^~~~~ In function '_copy_from_user', inlined from 'copy_from_user' at include/linux/uaccess.h:144:7, inlined from '__do_sys_rt_sigtimedwait' at kernel/signal.c:3281:6, inlined from '__se_sys_rt_sigtimedwait' at kernel/signal.c:3268:1: include/linux/uaccess.h:112:17: warning: 'these' may be used uninitialized [-Wmaybe-uninitialized] 112 | kasan_check_write(to, n); | ^~~~~~~~~~~~~~~~~~~~~~~~ include/linux/kasan-checks.h: In function '__se_sys_rt_sigtimedwait': include/linux/kasan-checks.h:7:6: note: by argument 1 of type 'const volatile void *' to 'kasan_check_write' declared here 7 | void kasan_check_write(const volatile void *p, unsigned int size); | ^~~~~~~~~~~~~~~~~ kernel/signal.c:3272:18: note: 'these' declared here 3272 | sigset_t these; | ^~~~~ In function '_copy_from_user', inlined from 'copy_from_user' at include/linux/uaccess.h:144:7, inlined from 'copy_siginfo_from_user32' at kernel/signal.c:3125:6: include/linux/uaccess.h:112:17: warning: 'from' may be used uninitialized [-Wmaybe-uninitialized] 112 | kasan_check_write(to, n); | ^~~~~~~~~~~~~~~~~~~~~~~~ include/linux/kasan-checks.h: In function 'copy_siginfo_from_user32': include/linux/kasan-checks.h:7:6: note: by argument 1 of type 'const volatile void *' to 'kasan_check_write' declared here 7 | void kasan_check_write(const volatile void *p, unsigned int size); | ^~~~~~~~~~~~~~~~~ kernel/signal.c:3123:31: note: 'from' declared here 3123 | struct compat_siginfo from; | ^~~~ In function '_copy_from_user', inlined from 'copy_from_user' at include/linux/uaccess.h:144:7, inlined from '__do_sys_rt_sigaction' at kernel/signal.c:3834:13, inlined from '__se_sys_rt_sigaction' at kernel/signal.c:3822:1: include/linux/uaccess.h:112:17: warning: 'new_sa' may be used uninitialized [-Wmaybe-uninitialized] 112 | kasan_check_write(to, n); | ^~~~~~~~~~~~~~~~~~~~~~~~ include/linux/kasan-checks.h: In function '__se_sys_rt_sigaction': include/linux/kasan-checks.h:7:6: note: by argument 1 of type 'const volatile void *' to 'kasan_check_write' declared here 7 | void kasan_check_write(const volatile void *p, unsigned int size); | ^~~~~~~~~~~~~~~~~ kernel/signal.c:3827:28: note: 'new_sa' declared here 3827 | struct k_sigaction new_sa, old_sa; | ^~~~~~ In function '_copy_from_user', inlined from 'copy_from_user' at include/linux/uaccess.h:144:7, inlined from 'restore_altstack' at kernel/signal.c:3648:6: include/linux/uaccess.h:112:17: warning: 'new' may be used uninitialized [-Wmaybe-uninitialized] 112 | kasan_check_write(to, n); | ^~~~~~~~~~~~~~~~~~~~~~~~ include/linux/kasan-checks.h: In function 'restore_altstack': include/linux/kasan-checks.h:7:6: note: by argument 1 of type 'const volatile void *' to 'kasan_check_write' declared here 7 | void kasan_check_write(const volatile void *p, unsigned int size); | ^~~~~~~~~~~~~~~~~ kernel/signal.c:3647:17: note: 'new' declared here 3647 | stack_t new; | ^~~ In function '_copy_from_user', inlined from 'copy_from_user' at include/linux/uaccess.h:144:7, inlined from '__do_sys_rt_sigsuspend' at kernel/signal.c:4053:6, inlined from '__se_sys_rt_sigsuspend' at kernel/signal.c:4045:1, inlined from '__arm64_sys_rt_sigsuspend' at kernel/signal.c:4045:1: include/linux/uaccess.h:112:17: warning: 'newset' may be used uninitialized [-Wmaybe-uninitialized] 112 | kasan_check_write(to, n); | ^~~~~~~~~~~~~~~~~~~~~~~~ include/linux/kasan-checks.h: In function '__arm64_sys_rt_sigsuspend': include/linux/kasan-checks.h:7:6: note: by argument 1 of type 'const volatile void *' to 'kasan_check_write' declared here 7 | void kasan_check_write(const volatile void *p, unsigned int size); | ^~~~~~~~~~~~~~~~~ kernel/signal.c:4047:18: note: 'newset' declared here 4047 | sigset_t newset; | ^~~~~~ vim +/kmask +112 include/linux/uaccess.h d597580d373774 Al Viro 2017-03-20 104 d597580d373774 Al Viro 2017-03-20 105 #ifdef INLINE_COPY_FROM_USER d597580d373774 Al Viro 2017-03-20 106 static inline unsigned long d597580d373774 Al Viro 2017-03-20 107 _copy_from_user(void *to, const void __user *from, unsigned long n) d597580d373774 Al Viro 2017-03-20 108 { d597580d373774 Al Viro 2017-03-20 109 unsigned long res = n; 9c5f6908de03a4 Al Viro 2017-06-29 110 might_fault(); 4983cb67a383a7 Linus Torvalds 2019-02-14 111 if (likely(access_ok(from, n))) { 9c5f6908de03a4 Al Viro 2017-06-29 @112 kasan_check_write(to, n); d597580d373774 Al Viro 2017-03-20 113 res = raw_copy_from_user(to, from, n); 9c5f6908de03a4 Al Viro 2017-06-29 114 } d597580d373774 Al Viro 2017-03-20 115 if (unlikely(res)) d597580d373774 Al Viro 2017-03-20 116 memset(to + (n - res), 0, res); d597580d373774 Al Viro 2017-03-20 117 return res; d597580d373774 Al Viro 2017-03-20 118 } d597580d373774 Al Viro 2017-03-20 119 #else d597580d373774 Al Viro 2017-03-20 120 extern unsigned long d597580d373774 Al Viro 2017-03-20 121 _copy_from_user(void *, const void __user *, unsigned long); d597580d373774 Al Viro 2017-03-20 122 #endif d597580d373774 Al Viro 2017-03-20 123 :::::: The code at line 112 was first introduced by commit :::::: 9c5f6908de03a4f52ba7364b11fcd6116225480c copy_{from,to}_user(): move kasan checks and might_fault() out-of-line :::::: TO: Al Viro <viro(a)zeniv.linux.org.uk> :::::: CC: Al Viro <viro(a)zeniv.linux.org.uk> -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
1 0
0 0
[openeuler:openEuler-1.0-LTS 16693/23714] arch/x86/kernel/unwind_orc.o: warning: objtool: missing symbol for section .text
by kernel test robot 16 Sep '24

16 Sep '24
tree: https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS head: 37aeb7e817053fbf532b214aa02858b3c23af0b1 commit: badd79c400ed404df871e1d035bed971d20ead4c [16693/23714] x86/unwind/orc: Remove boot-time ORC unwind tables sorting config: x86_64-buildonly-randconfig-005-20240915 (https://download.01.org/0day-ci/archive/20240916/202409162123.h3UocbtQ-lkp@…) compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240916/202409162123.h3UocbtQ-lkp@…) 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(a)intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202409162123.h3UocbtQ-lkp@intel.com/ All warnings (new ones prefixed by >>): arch/x86/kernel/unwind_orc.c:179:13: warning: unused function 'orc_sort_swap' [-Wunused-function] 179 | static void orc_sort_swap(void *_a, void *_b, int size) | ^~~~~~~~~~~~~ arch/x86/kernel/unwind_orc.c:199:12: warning: unused function 'orc_sort_cmp' [-Wunused-function] 199 | static int orc_sort_cmp(const void *_a, const void *_b) | ^~~~~~~~~~~~ 2 warnings generated. >> arch/x86/kernel/unwind_orc.o: warning: objtool: missing symbol for section .text -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
1 0
0 0
[openeuler:openEuler-1.0-LTS 15692/23714] include/linux/uaccess.h:112:17: warning: 'ciov' may be used uninitialized
by kernel test robot 16 Sep '24

16 Sep '24
Hi Jens, FYI, the error/warning still remains. tree: https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS head: 37aeb7e817053fbf532b214aa02858b3c23af0b1 commit: 6c08191286995b0594d2ecf12fe7fca3cea1a5ca [15692/23714] io_uring: add support for pre-mapped user IO buffers config: arm64-randconfig-001-20240913 (https://download.01.org/0day-ci/archive/20240916/202409161843.Wdlfbwor-lkp@…) compiler: aarch64-linux-gcc (GCC) 14.1.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240916/202409161843.Wdlfbwor-lkp@…) 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(a)intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202409161843.Wdlfbwor-lkp@intel.com/ Note: it may well be a FALSE warning. FWIW you are at least aware of it now. http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings All warnings (new ones prefixed by >>): In file included from include/linux/poll.h:12, from include/linux/ring_buffer.h:7, from include/linux/trace_events.h:6, from include/trace/syscall.h:7, from include/linux/syscalls.h:86, from fs/io_uring.c:32: In function '_copy_from_user', inlined from 'copy_from_user' at include/linux/uaccess.h:144:7, inlined from 'io_copy_iov.isra' at fs/io_uring.c:1457:7: >> include/linux/uaccess.h:112:17: warning: 'ciov' may be used uninitialized [-Wmaybe-uninitialized] 112 | kasan_check_write(to, n); | ^~~~~~~~~~~~~~~~~~~~~~~~ In file included from include/linux/compiler.h:251, from include/linux/export.h:45, from include/linux/linkage.h:7, from include/linux/kernel.h:7, from fs/io_uring.c:29: include/linux/kasan-checks.h: In function 'io_copy_iov.isra': include/linux/kasan-checks.h:7:6: note: by argument 1 of type 'const volatile void *' to 'kasan_check_write' declared here 7 | void kasan_check_write(const volatile void *p, unsigned int size); | ^~~~~~~~~~~~~~~~~ fs/io_uring.c:1454:37: note: 'ciov' declared here 1454 | struct compat_iovec ciov; | ^~~~ In function '_copy_from_user', inlined from 'copy_from_user' at include/linux/uaccess.h:144:7, inlined from 'io_uring_setup' at fs/io_uring.c:1960:6: include/linux/uaccess.h:112:17: warning: 'p' may be used uninitialized [-Wmaybe-uninitialized] 112 | kasan_check_write(to, n); | ^~~~~~~~~~~~~~~~~~~~~~~~ include/linux/kasan-checks.h: In function 'io_uring_setup': include/linux/kasan-checks.h:7:6: note: by argument 1 of type 'const volatile void *' to 'kasan_check_write' declared here 7 | void kasan_check_write(const volatile void *p, unsigned int size); | ^~~~~~~~~~~~~~~~~ fs/io_uring.c:1956:32: note: 'p' declared here 1956 | struct io_uring_params p; | ^ In file included from include/linux/uaccess.h:11: In function 'set_fs', inlined from 'io_sq_wq_submit_work' at fs/io_uring.c:1114:3: arch/arm64/include/asm/uaccess.h:59:12: warning: 'old_fs' may be used uninitialized [-Wmaybe-uninitialized] 59 | if (IS_ENABLED(CONFIG_ARM64_UAO) && fs == KERNEL_DS) | ^ fs/io_uring.c: In function 'io_sq_wq_submit_work': fs/io_uring.c:1074:22: note: 'old_fs' was declared here 1074 | mm_segment_t old_fs; | ^~~~~~ vim +/ciov +112 include/linux/uaccess.h d597580d373774 Al Viro 2017-03-20 104 d597580d373774 Al Viro 2017-03-20 105 #ifdef INLINE_COPY_FROM_USER d597580d373774 Al Viro 2017-03-20 106 static inline unsigned long d597580d373774 Al Viro 2017-03-20 107 _copy_from_user(void *to, const void __user *from, unsigned long n) d597580d373774 Al Viro 2017-03-20 108 { d597580d373774 Al Viro 2017-03-20 109 unsigned long res = n; 9c5f6908de03a4 Al Viro 2017-06-29 110 might_fault(); 4983cb67a383a7 Linus Torvalds 2019-02-14 111 if (likely(access_ok(from, n))) { 9c5f6908de03a4 Al Viro 2017-06-29 @112 kasan_check_write(to, n); d597580d373774 Al Viro 2017-03-20 113 res = raw_copy_from_user(to, from, n); 9c5f6908de03a4 Al Viro 2017-06-29 114 } d597580d373774 Al Viro 2017-03-20 115 if (unlikely(res)) d597580d373774 Al Viro 2017-03-20 116 memset(to + (n - res), 0, res); d597580d373774 Al Viro 2017-03-20 117 return res; d597580d373774 Al Viro 2017-03-20 118 } d597580d373774 Al Viro 2017-03-20 119 #else d597580d373774 Al Viro 2017-03-20 120 extern unsigned long d597580d373774 Al Viro 2017-03-20 121 _copy_from_user(void *, const void __user *, unsigned long); d597580d373774 Al Viro 2017-03-20 122 #endif d597580d373774 Al Viro 2017-03-20 123 :::::: The code at line 112 was first introduced by commit :::::: 9c5f6908de03a4f52ba7364b11fcd6116225480c copy_{from,to}_user(): move kasan checks and might_fault() out-of-line :::::: TO: Al Viro <viro(a)zeniv.linux.org.uk> :::::: CC: Al Viro <viro(a)zeniv.linux.org.uk> -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
1 0
0 0
[openeuler:openEuler-1.0-LTS 8359/23714] fs/gfs2/bmap.c:960:31: warning: 'lblock' may be used uninitialized
by kernel test robot 16 Sep '24

16 Sep '24
tree: https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS head: 37aeb7e817053fbf532b214aa02858b3c23af0b1 commit: 484798bc8218ce6a0f8269675897b870a12c49e2 [8359/23714] gfs2: gfs2_walk_metadata fix config: x86_64-buildonly-randconfig-006-20240915 (https://download.01.org/0day-ci/archive/20240916/202409161757.QAy2sdT1-lkp@…) compiler: gcc-12 (Debian 12.2.0-14) 12.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240916/202409161757.QAy2sdT1-lkp@…) 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(a)intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202409161757.QAy2sdT1-lkp@intel.com/ Note: it may well be a FALSE warning. FWIW you are at least aware of it now. http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings All warnings (new ones prefixed by >>): fs/gfs2/bmap.c: In function 'gfs2_iomap_alloc': fs/gfs2/bmap.c:748:28: warning: this statement may fall through [-Wimplicit-fallthrough=] 748 | if (n == 0) | ^ fs/gfs2/bmap.c:751:17: note: here 751 | case ALLOC_GROW_DEPTH: | ^~~~ fs/gfs2/bmap.c:759:28: warning: this statement may fall through [-Wimplicit-fallthrough=] 759 | if (n == 0) | ^ fs/gfs2/bmap.c:762:17: note: here 762 | case ALLOC_DATA: | ^~~~ fs/gfs2/bmap.c: In function 'gfs2_iomap_get': >> fs/gfs2/bmap.c:960:31: warning: 'lblock' may be used uninitialized [-Wmaybe-uninitialized] 960 | ret = gfs2_hole_size(inode, lblock, len, mp, iomap); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fs/gfs2/bmap.c:851:18: note: 'lblock' was declared here 851 | sector_t lblock; | ^~~~~~ fs/gfs2/bmap.c:960:31: warning: 'len' may be used uninitialized [-Wmaybe-uninitialized] 960 | ret = gfs2_hole_size(inode, lblock, len, mp, iomap); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fs/gfs2/bmap.c:855:13: note: 'len' was declared here 855 | u64 len; | ^~~ fs/gfs2/bmap.c:959:32: warning: 'height' may be used uninitialized [-Wmaybe-uninitialized] 959 | if (pos < size && height == ip->i_height) | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ fs/gfs2/bmap.c:857:12: note: 'height' was declared here 857 | u8 height; | ^~~~~~ fs/gfs2/bmap.c:1290: warning: Function parameter or member 'inode' not described in 'gfs2_block_zero_range' fs/gfs2/bmap.c:1290: warning: Function parameter or member 'from' not described in 'gfs2_block_zero_range' fs/gfs2/bmap.c:1290: warning: Function parameter or member 'length' not described in 'gfs2_block_zero_range' fs/gfs2/bmap.c:1493: warning: Function parameter or member 'rd_gh' not described in 'sweep_bh_for_rgrps' fs/gfs2/bmap.c:1493: warning: Excess function parameter 'rg_gh' description in 'sweep_bh_for_rgrps' fs/gfs2/bmap.c:1661: warning: Function parameter or member 'sdp' not described in 'find_nonnull_ptr' fs/gfs2/bmap.c:1661: warning: Function parameter or member 'end_list' not described in 'find_nonnull_ptr' fs/gfs2/bmap.c:1661: warning: Function parameter or member 'end_aligned' not described in 'find_nonnull_ptr' vim +/lblock +960 fs/gfs2/bmap.c 7ee66c03e40a57 Christoph Hellwig 2018-06-01 831 3974320ca6aa68 Bob Peterson 2017-02-16 832 /** 628e366df11c0a Andreas Gruenbacher 2018-06-04 833 * gfs2_iomap_get - Map blocks from an inode to disk blocks 3974320ca6aa68 Bob Peterson 2017-02-16 834 * @inode: The inode 3974320ca6aa68 Bob Peterson 2017-02-16 835 * @pos: Starting position in bytes 3974320ca6aa68 Bob Peterson 2017-02-16 836 * @length: Length to map, in bytes 3974320ca6aa68 Bob Peterson 2017-02-16 837 * @flags: iomap flags 3974320ca6aa68 Bob Peterson 2017-02-16 838 * @iomap: The iomap structure 628e366df11c0a Andreas Gruenbacher 2018-06-04 839 * @mp: The metapath 3974320ca6aa68 Bob Peterson 2017-02-16 840 * 3974320ca6aa68 Bob Peterson 2017-02-16 841 * Returns: errno 3974320ca6aa68 Bob Peterson 2017-02-16 842 */ 628e366df11c0a Andreas Gruenbacher 2018-06-04 843 static int gfs2_iomap_get(struct inode *inode, loff_t pos, loff_t length, 628e366df11c0a Andreas Gruenbacher 2018-06-04 844 unsigned flags, struct iomap *iomap, 628e366df11c0a Andreas Gruenbacher 2018-06-04 845 struct metapath *mp) b3b94faa5fe596 David Teigland 2006-01-16 846 { feaa7bba026c18 Steven Whitehouse 2006-06-14 847 struct gfs2_inode *ip = GFS2_I(inode); feaa7bba026c18 Steven Whitehouse 2006-06-14 848 struct gfs2_sbd *sdp = GFS2_SB(inode); d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 849 loff_t size = i_size_read(inode); 9b8c81d1de4994 Steven Whitehouse 2008-02-22 850 __be64 *ptr; 3974320ca6aa68 Bob Peterson 2017-02-16 851 sector_t lblock; 628e366df11c0a Andreas Gruenbacher 2018-06-04 852 sector_t lblock_stop; 628e366df11c0a Andreas Gruenbacher 2018-06-04 853 int ret; 9b8c81d1de4994 Steven Whitehouse 2008-02-22 854 int eob; 628e366df11c0a Andreas Gruenbacher 2018-06-04 855 u64 len; d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 856 struct buffer_head *dibh = NULL, *bh; 9b8c81d1de4994 Steven Whitehouse 2008-02-22 857 u8 height; 7276b3b0c77101 Steven Whitehouse 2006-09-21 858 628e366df11c0a Andreas Gruenbacher 2018-06-04 859 if (!length) 628e366df11c0a Andreas Gruenbacher 2018-06-04 860 return -EINVAL; b3b94faa5fe596 David Teigland 2006-01-16 861 d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 862 down_read(&ip->i_rw_mutex); d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 863 d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 864 ret = gfs2_meta_inode_buffer(ip, &dibh); d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 865 if (ret) d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 866 goto unlock; 38084377af4fc8 Andreas Gruenbacher 2018-11-11 867 mp->mp_bh[0] = dibh; d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 868 49edd5bf429c40 Andreas Gruenbacher 2018-02-06 869 if (gfs2_is_stuffed(ip)) { d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 870 if (flags & IOMAP_WRITE) { d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 871 loff_t max_size = gfs2_max_stuffed_size(ip); d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 872 d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 873 if (pos + length > max_size) d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 874 goto unstuff; d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 875 iomap->length = max_size; d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 876 } else { d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 877 if (pos >= size) { 49edd5bf429c40 Andreas Gruenbacher 2018-02-06 878 if (flags & IOMAP_REPORT) { d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 879 ret = -ENOENT; d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 880 goto unlock; d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 881 } else { d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 882 /* report a hole */ d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 883 iomap->offset = pos; d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 884 iomap->length = length; d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 885 goto do_alloc; d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 886 } 3974320ca6aa68 Bob Peterson 2017-02-16 887 } d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 888 iomap->length = size; 49edd5bf429c40 Andreas Gruenbacher 2018-02-06 889 } d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 890 iomap->addr = (ip->i_no_addr << inode->i_blkbits) + d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 891 sizeof(struct gfs2_dinode); d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 892 iomap->type = IOMAP_INLINE; 64bc06bb32ee9c Andreas Gruenbacher 2018-06-24 893 iomap->inline_data = dibh->b_data + sizeof(struct gfs2_dinode); d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 894 goto out; d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 895 } d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 896 d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 897 unstuff: 3974320ca6aa68 Bob Peterson 2017-02-16 898 lblock = pos >> inode->i_blkbits; 3974320ca6aa68 Bob Peterson 2017-02-16 899 iomap->offset = lblock << inode->i_blkbits; 628e366df11c0a Andreas Gruenbacher 2018-06-04 900 lblock_stop = (pos + length - 1) >> inode->i_blkbits; 628e366df11c0a Andreas Gruenbacher 2018-06-04 901 len = lblock_stop - lblock + 1; d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 902 iomap->length = len << inode->i_blkbits; 20cdc1931ee8e0 Andreas Gruenbacher 2017-09-22 903 9b8c81d1de4994 Steven Whitehouse 2008-02-22 904 height = ip->i_height; 9a38662ba4e268 Andreas Gruenbacher 2018-04-16 905 while ((lblock + 1) * sdp->sd_sb.sb_bsize > sdp->sd_heightsize[height]) ecc30c79157103 Steven Whitehouse 2008-01-28 906 height++; 628e366df11c0a Andreas Gruenbacher 2018-06-04 907 find_metapath(sdp, lblock, mp, height); 9b8c81d1de4994 Steven Whitehouse 2008-02-22 908 if (height > ip->i_height || gfs2_is_stuffed(ip)) 9b8c81d1de4994 Steven Whitehouse 2008-02-22 909 goto do_alloc; 3974320ca6aa68 Bob Peterson 2017-02-16 910 628e366df11c0a Andreas Gruenbacher 2018-06-04 911 ret = lookup_metapath(ip, mp); e8b43fe0c1e035 Andreas Gruenbacher 2017-12-08 912 if (ret) 628e366df11c0a Andreas Gruenbacher 2018-06-04 913 goto unlock; 3974320ca6aa68 Bob Peterson 2017-02-16 914 628e366df11c0a Andreas Gruenbacher 2018-06-04 915 if (mp->mp_aheight != ip->i_height) 9b8c81d1de4994 Steven Whitehouse 2008-02-22 916 goto do_alloc; 3974320ca6aa68 Bob Peterson 2017-02-16 917 628e366df11c0a Andreas Gruenbacher 2018-06-04 918 ptr = metapointer(ip->i_height - 1, mp); 9b8c81d1de4994 Steven Whitehouse 2008-02-22 919 if (*ptr == 0) 9b8c81d1de4994 Steven Whitehouse 2008-02-22 920 goto do_alloc; 3974320ca6aa68 Bob Peterson 2017-02-16 921 628e366df11c0a Andreas Gruenbacher 2018-06-04 922 bh = mp->mp_bh[ip->i_height - 1]; bcfe94139a45fa Andreas Gruenbacher 2018-05-11 923 len = gfs2_extent_length(bh, ptr, len, &eob); 3974320ca6aa68 Bob Peterson 2017-02-16 924 628e366df11c0a Andreas Gruenbacher 2018-06-04 925 iomap->addr = be64_to_cpu(*ptr) << inode->i_blkbits; 628e366df11c0a Andreas Gruenbacher 2018-06-04 926 iomap->length = len << inode->i_blkbits; 628e366df11c0a Andreas Gruenbacher 2018-06-04 927 iomap->type = IOMAP_MAPPED; 0ed91eca1130e6 Andreas Gruenbacher 2018-07-25 928 iomap->flags |= IOMAP_F_MERGED; 9b8c81d1de4994 Steven Whitehouse 2008-02-22 929 if (eob) 7ee66c03e40a57 Christoph Hellwig 2018-06-01 930 iomap->flags |= IOMAP_F_GFS2_BOUNDARY; 3974320ca6aa68 Bob Peterson 2017-02-16 931 3974320ca6aa68 Bob Peterson 2017-02-16 932 out: 628e366df11c0a Andreas Gruenbacher 2018-06-04 933 iomap->bdev = inode->i_sb->s_bdev; 628e366df11c0a Andreas Gruenbacher 2018-06-04 934 unlock: 628e366df11c0a Andreas Gruenbacher 2018-06-04 935 up_read(&ip->i_rw_mutex); 9b8c81d1de4994 Steven Whitehouse 2008-02-22 936 return ret; 9b8c81d1de4994 Steven Whitehouse 2008-02-22 937 9b8c81d1de4994 Steven Whitehouse 2008-02-22 938 do_alloc: 628e366df11c0a Andreas Gruenbacher 2018-06-04 939 iomap->addr = IOMAP_NULL_ADDR; 628e366df11c0a Andreas Gruenbacher 2018-06-04 940 iomap->type = IOMAP_HOLE; 628e366df11c0a Andreas Gruenbacher 2018-06-04 941 if (flags & IOMAP_REPORT) { 49edd5bf429c40 Andreas Gruenbacher 2018-02-06 942 if (pos >= size) 3974320ca6aa68 Bob Peterson 2017-02-16 943 ret = -ENOENT; 628e366df11c0a Andreas Gruenbacher 2018-06-04 944 else if (height == ip->i_height) 628e366df11c0a Andreas Gruenbacher 2018-06-04 945 ret = gfs2_hole_size(inode, lblock, len, mp, iomap); 49edd5bf429c40 Andreas Gruenbacher 2018-02-06 946 else 49edd5bf429c40 Andreas Gruenbacher 2018-02-06 947 iomap->length = size - pos; 64bc06bb32ee9c Andreas Gruenbacher 2018-06-24 948 } else if (flags & IOMAP_WRITE) { 64bc06bb32ee9c Andreas Gruenbacher 2018-06-24 949 u64 alloc_size; 64bc06bb32ee9c Andreas Gruenbacher 2018-06-24 950 967bcc91b04493 Andreas Gruenbacher 2018-06-19 951 if (flags & IOMAP_DIRECT) 967bcc91b04493 Andreas Gruenbacher 2018-06-19 952 goto out; /* (see gfs2_file_direct_write) */ 967bcc91b04493 Andreas Gruenbacher 2018-06-19 953 64bc06bb32ee9c Andreas Gruenbacher 2018-06-24 954 len = gfs2_alloc_size(inode, mp, len); 64bc06bb32ee9c Andreas Gruenbacher 2018-06-24 955 alloc_size = len << inode->i_blkbits; 64bc06bb32ee9c Andreas Gruenbacher 2018-06-24 956 if (alloc_size < iomap->length) 64bc06bb32ee9c Andreas Gruenbacher 2018-06-24 957 iomap->length = alloc_size; 64bc06bb32ee9c Andreas Gruenbacher 2018-06-24 958 } else { d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 959 if (pos < size && height == ip->i_height) d505a96a3b16f4 Andreas Gruenbacher 2018-06-24 @960 ret = gfs2_hole_size(inode, lblock, len, mp, iomap); 3974320ca6aa68 Bob Peterson 2017-02-16 961 } 628e366df11c0a Andreas Gruenbacher 2018-06-04 962 goto out; 628e366df11c0a Andreas Gruenbacher 2018-06-04 963 } 628e366df11c0a Andreas Gruenbacher 2018-06-04 964 :::::: The code at line 960 was first introduced by commit :::::: d505a96a3b16f46455035dc0296bc2da6014e163 gfs2: Further iomap cleanups :::::: TO: Andreas Gruenbacher <agruenba(a)redhat.com> :::::: CC: Andreas Gruenbacher <agruenba(a)redhat.com> -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
1 0
0 0
[openeuler:openEuler-1.0-LTS 16489/23714] drivers/md/bcache/acache.c:29:5: sparse: sparse: symbol 'acache_prefetch_workers' was not declared. Should it be static?
by kernel test robot 16 Sep '24

16 Sep '24
tree: https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS head: 37aeb7e817053fbf532b214aa02858b3c23af0b1 commit: 1c09f1b02db96b8277226cbe64fe5bbd185a7149 [16489/23714] bcache: add a framework to perform prefetch config: x86_64-randconfig-123-20240915 (https://download.01.org/0day-ci/archive/20240916/202409161647.o9SQbpWe-lkp@…) compiler: gcc-12 (Debian 12.2.0-14) 12.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240916/202409161647.o9SQbpWe-lkp@…) 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(a)intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202409161647.o9SQbpWe-lkp@intel.com/ sparse warnings: (new ones prefixed by >>) >> drivers/md/bcache/acache.c:29:5: sparse: sparse: symbol 'acache_prefetch_workers' was not declared. Should it be static? >> drivers/md/bcache/acache.c:65:5: sparse: sparse: symbol 'acache_open' was not declared. Should it be static? >> drivers/md/bcache/acache.c:83:5: sparse: sparse: symbol 'acache_release' was not declared. Should it be static? >> drivers/md/bcache/acache.c:89:9: sparse: sparse: symbol 'read_circ_slice' was not declared. Should it be static? >> drivers/md/bcache/acache.c:224:6: sparse: sparse: symbol 'init_acache_circ' was not declared. Should it be static? >> drivers/md/bcache/acache.c:253:5: sparse: sparse: symbol 'acache_prefetch_init' was not declared. Should it be static? >> drivers/md/bcache/acache.c:401:19: sparse: sparse: symbol 'get_cached_device_by_dev' was not declared. Should it be static? >> drivers/md/bcache/acache.c:414:12: sparse: sparse: symbol 'get_bio_by_item' was not declared. Should it be static? drivers/md/bcache/acache.c:65:5: warning: no previous prototype for 'acache_open' [-Wmissing-prototypes] 65 | int acache_open(struct inode *inode, struct file *filp) | ^~~~~~~~~~~ drivers/md/bcache/acache.c:83:5: warning: no previous prototype for 'acache_release' [-Wmissing-prototypes] 83 | int acache_release(struct inode *inode, struct file *filp) | ^~~~~~~~~~~~~~ drivers/md/bcache/acache.c:89:9: warning: no previous prototype for 'read_circ_slice' [-Wmissing-prototypes] 89 | ssize_t read_circ_slice(struct acache_circ *circ, struct acache_info *buf, | ^~~~~~~~~~~~~~~ drivers/md/bcache/acache.c:224:6: warning: no previous prototype for 'init_acache_circ' [-Wmissing-prototypes] 224 | void init_acache_circ(struct acache_circ **circ, void *startaddr) | ^~~~~~~~~~~~~~~~ drivers/md/bcache/acache.c:253:5: warning: no previous prototype for 'acache_prefetch_init' [-Wmissing-prototypes] 253 | int acache_prefetch_init(struct acache_device *adev) | ^~~~~~~~~~~~~~~~~~~~ drivers/md/bcache/acache.c:401:20: warning: no previous prototype for 'get_cached_device_by_dev' [-Wmissing-prototypes] 401 | struct cached_dev *get_cached_device_by_dev(dev_t dev) | ^~~~~~~~~~~~~~~~~~~~~~~~ drivers/md/bcache/acache.c:414:13: warning: no previous prototype for 'get_bio_by_item' [-Wmissing-prototypes] 414 | struct bio *get_bio_by_item(struct cached_dev *dc, struct acache_info *item) | ^~~~~~~~~~~~~~~ vim +/acache_prefetch_workers +29 drivers/md/bcache/acache.c 28 > 29 int acache_prefetch_workers = 1000; 30 31 module_param_named(prefetch_workers, acache_prefetch_workers, int, 0444); 32 MODULE_PARM_DESC(prefetch_workers, "num of workers for processing prefetch requests"); 33 34 struct prefetch_worker { 35 struct acache_info s; 36 struct work_struct work; 37 struct list_head list; 38 }; 39 40 struct acache_device { 41 bool initialized; 42 43 dev_t devno; 44 struct cdev cdev; 45 struct class *class; 46 struct mem_reg *mem_regionp; 47 48 struct acache_info *readbuf; 49 struct acache_info *writebuf; 50 51 struct acache_circ *acache_info_circ; 52 53 struct workqueue_struct *wq; 54 struct prefetch_worker *prefetch_workers; 55 struct list_head prefetch_workers_free; 56 spinlock_t prefetch_workers_free_list_lock; 57 } adev; 58 59 #define MAX_TRANSFER_SIZE (1024 * 1024) 60 61 static atomic_t acache_opened_dev = ATOMIC_INIT(0); 62 static struct acache_metadata metadata; 63 64 > 65 int acache_open(struct inode *inode, struct file *filp) 66 { 67 struct mem_reg *dev; 68 69 int minor = MINOR(inode->i_rdev); 70 71 if (minor >= ACACHE_NR_DEVS) 72 return -ENODEV; 73 if (atomic_xchg(&acache_opened_dev, 1)) 74 return -EPERM; 75 76 dev = &adev.mem_regionp[minor]; 77 78 filp->private_data = dev; 79 80 return 0; 81 } 82 > 83 int acache_release(struct inode *inode, struct file *filp) 84 { 85 atomic_dec(&acache_opened_dev); 86 return 0; 87 } 88 > 89 ssize_t read_circ_slice(struct acache_circ *circ, struct acache_info *buf, 90 size_t size) 91 { 92 unsigned long first, todo, flags; 93 94 spin_lock_irqsave(&circ->lock, flags); 95 96 todo = CIRC_CNT(circ->head, circ->tail, circ->size); 97 if (todo == 0) { 98 spin_unlock_irqrestore(&circ->lock, flags); 99 return 0; 100 } 101 if (todo > size / sizeof(struct acache_info)) 102 todo = size / sizeof(struct acache_info); 103 104 first = CIRC_CNT_TO_END(circ->head, circ->tail, circ->size); 105 if (first > todo) 106 first = todo; 107 108 memcpy(buf, circ->data + circ->tail, first * sizeof(struct acache_info)); 109 if (first < todo) 110 memcpy(buf + first, circ->data, 111 (todo - first) * sizeof(struct acache_info)); 112 circ->tail = (circ->tail + todo) & (circ->size - 1); 113 114 spin_unlock_irqrestore(&circ->lock, flags); 115 return todo * sizeof(struct acache_info); 116 } 117 118 static ssize_t acache_read(struct file *filp, char __user *buf, 119 size_t size, loff_t *ppos) 120 { 121 long ret, cut; 122 123 if (metadata.conntype != ACACHE_READWRITE_CONN) 124 return -EINVAL; 125 126 if (size > MAX_TRANSFER_SIZE) 127 size = MAX_TRANSFER_SIZE; 128 129 ret = read_circ_slice(adev.acache_info_circ, adev.readbuf, size); 130 if (ret <= 0) 131 return ret; 132 133 cut = copy_to_user(buf, adev.readbuf, size); 134 return ret - cut; 135 } 136 137 int process_one_request(struct acache_info *item); 138 static void prefetch_worker_func(struct work_struct *work) 139 { 140 struct prefetch_worker *sw = 141 container_of(work, struct prefetch_worker, work); 142 143 process_one_request(&sw->s); 144 spin_lock(&adev.prefetch_workers_free_list_lock); 145 list_add_tail(&sw->list, &adev.prefetch_workers_free); 146 spin_unlock(&adev.prefetch_workers_free_list_lock); 147 } 148 149 static int queue_prefetch_item(struct acache_info *s) 150 { 151 struct prefetch_worker *sw; 152 153 spin_lock(&adev.prefetch_workers_free_list_lock); 154 sw = list_first_entry_or_null(&adev.prefetch_workers_free, 155 struct prefetch_worker, list); 156 if (!sw) { 157 spin_unlock(&adev.prefetch_workers_free_list_lock); 158 return -1; 159 } 160 list_del_init(&sw->list); 161 spin_unlock(&adev.prefetch_workers_free_list_lock); 162 163 memcpy(&sw->s, s, sizeof(struct acache_info)); 164 INIT_WORK(&sw->work, prefetch_worker_func); 165 queue_work(adev.wq, &sw->work); 166 return 0; 167 } 168 169 static ssize_t acache_write(struct file *filp, const char __user *buf, 170 size_t size, loff_t *ppos) 171 { 172 long cut; 173 int i; 174 175 if (metadata.conntype != ACACHE_READWRITE_CONN) 176 return -EINVAL; 177 178 if (size > MAX_TRANSFER_SIZE) 179 size = MAX_TRANSFER_SIZE; 180 181 cut = copy_from_user(adev.writebuf, buf, size); 182 for (i = 0; i < (size - cut) / sizeof(struct acache_info); i++) { 183 if (queue_prefetch_item(adev.writebuf + i)) 184 break; 185 } 186 return i * sizeof(struct acache_info); 187 } 188 189 static long acache_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) 190 { 191 switch (cmd) { 192 case ACACHE_GET_METADATA: 193 return copy_to_user((struct acache_metadata __user *)arg, 194 &metadata, sizeof(struct acache_metadata)); 195 default: 196 return -EINVAL; 197 } 198 } 199 200 static const struct file_operations acache_fops = { 201 .owner = THIS_MODULE, 202 .read = acache_read, 203 .write = acache_write, 204 .open = acache_open, 205 .release = acache_release, 206 .unlocked_ioctl = acache_ioctl, 207 }; 208 209 void save_circ_item(struct acache_info *data) 210 { 211 unsigned long flags; 212 struct acache_circ *circ = adev.acache_info_circ; 213 214 spin_lock_irqsave(&circ->lock, flags); 215 if (CIRC_SPACE(circ->head, circ->tail, circ->size) >= 1) { 216 memcpy(&circ->data[circ->head], data, sizeof(struct acache_info)); 217 circ->head = (circ->head + 1) & (circ->size - 1); 218 } else { 219 pr_debug("ringbuffer is full; discard new request."); 220 } 221 spin_unlock_irqrestore(&circ->lock, flags); 222 } 223 > 224 void init_acache_circ(struct acache_circ **circ, void *startaddr) 225 { 226 *circ = (struct acache_circ *)startaddr; 227 (*circ)->head = 0; 228 (*circ)->tail = 0; 229 (*circ)->size = ACACHE_CIRC_SIZE; 230 spin_lock_init(&(*circ)->lock); 231 } 232 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 671
  • 672
  • 673
  • 674
  • 675
  • 676
  • 677
  • ...
  • 1937
  • Older →

HyperKitty Powered by HyperKitty