From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 164F5E7B5E2 for ; Wed, 4 Oct 2023 09:49:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5B3466B0295; Wed, 4 Oct 2023 05:49:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 563666B0296; Wed, 4 Oct 2023 05:49:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 42B686B0297; Wed, 4 Oct 2023 05:49:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 2FAEF6B0295 for ; Wed, 4 Oct 2023 05:49:39 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id ED7FFC016C for ; Wed, 4 Oct 2023 09:49:38 +0000 (UTC) X-FDA: 81307306836.08.A68D2C9 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.65]) by imf07.hostedemail.com (Postfix) with ESMTP id 67DE940019 for ; Wed, 4 Oct 2023 09:49:36 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=XzyDjAyI; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf07.hostedemail.com: domain of lkp@intel.com designates 134.134.136.65 as permitted sender) smtp.mailfrom=lkp@intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1696412977; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=GCaJqnpo8WNW+S1KojnONLqREeydi+aAZU/4hyLRork=; b=QQrMtN3qy0dP0ckxGV4N4RoIVkYhEGpZPUH9ttpYtbZjE+MUyFcJMfiXgAVAzF+0wnSGIm DljHu2S3tCt5pghBPrtoSctEt6Th07wkLDn22XAu0rFzN5xwWDE07ltzdaNd4Sk7w7pFgF l4lddNUJvTrBUOs1otERBuOVAU+2bxo= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=XzyDjAyI; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf07.hostedemail.com: domain of lkp@intel.com designates 134.134.136.65 as permitted sender) smtp.mailfrom=lkp@intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1696412977; a=rsa-sha256; cv=none; b=vD4O+kqClkulNC9tPFpy62Xs0KWL23rIk/qPIhum2h+LiYMGlhEoKViAoblX5G5fp8Pd8Z bpgAdi9Got2yNA1XM8u7c28J+njfVPu13qIQ8tHYixPNWsLaNYRUxVpgVNKeHcdAtkn0ci 3XUMihyLCElhJRDaEpLIb8jU+xhxGX0= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696412976; x=1727948976; h=date:from:to:cc:subject:message-id:mime-version; bh=bTGmVaCbGUtsRlMooejy1mL6MHh5lsNVSpno5c9lUJU=; b=XzyDjAyIhxNQFwrNwmadQq41hHOSAp7/I+AYrp3jgGE5WurB3NRP5IkV SiLQwWdUvrMFP1piaen2ufc3nEAxJvNBIYm3e/qyu8hNdU+MvWNo1LpHU 0nKaA3TuzDFcIvV+Et9coTRMrckugkw53dHca5eAmogxWfu9PGCAVJRDN PZcyEYSfHLk9oahf9J0ELTBC63yfftupsCPqXUGwS7Wu4XsIMfDKnzPn8 gt5b/0Sv/z/Em1lU/hAr6BrxCr65cf889kJT9ksRECuzatdaJKw72eZAh CzJQq3cdLFCUCvi47ZpXfz2ZBEWcD12LbArdZZgzkqOSqL0vodHsrS7Yg Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10852"; a="386985556" X-IronPort-AV: E=Sophos;i="6.03,199,1694761200"; d="scan'208";a="386985556" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Oct 2023 02:48:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10852"; a="701031860" X-IronPort-AV: E=Sophos;i="6.03,199,1694761200"; d="scan'208";a="701031860" Received: from lkp-server02.sh.intel.com (HELO c3b01524d57c) ([10.239.97.151]) by orsmga003.jf.intel.com with ESMTP; 04 Oct 2023 02:48:08 -0700 Received: from kbuild by c3b01524d57c with local (Exim 4.96) (envelope-from ) id 1qnyU9-000GUU-2E; Wed, 04 Oct 2023 09:48:05 +0000 Date: Wed, 4 Oct 2023 17:47:56 +0800 From: kernel test robot To: Christian Brauner Cc: oe-kbuild-all@lists.linux.dev, Linux Memory Management List Subject: [linux-next:master 8396/9381] fs/file.c:875:22: sparse: sparse: incorrect type in assignment (different address spaces) Message-ID: <202310041744.d34gIv9V-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Rspam-User: X-Stat-Signature: dfhkh4a8nufwt5yew75r4hd1k8xqmy38 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 67DE940019 X-HE-Tag: 1696412976-972973 X-HE-Meta: U2FsdGVkX19g78yMeTJtR8UuDjVgEeGTUL9xT88ktly5nCm3gY8p+0pReWg5hrmGY0pqVBsqxH6sH/WzLlql5XoM2YZuelpm0Uzi+4goRHmj8jSN/nzLovVkzcTiS3RYHsRWcqUALlqOIq8+0igVKbWN+QcVSx5hH1+QQOvo7Or5H/QqHOZpYmMvB4yH6wf6V+0U8J2A3nK0wqnnagfJS+7dTF4Q8oEzwR4sECcIIE+Ja4R/oA8/Uasz4CGm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icity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: 33b64befb1a28bca3f5a9ed9807d2f87e976c63a commit: af66b51563ad7e625602809a0f4c45154df063d1 [8396/9381] file: convert to SLAB_TYPESAFE_BY_RCU config: i386-randconfig-061-20231004 (https://download.01.org/0day-ci/archive/20231004/202310041744.d34gIv9V-lkp@intel.com/config) 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/20231004/202310041744.d34gIv9V-lkp@intel.com/reproduce) 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 | Closes: https://lore.kernel.org/oe-kbuild-all/202310041744.d34gIv9V-lkp@intel.com/ sparse warnings: (new ones prefixed by >>) fs/file.c:379:17: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct file **old_fds @@ got struct file [noderef] __rcu **fd @@ fs/file.c:379:17: sparse: expected struct file **old_fds fs/file.c:379:17: sparse: got struct file [noderef] __rcu **fd fs/file.c:380:17: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct file **new_fds @@ got struct file [noderef] __rcu **fd @@ fs/file.c:380:17: sparse: expected struct file **new_fds fs/file.c:380:17: sparse: got struct file [noderef] __rcu **fd fs/file.c:395:17: sparse: sparse: incompatible types in comparison expression (different address spaces): fs/file.c:395:17: sparse: struct file [noderef] __rcu * fs/file.c:395:17: sparse: struct file * fs/file.c:430:54: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct file *file @@ got struct file [noderef] __rcu *[assigned] __ret @@ fs/file.c:470:28: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct fdtable [noderef] __rcu *fdt @@ got struct fdtable * @@ fs/file.c:646:14: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct file *file @@ got struct file [noderef] __rcu * @@ fs/file.c:841:30: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct file *file @@ got struct file [noderef] __rcu * @@ >> fs/file.c:875:22: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct file [noderef] __rcu *file @@ got struct file * @@ >> fs/file.c:879:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct atomic_t [usertype] *v @@ got struct atomic_t [noderef] __rcu * @@ >> fs/file.c:882:31: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct file [noderef] __rcu *file_reloaded @@ got struct file * @@ >> fs/file.c:906:32: sparse: sparse: incorrect type in return expression (different address spaces) @@ expected struct file * @@ got struct file [noderef] __rcu *file_reloaded @@ >> fs/file.c:908:22: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct file * @@ got struct file [noderef] __rcu *file @@ fs/file.c:1200:16: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct file *tofree @@ got struct file [noderef] __rcu * @@ vim +875 fs/file.c 855 856 /** 857 * get_file_rcu - try go get a reference to a file under rcu 858 * @f: the file to get a reference on 859 * 860 * This function tries to get a reference on @f carefully verifying that 861 * @f hasn't been reused. 862 * 863 * This function should rarely have to be used and only by users who 864 * understand the implications of SLAB_TYPESAFE_BY_RCU. Try to avoid it. 865 * 866 * Return: Returns @f with the reference count increased or NULL. 867 */ 868 struct file *get_file_rcu(struct file __rcu **f) 869 { 870 for (;;) { 871 struct file __rcu *file; 872 struct file __rcu *file_reloaded; 873 struct file __rcu *file_reloaded_cmp; 874 > 875 file = rcu_dereference_raw(*f); 876 if (!file) 877 return NULL; 878 > 879 if (unlikely(!atomic_long_inc_not_zero(&file->f_count))) 880 continue; 881 > 882 file_reloaded = rcu_dereference_raw(*f); 883 884 /* 885 * Ensure that all accesses have a dependency on the 886 * load from rcu_dereference_raw() above so we get 887 * correct ordering between reuse/allocation and the 888 * pointer check below. 889 */ 890 file_reloaded_cmp = file_reloaded; 891 OPTIMIZER_HIDE_VAR(file_reloaded_cmp); 892 893 /* 894 * atomic_long_inc_not_zero() above provided a full 895 * memory barrier when we acquired a reference. 896 * 897 * This is paired with the write barrier from assigning 898 * to the __rcu protected file pointer so that if that 899 * pointer still matches the current file, we know we 900 * have successfully acquire a reference to it. 901 * 902 * If the pointers don't match the file has been 903 * reallocated by SLAB_TYPESAFE_BY_RCU. 904 */ 905 if (file == file_reloaded_cmp) > 906 return file_reloaded; 907 > 908 fput(file); 909 } 910 } 911 EXPORT_SYMBOL_GPL(get_file_rcu); 912 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki