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 031D2C00140 for ; Mon, 1 Aug 2022 01:02:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5F65E8E0002; Sun, 31 Jul 2022 21:02:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5A6038E0001; Sun, 31 Jul 2022 21:02:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 446258E0002; Sun, 31 Jul 2022 21:02:11 -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 364A08E0001 for ; Sun, 31 Jul 2022 21:02:11 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 014738072A for ; Mon, 1 Aug 2022 01:02:10 +0000 (UTC) X-FDA: 79749222462.16.AF6B419 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by imf02.hostedemail.com (Postfix) with ESMTP id 8963D800E7 for ; Mon, 1 Aug 2022 01:02:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1659315729; x=1690851729; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=aLneOQk6oCRAyT1JaL97eQtx9S06S+0MJ/BWaEHOme4=; b=an7plorkl037glnzwL9X6oxEUrCiSqPZUfJCxcrKNHHkejrh8yKEw/Lg nuIkvzo49psE/ZVfahoKSHM/jmNjeOpI1476CVdWbN+F6eEjxv7VrHIjG pIVIogKRUD1PK2cAmmMBp82ClmR7iZFFOP+rfQap45/0rgQ/r6zMhHdqm BofCWwO5hGt06ouSbqDW3pEbgDOsKMV39t6MmXM+CJjgN2ym3VdvtoWcH I4TONyGy69Rw0bmzjRTBYxMZpLjv/qoRnD7xHbepbWzuI8mZDLsebsl7N dsbRSxsxkpciKtA6UotJlIybM6BogXdO3TBPQzXYmG4vBEpA2kMCqAOwh A==; X-IronPort-AV: E=McAfee;i="6400,9594,10425"; a="350747210" X-IronPort-AV: E=Sophos;i="5.93,206,1654585200"; d="scan'208";a="350747210" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2022 18:02:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,206,1654585200"; d="scan'208";a="847666320" Received: from lkp-server01.sh.intel.com (HELO e0eace57cfef) ([10.239.97.150]) by fmsmga006.fm.intel.com with ESMTP; 31 Jul 2022 18:02:04 -0700 Received: from kbuild by e0eace57cfef with local (Exim 4.96) (envelope-from ) id 1oIJop-000Efr-2v; Mon, 01 Aug 2022 01:02:03 +0000 Date: Mon, 1 Aug 2022 09:01:35 +0800 From: kernel test robot To: "Fabio M. De Francesco" , "Matthew Wilcox (Oracle)" , Jan Kara , Roman Gushchin , Pali =?iso-8859-1?Q?Roh=E1r?= , Andrew Morton , Muchun Song , Ira Weiny , linux-kernel@vger.kernel.org Cc: kbuild-all@lists.01.org, Linux Memory Management List , "Fabio M. De Francesco" Subject: Re: [PATCH] fs/isofs: Replace kmap() with kmap_local_page() Message-ID: <202208010804.HdlHVBnW-lkp@intel.com> References: <20220731190101.7928-1-fmdefrancesco@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220731190101.7928-1-fmdefrancesco@gmail.com> ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=none ("invalid DKIM record") header.d=intel.com header.s=Intel header.b=an7plork; spf=pass (imf02.hostedemail.com: domain of lkp@intel.com designates 134.134.136.31 as permitted sender) smtp.mailfrom=lkp@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1659315730; a=rsa-sha256; cv=none; b=jNJ9VToWcDKA8uaJJC8juReohEMhIlqLRiDKHVpfawOJEvVqSLi30KHxD+rOHOFjeozrE/ AXl2M993J8ZISi6F9irGNKVkBVTMQvSyLuvRV7rwwmByVdDf3cBLkl5fFNhHcfc3edoMq7 684rgiUAnEE29ziOQPIBQjKv91bcq7U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1659315730; 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:in-reply-to:references:references:dkim-signature; bh=uOPo73hMsZrRMhwJ9IeC3RaUrCO/dAc0S/2yroD++0g=; b=LLDiBHxYLhAo1vf2E84PtXJZZbvLCJGls46XxpzPM0KEnJjK4/ajt4LpgrylDcn9vRM/bT OQ9NEPO/ha3lFKXh6zrN13bG/lFCzP7tU1SUg4pkJAx3Pn2k5Wb2jLmaPiKfwRz4eQvFp+ w8IkHzeSZ0H9gXgPYJH5C7ekBVQDsnA= X-Stat-Signature: 6ko17xdedzd4qk18j4prh8j91557dnzs X-Rspamd-Queue-Id: 8963D800E7 X-Rspam-User: Authentication-Results: imf02.hostedemail.com; dkim=none ("invalid DKIM record") header.d=intel.com header.s=Intel header.b=an7plork; spf=pass (imf02.hostedemail.com: domain of lkp@intel.com designates 134.134.136.31 as permitted sender) smtp.mailfrom=lkp@intel.com; dmarc=pass (policy=none) header.from=intel.com X-Rspamd-Server: rspam04 X-HE-Tag: 1659315729-346881 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: Hi "Fabio, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on jack-fs/for_next] [also build test WARNING on akpm-mm/mm-everything linus/master v5.19 next-20220728] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Fabio-M-De-Francesco/fs-isofs-Replace-kmap-with-kmap_local_page/20220801-030233 base: https://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs.git for_next config: nios2-randconfig-s043-20220731 (https://download.01.org/0day-ci/archive/20220801/202208010804.HdlHVBnW-lkp@intel.com/config) compiler: nios2-linux-gcc (GCC) 12.1.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # apt-get install sparse # sparse version: v0.6.4-39-gce1a6720-dirty # https://github.com/intel-lab-lkp/linux/commit/7c25888be273e928336283deae5b57f8ffa78a50 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Fabio-M-De-Francesco/fs-isofs-Replace-kmap-with-kmap_local_page/20220801-030233 git checkout 7c25888be273e928336283deae5b57f8ffa78a50 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=nios2 SHELL=/bin/bash fs/isofs/ If you fix the issue, kindly add following tag where applicable Reported-by: kernel test robot sparse warnings: (new ones prefixed by >>) >> fs/isofs/compress.c:178:45: sparse: sparse: incompatible types in comparison expression (different signedness): >> fs/isofs/compress.c:178:45: sparse: unsigned char [usertype] * >> fs/isofs/compress.c:178:45: sparse: char * fs/isofs/compress.c:189:48: sparse: sparse: incompatible types in comparison expression (different signedness): fs/isofs/compress.c:189:48: sparse: unsigned char [usertype] * fs/isofs/compress.c:189:48: sparse: char * vim +178 fs/isofs/compress.c 34 35 /* 36 * Read data of @inode from @block_start to @block_end and uncompress 37 * to one zisofs block. Store the data in the @pages array with @pcount 38 * entries. Start storing at offset @poffset of the first page. 39 */ 40 static loff_t zisofs_uncompress_block(struct inode *inode, loff_t block_start, 41 loff_t block_end, int pcount, 42 struct page **pages, unsigned poffset, 43 int *errp) 44 { 45 unsigned int zisofs_block_shift = ISOFS_I(inode)->i_format_parm[1]; 46 unsigned int bufsize = ISOFS_BUFFER_SIZE(inode); 47 unsigned int bufshift = ISOFS_BUFFER_BITS(inode); 48 unsigned int bufmask = bufsize - 1; 49 int i, block_size = block_end - block_start; 50 z_stream stream = { .total_out = 0, 51 .avail_in = 0, 52 .avail_out = 0, }; 53 int zerr; 54 int needblocks = (block_size + (block_start & bufmask) + bufmask) 55 >> bufshift; 56 int haveblocks; 57 blkcnt_t blocknum; 58 struct buffer_head **bhs; 59 int curbh, curpage; 60 61 if (block_size > deflateBound(1UL << zisofs_block_shift)) { 62 *errp = -EIO; 63 return 0; 64 } 65 /* Empty block? */ 66 if (block_size == 0) { 67 for ( i = 0 ; i < pcount ; i++ ) { 68 if (!pages[i]) 69 continue; 70 memzero_page(pages[i], 0, PAGE_SIZE); 71 SetPageUptodate(pages[i]); 72 } 73 return ((loff_t)pcount) << PAGE_SHIFT; 74 } 75 76 /* Because zlib is not thread-safe, do all the I/O at the top. */ 77 blocknum = block_start >> bufshift; 78 bhs = kcalloc(needblocks + 1, sizeof(*bhs), GFP_KERNEL); 79 if (!bhs) { 80 *errp = -ENOMEM; 81 return 0; 82 } 83 haveblocks = isofs_get_blocks(inode, blocknum, bhs, needblocks); 84 ll_rw_block(REQ_OP_READ, 0, haveblocks, bhs); 85 86 curbh = 0; 87 curpage = 0; 88 /* 89 * First block is special since it may be fractional. We also wait for 90 * it before grabbing the zlib mutex; odds are that the subsequent 91 * blocks are going to come in in short order so we don't hold the zlib 92 * mutex longer than necessary. 93 */ 94 95 if (!bhs[0]) 96 goto b_eio; 97 98 wait_on_buffer(bhs[0]); 99 if (!buffer_uptodate(bhs[0])) { 100 *errp = -EIO; 101 goto b_eio; 102 } 103 104 stream.workspace = zisofs_zlib_workspace; 105 mutex_lock(&zisofs_zlib_lock); 106 107 zerr = zlib_inflateInit(&stream); 108 if (zerr != Z_OK) { 109 if (zerr == Z_MEM_ERROR) 110 *errp = -ENOMEM; 111 else 112 *errp = -EIO; 113 printk(KERN_DEBUG "zisofs: zisofs_inflateInit returned %d\n", 114 zerr); 115 goto z_eio; 116 } 117 118 while (curpage < pcount && curbh < haveblocks && 119 zerr != Z_STREAM_END) { 120 if (!stream.avail_out) { 121 if (pages[curpage]) { 122 stream.next_out = kmap_local_page(pages[curpage]) 123 + poffset; 124 stream.avail_out = PAGE_SIZE - poffset; 125 poffset = 0; 126 } else { 127 stream.next_out = (void *)&zisofs_sink_page; 128 stream.avail_out = PAGE_SIZE; 129 } 130 } 131 if (!stream.avail_in) { 132 wait_on_buffer(bhs[curbh]); 133 if (!buffer_uptodate(bhs[curbh])) { 134 *errp = -EIO; 135 break; 136 } 137 stream.next_in = bhs[curbh]->b_data + 138 (block_start & bufmask); 139 stream.avail_in = min_t(unsigned, bufsize - 140 (block_start & bufmask), 141 block_size); 142 block_size -= stream.avail_in; 143 block_start = 0; 144 } 145 146 while (stream.avail_out && stream.avail_in) { 147 zerr = zlib_inflate(&stream, Z_SYNC_FLUSH); 148 if (zerr == Z_BUF_ERROR && stream.avail_in == 0) 149 break; 150 if (zerr == Z_STREAM_END) 151 break; 152 if (zerr != Z_OK) { 153 /* EOF, error, or trying to read beyond end of input */ 154 if (zerr == Z_MEM_ERROR) 155 *errp = -ENOMEM; 156 else { 157 printk(KERN_DEBUG 158 "zisofs: zisofs_inflate returned" 159 " %d, inode = %lu," 160 " page idx = %d, bh idx = %d," 161 " avail_in = %ld," 162 " avail_out = %ld\n", 163 zerr, inode->i_ino, curpage, 164 curbh, stream.avail_in, 165 stream.avail_out); 166 *errp = -EIO; 167 } 168 goto inflate_out; 169 } 170 } 171 172 if (!stream.avail_out) { 173 /* This page completed */ 174 if (pages[curpage]) { 175 flush_dcache_page(pages[curpage]); 176 SetPageUptodate(pages[curpage]); 177 } > 178 if (stream.next_out != (char *)zisofs_sink_page) { 179 kunmap_local(stream.next_out); 180 stream.next_out = NULL; 181 } 182 curpage++; 183 } 184 if (!stream.avail_in) 185 curbh++; 186 } 187 inflate_out: 188 zlib_inflateEnd(&stream); 189 if (stream.next_out && stream.next_out != (char *)zisofs_sink_page) 190 kunmap_local(stream.next_out); 191 192 z_eio: 193 mutex_unlock(&zisofs_zlib_lock); 194 195 b_eio: 196 for (i = 0; i < haveblocks; i++) 197 brelse(bhs[i]); 198 kfree(bhs); 199 return stream.total_out; 200 } 201 -- 0-DAY CI Kernel Test Service https://01.org/lkp