lkml.org 
[lkml]   [2020]   [Aug]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    Subjectfs/erofs/zdata.c:198:22: sparse: sparse: non size-preserving integer to pointer cast
    Hi Gao,

    First bad commit (maybe != root cause):

    tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
    head: 86cfccb66937dd6cbf26ed619958b9e587e6a115
    commit: 47e4937a4a7ca4184fd282791dfee76c6799966a erofs: move erofs out of staging
    date: 12 months ago
    config: s390-randconfig-s032-20200807 (attached as .config)
    compiler: s390-linux-gcc (GCC) 9.3.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.2-118-ge1578773-dirty
    git checkout 47e4937a4a7ca4184fd282791dfee76c6799966a
    # save the attached .config to linux build tree
    COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=s390

    If you fix the issue, kindly add following tag as appropriate
    Reported-by: kernel test robot <lkp@intel.com>


    sparse warnings: (new ones prefixed by >>)

    >> fs/erofs/zdata.c:198:22: sparse: sparse: non size-preserving integer to pointer cast
    fs/erofs/zdata.c:282:22: sparse: sparse: non size-preserving integer to pointer cast
    fs/erofs/zdata.c:1094:24: sparse: sparse: non size-preserving integer to pointer cast

    vim +198 fs/erofs/zdata.c

    3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 162
    97e86a858bc360 drivers/staging/erofs/zdata.c Gao Xiang 2019-07-31 163 static void preload_compressed_pages(struct z_erofs_collector *clt,
    92e6efd566c4a1 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-12-08 164 struct address_space *mc,
    92e6efd566c4a1 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-12-08 165 enum z_erofs_cache_alloctype type,
    97e86a858bc360 drivers/staging/erofs/zdata.c Gao Xiang 2019-07-31 166 struct list_head *pagepool)
    105d4ad857dcbf drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 167 {
    97e86a858bc360 drivers/staging/erofs/zdata.c Gao Xiang 2019-07-31 168 const struct z_erofs_pcluster *pcl = clt->pcl;
    97e86a858bc360 drivers/staging/erofs/zdata.c Gao Xiang 2019-07-31 169 const unsigned int clusterpages = BIT(pcl->clusterbits);
    97e86a858bc360 drivers/staging/erofs/zdata.c Gao Xiang 2019-07-31 170 struct page **pages = clt->compressedpages;
    97e86a858bc360 drivers/staging/erofs/zdata.c Gao Xiang 2019-07-31 171 pgoff_t index = pcl->obj.index + (pages - pcl->compressed_pages);
    92e6efd566c4a1 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-12-08 172 bool standalone = true;
    92e6efd566c4a1 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-12-08 173
    97e86a858bc360 drivers/staging/erofs/zdata.c Gao Xiang 2019-07-31 174 if (clt->mode < COLLECT_PRIMARY_FOLLOWED)
    92e6efd566c4a1 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-12-08 175 return;
    105d4ad857dcbf drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 176
    97e86a858bc360 drivers/staging/erofs/zdata.c Gao Xiang 2019-07-31 177 for (; pages < pcl->compressed_pages + clusterpages; ++pages) {
    92e6efd566c4a1 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-12-08 178 struct page *page;
    92e6efd566c4a1 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-12-08 179 compressed_page_t t;
    92e6efd566c4a1 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-12-08 180
    92e6efd566c4a1 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-12-08 181 /* the compressed page was loaded before */
    97e86a858bc360 drivers/staging/erofs/zdata.c Gao Xiang 2019-07-31 182 if (READ_ONCE(*pages))
    105d4ad857dcbf drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 183 continue;
    105d4ad857dcbf drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 184
    97e86a858bc360 drivers/staging/erofs/zdata.c Gao Xiang 2019-07-31 185 page = find_get_page(mc, index);
    92e6efd566c4a1 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-12-08 186
    92e6efd566c4a1 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-12-08 187 if (page) {
    92e6efd566c4a1 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-12-08 188 t = tag_compressed_page_justfound(page);
    92e6efd566c4a1 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-12-08 189 } else if (type == DELAYEDALLOC) {
    92e6efd566c4a1 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-12-08 190 t = tagptr_init(compressed_page_t, PAGE_UNALLOCATED);
    92e6efd566c4a1 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-12-08 191 } else { /* DONTALLOC */
    92e6efd566c4a1 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-12-08 192 if (standalone)
    97e86a858bc360 drivers/staging/erofs/zdata.c Gao Xiang 2019-07-31 193 clt->compressedpages = pages;
    92e6efd566c4a1 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-12-08 194 standalone = false;
    105d4ad857dcbf drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 195 continue;
    105d4ad857dcbf drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 196 }
    105d4ad857dcbf drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 197
    97e86a858bc360 drivers/staging/erofs/zdata.c Gao Xiang 2019-07-31 @198 if (!cmpxchg_relaxed(pages, NULL, tagptr_cast_ptr(t)))
    105d4ad857dcbf drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 199 continue;
    105d4ad857dcbf drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 200
    92e6efd566c4a1 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-12-08 201 if (page)
    92e6efd566c4a1 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-12-08 202 put_page(page);
    105d4ad857dcbf drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 203 }
    92e6efd566c4a1 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-12-08 204
    97e86a858bc360 drivers/staging/erofs/zdata.c Gao Xiang 2019-07-31 205 if (standalone) /* downgrade to PRIMARY_FOLLOWED_NOINPLACE */
    97e86a858bc360 drivers/staging/erofs/zdata.c Gao Xiang 2019-07-31 206 clt->mode = COLLECT_PRIMARY_FOLLOWED_NOINPLACE;
    105d4ad857dcbf drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 207 }
    105d4ad857dcbf drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 208

    :::::: The code at line 198 was first introduced by commit
    :::::: 97e86a858bc360c9cded74ce9a06595d40f7ad81 staging: erofs: tidy up decompression frontend

    :::::: TO: Gao Xiang <gaoxiang25@huawei.com>
    :::::: CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    0-DAY CI Kernel Test Service, Intel Corporation
    https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
    [unhandled content-type:application/gzip]
    \
     
     \ /
      Last update: 2020-08-07 14:09    [W:6.500 / U:0.132 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site