tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2.git 
for-next.recovery3
head:   725ee1535ef0a6ce4067347eac0c7c194ae01eae
commit: 92333b5f1f148bef6ebe737236d7b58b99f127c9 [2/19] gfs2: log error reform
reproduce:
        # apt-get install sparse
        git checkout 92333b5f1f148bef6ebe737236d7b58b99f127c9
        make ARCH=x86_64 allmodconfig
        make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'


sparse warnings: (new ones prefixed by >>)

>> fs/gfs2/lops.c:215:43: sparse: incorrect type in assignment (different base 
>> types) @@    expected int [signed] sd_log_error @@    got restricted 
>> blk_status_int [signed] sd_log_error @@
   fs/gfs2/lops.c:215:43:    expected int [signed] sd_log_error
   fs/gfs2/lops.c:215:43:    got restricted blk_status_t [usertype] bi_status
   include/linux/bvec.h:166:22: sparse: expression using sizeof(void)
   include/linux/bvec.h:166:22: sparse: expression using sizeof(void)

vim +215 fs/gfs2/lops.c

   193  
   194  /**
   195   * gfs2_end_log_write - end of i/o to the log
   196   * @bio: The bio
   197   * @error: Status of i/o request
   198   *
   199   * Each bio_vec contains either data from the pagecache or data
   200   * relating to the log itself. Here we iterate over the bio_vec
   201   * array, processing both kinds of data.
   202   *
   203   */
   204  
   205  static void gfs2_end_log_write(struct bio *bio)
   206  {
   207          struct gfs2_sbd *sdp = bio->bi_private;
   208          struct bio_vec *bvec;
   209          struct page *page;
   210          int i;
   211          struct bvec_iter_all iter_all;
   212  
   213          if (bio->bi_status) {
   214                  if (atomic_add_return(1, &sdp->sd_log_errors) == 1) {
 > 215                          sdp->sd_log_error = bio->bi_status;
   216                          fs_err(sdp, "Error %d writing to journal, 
jid=%u\n",
   217                                 bio->bi_status, sdp->sd_jdesc->jd_jid);
   218                  }
   219                  wake_up(&sdp->sd_logd_waitq);
   220          }
   221  
   222          bio_for_each_segment_all(bvec, bio, i, iter_all) {
   223                  page = bvec->bv_page;
   224                  if (page_has_buffers(page))
   225                          gfs2_end_log_write_bh(sdp, bvec, 
bio->bi_status);
   226                  else
   227                          mempool_free(page, gfs2_page_pool);
   228          }
   229  
   230          bio_put(bio);
   231          if (atomic_dec_and_test(&sdp->sd_log_in_flight))
   232                  wake_up(&sdp->sd_log_flush_wait);
   233  }
   234  

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Reply via email to