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 2C60EC54E67 for ; Sat, 23 Mar 2024 10:51:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9F8A06B0083; Sat, 23 Mar 2024 06:51:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9A8016B0087; Sat, 23 Mar 2024 06:51:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 848E16B0088; Sat, 23 Mar 2024 06:51:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 72CC26B0083 for ; Sat, 23 Mar 2024 06:51:54 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 12CC11617F0 for ; Sat, 23 Mar 2024 10:51:54 +0000 (UTC) X-FDA: 81927988548.04.2BE66B7 Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) by imf10.hostedemail.com (Postfix) with ESMTP id C5B1BC0019 for ; Sat, 23 Mar 2024 10:51:51 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=suse.com header.s=google header.b=FQisQw5O; spf=pass (imf10.hostedemail.com: domain of heming.zhao@suse.com designates 209.85.208.177 as permitted sender) smtp.mailfrom=heming.zhao@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1711191112; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=0DGQzhBq4/pJje5Kffhd66YN8rN/H3f2TbEc/pwRWL0=; b=VJvBeK4SXflVFKWygpg8Bj/3oZZ6IW9KBSCZ8C5GhxdJ2g42fRsHAlyX3rNpD27ddoEsxL /lhPDvxXsG14KqX09bjXafGE5B823v2m8Cq0LV/hHsbhCY3EFWwnTARNmtVuVFVRYDzjKt 9eik9Sfp378vLlSB8MBseUH/hvs5II0= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1711191112; a=rsa-sha256; cv=none; b=uP6sDKEashUXRfU3QFhy5jJRwpGe2OCj7BggPWdqelkZFxL1G8AroA6aV6AZocEDJPoonn tol4K+PLOWy1KdHFy3XHAxgn7aR1IIMhGFE5LpXyhZjUtN+LmKx2xpfvF2p/jjeBpkQkdK 4KNHr2vHFbEA7/V9qTLejN9ly7ZlYM4= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=suse.com header.s=google header.b=FQisQw5O; spf=pass (imf10.hostedemail.com: domain of heming.zhao@suse.com designates 209.85.208.177 as permitted sender) smtp.mailfrom=heming.zhao@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com Received: by mail-lj1-f177.google.com with SMTP id 38308e7fff4ca-2d6a1af9c07so40583681fa.3 for ; Sat, 23 Mar 2024 03:51:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1711191110; x=1711795910; darn=kvack.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=0DGQzhBq4/pJje5Kffhd66YN8rN/H3f2TbEc/pwRWL0=; b=FQisQw5Omv6e4ay3qawdJLov4R4gOQV8o+tJSnqXIL3yUrkKwBygDt74ij9eIiGam5 O5mEh8+f85AxFncFkFUhyWGZb6L434RhgOSFG8nV9AImn8fYcFzqLc1KZriZSdbpgIUR qJm3yfQzWATi15enhih6qcIQh/hPWt1q7bFVRacqSdLqHNSibs2OMcMJ/pTgviPgC8xL R57fUKB5dmS5XXdCYcKhmfKv125GD87JE345qTVh2U3YETrZlxmXpzYVfnsJwgxoutSE zIyGfnkAU/HFJzGrLwZA4R8tZXCULr0gfnKSeRCCfrGKEVcw/Gul9iHvZxm/XmfAqI+2 uzbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711191110; x=1711795910; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=0DGQzhBq4/pJje5Kffhd66YN8rN/H3f2TbEc/pwRWL0=; b=p3DpyfAko/eUAHhTP0H0x08CZLcAJPLXh6K5kprcWm/pCIV/ruf7wQC/Ovvw+qrb59 gB4e+GXuDRuzE8AV4mJh5DGAJE52hMM2dHcJ5INjkf6VEPJi9zNglz3y2kNbX9oHiW5+ yilsr08zOl79LtkftgWvT4/bNmeRMMGFBHoTLcIdHIYK+P3A6pwoRAaK6nFsUXYG0EnR N5l5NYtb8A1E45Ax6Vwg9gOi/+lsAZ/+S+Q9JPuXt1AlYBpW12LAY/I+U9lZmJTJUnFi nbp4L5jyyY2tMnc+r4GHyLjVMuLoX1TvFXuXZ7YVx8Ei/ZahbncyEW6ZoFRUDR+asxv3 WZEg== X-Forwarded-Encrypted: i=1; AJvYcCUv/rct/oTBFA8t5WQlF9H5OrgssA4jMdPqzR25d08ZBnscTLsRxRlX3XYv7Pbp/iOkaHmxwc1+Y36xyCMzbfYXMdQ= X-Gm-Message-State: AOJu0YziOjjIduRf5HbGExRhWZwKOg9z+MaP7wP39ZzF37YHJqpN4A/u Pd11IcaajQfb0doBiIA1OMPnVFwIwh5nm/r4oXjDYXSqXNMmsZMndiOi/Veoyy0= X-Google-Smtp-Source: AGHT+IFTtqd28g25n0tPVnij6t4CGUBifHbYhZRpRiSCZvFDDa6JBhR+Ocg7kOBN3OO6qjAT5EUeLQ== X-Received: by 2002:a05:651c:2c9:b0:2d4:a232:757 with SMTP id f9-20020a05651c02c900b002d4a2320757mr1084636ljo.7.1711191109736; Sat, 23 Mar 2024 03:51:49 -0700 (PDT) Received: from [10.202.0.23] ([202.127.77.110]) by smtp.gmail.com with ESMTPSA id t26-20020a056a00139a00b006e6c733bde9sm1157563pfg.155.2024.03.23.03.51.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 23 Mar 2024 03:51:49 -0700 (PDT) Message-ID: Date: Sat, 23 Mar 2024 18:51:46 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [akpm-mm:mm-nonmm-unstable 38/38] fs/ocfs2/resize.c:127:46: sparse: sparse: incorrect type in argument 2 (different base types) To: Joseph Qi Cc: Andrew Morton , Linux Memory Management List , ocfs2-devel@lists.linux.dev References: <202403231258.mU2k0fih-lkp@intel.com> Content-Language: en-US From: Heming Zhao In-Reply-To: <202403231258.mU2k0fih-lkp@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Stat-Signature: bwhna3k1cekh7oxdi4qumjetw4345rdf X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: C5B1BC0019 X-Rspam-User: X-HE-Tag: 1711191111-987171 X-HE-Meta: U2FsdGVkX18QTjbm6X2mOwFaxeYMU6Y5TAAmBGWZazqTVMepY5h4Qu/AFMshpg0PWU3+xCf9Zr61/uxMgfzwewUOofXEDwwuEopdRUS/B7PD/a/nRceWJqsuc96Sce+jm+77BIjhvTDJwuDSl+d3CgArEyGXbEuAoZvwx3sKoQy9STrDEbsCn8r+H6Tn9deCfd+W8f1YbuKZ2DyCez2Je/S60P9vXvBVufuOQtoUt9uxxE4P0U1Eoey4epOl2EcmJSP49TYqqJFBALC/ZXyTtxzltM5mEmH2JsRYvSK4D4ThSv6jAmBrug6R1oJfRXrTi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INbv08Kg9g9XERJZSJUvbuL9m1fV9n4LuqtX3cz+hAiaS8C6l8FH8rVBQtnKoyx0ZK6/6FNfWiee/J9iimapN8X/461n6F6VAWeZL30jlVu6PpARdiRP2pgOSkIbJYOQVmGPQ/VN6x64bfdihDDyVPnyQ7MxjmjLcWzZYGjpW2ZHPYxLNzt5MvnvTAGK0WpqUU2mFqCKKy9fJe8oRK9i2gij1noJyXs= 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: List-Subscribe: List-Unsubscribe: Hello Joseph, Please see my comment, only one warning need to be fixed, others are harmless. Do I re-send v4 patch or send a new patch? On 3/23/24 12:17, kernel test robot wrote: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-nonmm-unstable > head: e393dbc9246c3ae0160a07c8666838056eafbc44 > commit: e393dbc9246c3ae0160a07c8666838056eafbc44 [38/38] ocfs2: improve write IO performance when fragmentation is high > config: i386-randconfig-061-20240322 (https://download.01.org/0day-ci/archive/20240323/202403231258.mU2k0fih-lkp@intel.com/config) > compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18) > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240323/202403231258.mU2k0fih-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/202403231258.mU2k0fih-lkp@intel.com/ > > sparse warnings: (new ones prefixed by >>) >>> fs/ocfs2/resize.c:127:46: sparse: sparse: incorrect type in argument 2 (different base types) @@ expected unsigned short [usertype] total_bits @@ got restricted __le16 [usertype] bg_bits @@ > fs/ocfs2/resize.c:127:46: sparse: expected unsigned short [usertype] total_bits > fs/ocfs2/resize.c:127:46: sparse: got restricted __le16 [usertype] bg_bits This warning need to be modified, there should do endian converting. >>> fs/ocfs2/resize.c:128:33: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [usertype] old_bg_contig_free_bits @@ got restricted __le16 [usertype] bg_contig_free_bits @@ > fs/ocfs2/resize.c:128:33: sparse: expected unsigned short [usertype] old_bg_contig_free_bits > fs/ocfs2/resize.c:128:33: sparse: got restricted __le16 [usertype] bg_contig_free_bits This warning is harmless, the old_bg_contig_free_bits does backup job. later code logic just uses this value to do restore value job. So we don't need to do endian converting job. >>> fs/ocfs2/resize.c:169:44: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le16 [usertype] bg_contig_free_bits @@ got unsigned short [usertype] old_bg_contig_free_bits @@ > fs/ocfs2/resize.c:169:44: sparse: expected restricted __le16 [usertype] bg_contig_free_bits > fs/ocfs2/resize.c:169:44: sparse: got unsigned short [usertype] old_bg_contig_free_bits see my above comment. just use backup value. no need to convert endian. > fs/ocfs2/resize.c: note: in included file (through include/linux/mmzone.h, include/linux/gfp.h, include/linux/xarray.h, ...): > include/linux/page-flags.h:242:46: sparse: sparse: self-comparison always evaluates to false > include/linux/page-flags.h:242:46: sparse: sparse: self-comparison always evaluates to false This warning belongs to mm part. > -- >>> fs/ocfs2/suballoc.c:2566:41: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [usertype] old_bg_contig_free_bits @@ got restricted __le16 [usertype] bg_contig_free_bits @@ > fs/ocfs2/suballoc.c:2566:41: sparse: expected unsigned short [usertype] old_bg_contig_free_bits > fs/ocfs2/suballoc.c:2566:41: sparse: got restricted __le16 [usertype] bg_contig_free_bits Like above, there code do backup job, no need to convert endian. > fs/ocfs2/suballoc.c: note: in included file (through include/linux/mmzone.h, include/linux/gfp.h, include/linux/xarray.h, ...): > include/linux/page-flags.h:242:46: sparse: sparse: self-comparison always evaluates to false > include/linux/page-flags.h:242:46: sparse: sparse: self-comparison always evaluates to false There belongs to mm. > fs/ocfs2/suballoc.c:2493:17: sparse: sparse: context imbalance in 'ocfs2_block_group_clear_bits' - different lock contexts for basic block from [1], this warning is harmless. [1]: https://lwn.net/Articles/109066/ Thanks, Heming > > vim +127 fs/ocfs2/resize.c > > 76 > 77 static int ocfs2_update_last_group_and_inode(handle_t *handle, > 78 struct inode *bm_inode, > 79 struct buffer_head *bm_bh, > 80 struct buffer_head *group_bh, > 81 u32 first_new_cluster, > 82 int new_clusters) > 83 { > 84 int ret = 0; > 85 struct ocfs2_super *osb = OCFS2_SB(bm_inode->i_sb); > 86 struct ocfs2_dinode *fe = (struct ocfs2_dinode *) bm_bh->b_data; > 87 struct ocfs2_chain_list *cl = &fe->id2.i_chain; > 88 struct ocfs2_chain_rec *cr; > 89 struct ocfs2_group_desc *group; > 90 u16 chain, num_bits, backups = 0; > 91 u16 cl_bpc = le16_to_cpu(cl->cl_bpc); > 92 u16 cl_cpg = le16_to_cpu(cl->cl_cpg); > 93 u16 old_bg_clusters; > 94 u16 contig_bits, old_bg_contig_free_bits; > 95 > 96 trace_ocfs2_update_last_group_and_inode(new_clusters, > 97 first_new_cluster); > 98 > 99 ret = ocfs2_journal_access_gd(handle, INODE_CACHE(bm_inode), > 100 group_bh, OCFS2_JOURNAL_ACCESS_WRITE); > 101 if (ret < 0) { > 102 mlog_errno(ret); > 103 goto out; > 104 } > 105 > 106 group = (struct ocfs2_group_desc *)group_bh->b_data; > 107 > 108 old_bg_clusters = le16_to_cpu(group->bg_bits) / cl_bpc; > 109 /* update the group first. */ > 110 num_bits = new_clusters * cl_bpc; > 111 le16_add_cpu(&group->bg_bits, num_bits); > 112 le16_add_cpu(&group->bg_free_bits_count, num_bits); > 113 > 114 /* > 115 * check whether there are some new backup superblocks exist in > 116 * this group and update the group bitmap accordingly. > 117 */ > 118 if (OCFS2_HAS_COMPAT_FEATURE(osb->sb, > 119 OCFS2_FEATURE_COMPAT_BACKUP_SB)) { > 120 backups = ocfs2_calc_new_backup_super(bm_inode, > 121 group, > 122 cl_cpg, old_bg_clusters, 1); > 123 le16_add_cpu(&group->bg_free_bits_count, -1 * backups); > 124 } > 125 > 126 contig_bits = ocfs2_find_max_contig_free_bits(group->bg_bitmap, > > 127 group->bg_bits, 0); > > 128 old_bg_contig_free_bits = group->bg_contig_free_bits; > 129 group->bg_contig_free_bits = cpu_to_le16(contig_bits); > 130 > 131 ocfs2_journal_dirty(handle, group_bh); > 132 > 133 /* update the inode accordingly. */ > 134 ret = ocfs2_journal_access_di(handle, INODE_CACHE(bm_inode), bm_bh, > 135 OCFS2_JOURNAL_ACCESS_WRITE); > 136 if (ret < 0) { > 137 mlog_errno(ret); > 138 goto out_rollback; > 139 } > 140 > 141 chain = le16_to_cpu(group->bg_chain); > 142 cr = (&cl->cl_recs[chain]); > 143 le32_add_cpu(&cr->c_total, num_bits); > 144 le32_add_cpu(&cr->c_free, num_bits); > 145 le32_add_cpu(&fe->id1.bitmap1.i_total, num_bits); > 146 le32_add_cpu(&fe->i_clusters, new_clusters); > 147 > 148 if (backups) { > 149 le32_add_cpu(&cr->c_free, -1 * backups); > 150 le32_add_cpu(&fe->id1.bitmap1.i_used, backups); > 151 } > 152 > 153 spin_lock(&OCFS2_I(bm_inode)->ip_lock); > 154 OCFS2_I(bm_inode)->ip_clusters = le32_to_cpu(fe->i_clusters); > 155 le64_add_cpu(&fe->i_size, (u64)new_clusters << osb->s_clustersize_bits); > 156 spin_unlock(&OCFS2_I(bm_inode)->ip_lock); > 157 i_size_write(bm_inode, le64_to_cpu(fe->i_size)); > 158 > 159 ocfs2_journal_dirty(handle, bm_bh); > 160 > 161 out_rollback: > 162 if (ret < 0) { > 163 ocfs2_calc_new_backup_super(bm_inode, > 164 group, > 165 cl_cpg, old_bg_clusters, 0); > 166 le16_add_cpu(&group->bg_free_bits_count, backups); > 167 le16_add_cpu(&group->bg_bits, -1 * num_bits); > 168 le16_add_cpu(&group->bg_free_bits_count, -1 * num_bits); > > 169 group->bg_contig_free_bits = old_bg_contig_free_bits; > 170 } > 171 out: > 172 if (ret) > 173 mlog_errno(ret); > 174 return ret; > 175 } > 176 >