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 C0087C433EF for ; Wed, 29 Jun 2022 12:52:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D8A0A8E0005; Wed, 29 Jun 2022 08:52:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D3D4F8E0001; Wed, 29 Jun 2022 08:52:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C02488E0005; Wed, 29 Jun 2022 08:52:04 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id B156E8E0001 for ; Wed, 29 Jun 2022 08:52:04 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 833A820423 for ; Wed, 29 Jun 2022 12:52:04 +0000 (UTC) X-FDA: 79631260968.13.6E477D9 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by imf20.hostedemail.com (Postfix) with ESMTP id 185061C0042 for ; Wed, 29 Jun 2022 12:52:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656507123; x=1688043123; h=date:from:to:cc:subject:message-id:mime-version; bh=h6PbEfDTnkL6KzcdsVXQeeqDDYbbgwouE/z8EQ3uyn8=; b=GXKjkGXR1YIzr5+f1vSjQPqN+IG8d+RkZVdQBq4aM25HUEa2fFsurIPi 85Fb8WWSW9FYdrqy4l2jdQRencVZa7HAi8t3BqqrPoon4EZiUsmZzXl4j 7XJ+NrdicFmD5c7ew3Q4YcpO8Urxbkj4wzdYpKItzH8VyMBGiWykb5tb8 dXZmPxvD5WJ4ElaL9nSrEI44EzyXeUpKqzpEgQ0sXHAIgkZWK3NVOcnFW eO4vRXn7x6hhLR/9aCGU2M3vbtTKla8yU/bDrc6QCTU6eWLisHFng7DR2 tuvRRQw62ZePClO63lqv+pxWD6G6JRhIWMKuM5w8RCRvRh/yaoA/nqHnX A==; X-IronPort-AV: E=McAfee;i="6400,9594,10392"; a="265060452" X-IronPort-AV: E=Sophos;i="5.92,231,1650956400"; d="scan'208";a="265060452" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jun 2022 05:52:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,231,1650956400"; d="scan'208";a="658541591" Received: from lkp-server01.sh.intel.com (HELO 68b931ab7ac1) ([10.239.97.150]) by fmsmga004.fm.intel.com with ESMTP; 29 Jun 2022 05:51:59 -0700 Received: from kbuild by 68b931ab7ac1 with local (Exim 4.95) (envelope-from ) id 1o6XAk-000BDi-Lo; Wed, 29 Jun 2022 12:51:58 +0000 Date: Wed, 29 Jun 2022 20:51:21 +0800 From: kernel test robot To: Konstantin Komarov Cc: kbuild-all@lists.01.org, Linux Memory Management List Subject: [linux-next:master 5968/6619] fs/ntfs3/attrib.c:2145:38: sparse: sparse: restricted __le16 degrades to integer Message-ID: <202206292052.LsFui3zO-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656507124; a=rsa-sha256; cv=none; b=dofdIhDtdUmQNF48ZIm7wyopszHbZQzqekwDddPvy0spCbHSNeiElDLoFbubzvnL73nbSz EkHRWJhSmYwPHo1mMGswJOVPrJTkWOGpWisC5rCDknsvF7/PwOszPEd9YqrnvzYUxLKv09 htV4VQogPq1LjsXlMX/SDfPHqYBW6x4= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=GXKjkGXR; spf=none (imf20.hostedemail.com: domain of lkp@intel.com has no SPF policy when checking 134.134.136.126) smtp.mailfrom=lkp@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656507124; 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=FPTDT5C39MvrMPWWLZUiWnijXDFmOM190tVch/uQyWA=; b=GNJgTx8y1Q+KXJReE0L7ZL/1Dit2Qas9gP4bsgNdT0uT7aL56iD8A1QKMhcYkDTA/taFd1 f+/0yu65NLEzFaUV/kiopYbCT7o8zYsDn+N+GuuaaGfGORNes2f2RbHHA+/Ll2Lg3TuLAx oTZr79gA3oA+BrHLYvz7IdO3T0TDg84= X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 185061C0042 X-Rspam-User: X-Stat-Signature: 5jeck47qzdo4iqxih5ystynhcgw4n1go Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=GXKjkGXR; spf=none (imf20.hostedemail.com: domain of lkp@intel.com has no SPF policy when checking 134.134.136.126) smtp.mailfrom=lkp@intel.com; dmarc=pass (policy=none) header.from=intel.com X-HE-Tag: 1656507122-203086 X-Bogosity: Ham, tests=bogofilter, spamicity=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: c4ef528bd006febc7de444d9775b28706d924f78 commit: aa30eccb24e5a66a2cf7f7b34a69c3651d12cc6a [5968/6619] fs/ntfs3: Fallocate (FALLOC_FL_INSERT_RANGE) implementation config: i386-randconfig-s002-20220627 (https://download.01.org/0day-ci/archive/20220629/202206292052.LsFui3zO-lkp@intel.com/config) compiler: gcc-11 (Debian 11.3.0-3) 11.3.0 reproduce: # apt-get install sparse # sparse version: v0.6.4-39-gce1a6720-dirty # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=aa30eccb24e5a66a2cf7f7b34a69c3651d12cc6a git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git git fetch --no-tags linux-next master git checkout aa30eccb24e5a66a2cf7f7b34a69c3651d12cc6a # save the config file mkdir build_dir && cp config build_dir/.config make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=i386 SHELL=/bin/bash fs/ntfs3/ If you fix the issue, kindly add following tag where applicable Reported-by: kernel test robot sparse warnings: (new ones prefixed by >>) >> fs/ntfs3/attrib.c:2145:38: sparse: sparse: restricted __le16 degrades to integer >> fs/ntfs3/attrib.c:2229:34: sparse: sparse: cast to restricted __le64 >> fs/ntfs3/attrib.c:2229:32: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le64 [usertype] data_size @@ got unsigned long long [usertype] @@ fs/ntfs3/attrib.c:2229:32: sparse: expected restricted __le64 [usertype] data_size fs/ntfs3/attrib.c:2229:32: sparse: got unsigned long long [usertype] fs/ntfs3/attrib.c:2230:35: sparse: sparse: cast to restricted __le64 >> fs/ntfs3/attrib.c:2230:33: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le64 [usertype] alloc_size @@ got unsigned long long [usertype] @@ fs/ntfs3/attrib.c:2230:33: sparse: expected restricted __le64 [usertype] alloc_size fs/ntfs3/attrib.c:2230:33: sparse: got unsigned long long [usertype] vim +2145 fs/ntfs3/attrib.c 2084 2085 /* 2086 * attr_insert_range - Insert range (hole) in file. 2087 * Not for normal files. 2088 */ 2089 int attr_insert_range(struct ntfs_inode *ni, u64 vbo, u64 bytes) 2090 { 2091 int err = 0; 2092 struct runs_tree *run = &ni->file.run; 2093 struct ntfs_sb_info *sbi = ni->mi.sbi; 2094 struct ATTRIB *attr = NULL, *attr_b; 2095 struct ATTR_LIST_ENTRY *le, *le_b; 2096 struct mft_inode *mi, *mi_b; 2097 CLST vcn, svcn, evcn1, len, next_svcn; 2098 u64 data_size, alloc_size; 2099 u32 mask; 2100 __le16 a_flags; 2101 2102 if (!bytes) 2103 return 0; 2104 2105 le_b = NULL; 2106 attr_b = ni_find_attr(ni, NULL, &le_b, ATTR_DATA, NULL, 0, NULL, &mi_b); 2107 if (!attr_b) 2108 return -ENOENT; 2109 2110 if (!is_attr_ext(attr_b)) { 2111 /* It was checked above. See fallocate. */ 2112 return -EOPNOTSUPP; 2113 } 2114 2115 if (!attr_b->non_res) { 2116 data_size = le32_to_cpu(attr_b->res.data_size); 2117 mask = sbi->cluster_mask; /* cluster_size - 1 */ 2118 } else { 2119 data_size = le64_to_cpu(attr_b->nres.data_size); 2120 mask = (sbi->cluster_size << attr_b->nres.c_unit) - 1; 2121 } 2122 2123 if (vbo > data_size) { 2124 /* Insert range after the file size is not allowed. */ 2125 return -EINVAL; 2126 } 2127 2128 if ((vbo & mask) || (bytes & mask)) { 2129 /* Allow to insert only frame aligned ranges. */ 2130 return -EINVAL; 2131 } 2132 2133 vcn = vbo >> sbi->cluster_bits; 2134 len = bytes >> sbi->cluster_bits; 2135 2136 down_write(&ni->file.run_lock); 2137 2138 if (!attr_b->non_res) { 2139 err = attr_set_size(ni, ATTR_DATA, NULL, 0, run, 2140 data_size + bytes, NULL, false, &attr); 2141 if (err) 2142 goto out; 2143 if (!attr->non_res) { 2144 /* Still resident. */ > 2145 char *data = Add2Ptr(attr, attr->res.data_off); 2146 2147 memmove(data + bytes, data, bytes); 2148 memset(data, 0, bytes); 2149 err = 0; 2150 goto out; 2151 } 2152 /* Resident files becomes nonresident. */ 2153 le_b = NULL; 2154 attr_b = ni_find_attr(ni, NULL, &le_b, ATTR_DATA, NULL, 0, NULL, 2155 &mi_b); 2156 if (!attr_b) 2157 return -ENOENT; 2158 if (!attr_b->non_res) { 2159 err = -EINVAL; 2160 goto out; 2161 } 2162 data_size = le64_to_cpu(attr_b->nres.data_size); 2163 alloc_size = le64_to_cpu(attr_b->nres.alloc_size); 2164 } 2165 2166 /* 2167 * Enumerate all attribute segments and shift start vcn. 2168 */ 2169 a_flags = attr_b->flags; 2170 svcn = le64_to_cpu(attr_b->nres.svcn); 2171 evcn1 = le64_to_cpu(attr_b->nres.evcn) + 1; 2172 2173 if (svcn <= vcn && vcn < evcn1) { 2174 attr = attr_b; 2175 le = le_b; 2176 mi = mi_b; 2177 } else if (!le_b) { 2178 err = -EINVAL; 2179 goto out; 2180 } else { 2181 le = le_b; 2182 attr = ni_find_attr(ni, attr_b, &le, ATTR_DATA, NULL, 0, &vcn, 2183 &mi); 2184 if (!attr) { 2185 err = -EINVAL; 2186 goto out; 2187 } 2188 2189 svcn = le64_to_cpu(attr->nres.svcn); 2190 evcn1 = le64_to_cpu(attr->nres.evcn) + 1; 2191 } 2192 2193 run_truncate(run, 0); /* clear cached values. */ 2194 err = attr_load_runs(attr, ni, run, NULL); 2195 if (err) 2196 goto out; 2197 2198 if (!run_insert_range(run, vcn, len)) { 2199 err = -ENOMEM; 2200 goto out; 2201 } 2202 2203 /* Try to pack in current record as much as possible. */ 2204 err = mi_pack_runs(mi, attr, run, evcn1 + len - svcn); 2205 if (err) 2206 goto out; 2207 2208 next_svcn = le64_to_cpu(attr->nres.evcn) + 1; 2209 run_truncate_head(run, next_svcn); 2210 2211 while ((attr = ni_enum_attr_ex(ni, attr, &le, &mi)) && 2212 attr->type == ATTR_DATA && !attr->name_len) { 2213 le64_add_cpu(&attr->nres.svcn, len); 2214 le64_add_cpu(&attr->nres.evcn, len); 2215 if (le) { 2216 le->vcn = attr->nres.svcn; 2217 ni->attr_list.dirty = true; 2218 } 2219 mi->dirty = true; 2220 } 2221 2222 /* 2223 * Update primary attribute segment in advance. 2224 * pointer attr_b may become invalid (layout of mft is changed) 2225 */ 2226 if (vbo <= ni->i_valid) 2227 ni->i_valid += bytes; 2228 > 2229 attr_b->nres.data_size = le64_to_cpu(data_size + bytes); > 2230 attr_b->nres.alloc_size = le64_to_cpu(alloc_size + bytes); -- 0-DAY CI Kernel Test Service https://01.org/lkp