All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH 1/1] blk-snap - Block snapshot module This module implements snapshot and changed block tracking functionality. It is intended to create backup copies of any block devices without usage of device-mapper.
Date: Fri, 02 Oct 2020 23:49:44 +0800	[thread overview]
Message-ID: <202010022300.is4RAnI9-lkp@intel.com> (raw)
In-Reply-To: <1601643362-7370-2-git-send-email-sergei.shtepa@veeam.com>

[-- Attachment #1: Type: text/plain, Size: 31093 bytes --]

Hi Sergei,

I love your patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v5.9-rc7]
[cannot apply to block/for-next sparc-next/master next-20201002]
[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]

url:    https://github.com/0day-ci/linux/commits/Sergei-Shtepa/Block-snapshot-module-and-block-layer-filter-API/20201002-210406
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 472e5b056f000a778abb41f1e443de58eb259783
config: m68k-allmodconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/61a37e3bb74afbef1b725eaf80405e0e6e5d64b7
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Sergei-Shtepa/Block-snapshot-module-and-block-layer-filter-API/20201002-210406
        git checkout 61a37e3bb74afbef1b725eaf80405e0e6e5d64b7
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=m68k 

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

All warnings (new ones prefixed by >>):

   In file included from include/linux/kernel.h:11,
                    from include/linux/list.h:9,
                    from include/linux/mutex.h:15,
                    from drivers/block/blk-snap/common.h:11,
                    from drivers/block/blk-snap/blk_deferred.c:3:
   include/linux/scatterlist.h: In function 'sg_set_buf':
   arch/m68k/include/asm/page_mm.h:169:49: warning: ordered comparison of pointer with null pointer [-Wextra]
     169 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET && (void *)(kaddr) < high_memory)
         |                                                 ^~
   include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
      78 | # define unlikely(x) __builtin_expect(!!(x), 0)
         |                                          ^
   include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
     143 |  BUG_ON(!virt_addr_valid(buf));
         |  ^~~~~~
   include/linux/scatterlist.h:143:10: note: in expansion of macro 'virt_addr_valid'
     143 |  BUG_ON(!virt_addr_valid(buf));
         |          ^~~~~~~~~~~~~~~
   drivers/block/blk-snap/blk_deferred.c: At top level:
>> drivers/block/blk-snap/blk_deferred.c:140:13: warning: no previous prototype for '_blk_deferred_bio_alloc' [-Wmissing-prototypes]
     140 | struct bio *_blk_deferred_bio_alloc(int nr_iovecs)
         |             ^~~~~~~~~~~~~~~~~~~~~~~
>> drivers/block/blk-snap/blk_deferred.c:198:10: warning: no previous prototype for '_blk_deferred_submit_pages' [-Wmissing-prototypes]
     198 | sector_t _blk_deferred_submit_pages(struct block_device *blk_dev,
         |          ^~~~~~~~~~~~~~~~~~~~~~~~~~
--
   In file included from include/linux/kernel.h:11,
                    from include/linux/list.h:9,
                    from include/linux/mutex.h:15,
                    from drivers/block/blk-snap/common.h:11,
                    from drivers/block/blk-snap/blk_descr_file.c:3:
   include/linux/scatterlist.h: In function 'sg_set_buf':
   arch/m68k/include/asm/page_mm.h:169:49: warning: ordered comparison of pointer with null pointer [-Wextra]
     169 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET && (void *)(kaddr) < high_memory)
         |                                                 ^~
   include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
      78 | # define unlikely(x) __builtin_expect(!!(x), 0)
         |                                          ^
   include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
     143 |  BUG_ON(!virt_addr_valid(buf));
         |  ^~~~~~
   include/linux/scatterlist.h:143:10: note: in expansion of macro 'virt_addr_valid'
     143 |  BUG_ON(!virt_addr_valid(buf));
         |          ^~~~~~~~~~~~~~~
   drivers/block/blk-snap/blk_descr_file.c: At top level:
>> drivers/block/blk-snap/blk_descr_file.c:39:6: warning: no previous prototype for '_blk_descr_file_cleanup' [-Wmissing-prototypes]
      39 | void _blk_descr_file_cleanup(void *descr_array, size_t count)
         |      ^~~~~~~~~~~~~~~~~~~~~~~
--
   In file included from include/linux/kernel.h:11,
                    from include/linux/list.h:9,
                    from include/linux/mutex.h:15,
                    from drivers/block/blk-snap/common.h:11,
                    from drivers/block/blk-snap/blk_descr_mem.c:3:
   include/linux/scatterlist.h: In function 'sg_set_buf':
   arch/m68k/include/asm/page_mm.h:169:49: warning: ordered comparison of pointer with null pointer [-Wextra]
     169 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET && (void *)(kaddr) < high_memory)
         |                                                 ^~
   include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
      78 | # define unlikely(x) __builtin_expect(!!(x), 0)
         |                                          ^
   include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
     143 |  BUG_ON(!virt_addr_valid(buf));
         |  ^~~~~~
   include/linux/scatterlist.h:143:10: note: in expansion of macro 'virt_addr_valid'
     143 |  BUG_ON(!virt_addr_valid(buf));
         |          ^~~~~~~~~~~~~~~
   drivers/block/blk-snap/blk_descr_mem.c: At top level:
>> drivers/block/blk-snap/blk_descr_mem.c:23:6: warning: no previous prototype for 'blk_descr_mem_cleanup' [-Wmissing-prototypes]
      23 | void blk_descr_mem_cleanup(void *descr_array, size_t count)
         |      ^~~~~~~~~~~~~~~~~~~~~
--
   In file included from include/linux/kernel.h:11,
                    from include/linux/list.h:9,
                    from include/linux/mutex.h:15,
                    from drivers/block/blk-snap/common.h:11,
                    from drivers/block/blk-snap/blk_redirect.c:3:
   include/linux/scatterlist.h: In function 'sg_set_buf':
   arch/m68k/include/asm/page_mm.h:169:49: warning: ordered comparison of pointer with null pointer [-Wextra]
     169 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET && (void *)(kaddr) < high_memory)
         |                                                 ^~
   include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
      78 | # define unlikely(x) __builtin_expect(!!(x), 0)
         |                                          ^
   include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
     143 |  BUG_ON(!virt_addr_valid(buf));
         |  ^~~~~~
   include/linux/scatterlist.h:143:10: note: in expansion of macro 'virt_addr_valid'
     143 |  BUG_ON(!virt_addr_valid(buf));
         |          ^~~~~~~~~~~~~~~
   drivers/block/blk-snap/blk_redirect.c: At top level:
>> drivers/block/blk-snap/blk_redirect.c:44:13: warning: no previous prototype for '_blk_dev_redirect_bio_alloc' [-Wmissing-prototypes]
      44 | struct bio *_blk_dev_redirect_bio_alloc(int nr_iovecs, void *bi_private)
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/block/blk-snap/blk_redirect.c:58:31: warning: no previous prototype for '_redirect_bio_allocate_list' [-Wmissing-prototypes]
      58 | struct blk_redirect_bio_list *_redirect_bio_allocate_list(struct bio *new_bio)
         |                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/block/blk-snap/blk_redirect.c:72:5: warning: no previous prototype for 'bio_endio_list_push' [-Wmissing-prototypes]
      72 | int bio_endio_list_push(struct blk_redirect_bio *rq_redir, struct bio *new_bio)
         |     ^~~~~~~~~~~~~~~~~~~
>> drivers/block/blk-snap/blk_redirect.c:97:6: warning: no previous prototype for 'bio_endio_list_cleanup' [-Wmissing-prototypes]
      97 | void bio_endio_list_cleanup(struct blk_redirect_bio_list *curr)
         |      ^~~~~~~~~~~~~~~~~~~~~~
--
   In file included from include/linux/kernel.h:11,
                    from include/linux/list.h:9,
                    from include/linux/mutex.h:15,
                    from drivers/block/blk-snap/common.h:11,
                    from drivers/block/blk-snap/cbt_map.c:3:
   include/linux/scatterlist.h: In function 'sg_set_buf':
   arch/m68k/include/asm/page_mm.h:169:49: warning: ordered comparison of pointer with null pointer [-Wextra]
     169 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET && (void *)(kaddr) < high_memory)
         |                                                 ^~
   include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
      78 | # define unlikely(x) __builtin_expect(!!(x), 0)
         |                                          ^
   include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
     143 |  BUG_ON(!virt_addr_valid(buf));
         |  ^~~~~~
   include/linux/scatterlist.h:143:10: note: in expansion of macro 'virt_addr_valid'
     143 |  BUG_ON(!virt_addr_valid(buf));
         |          ^~~~~~~~~~~~~~~
   drivers/block/blk-snap/cbt_map.c: At top level:
>> drivers/block/blk-snap/cbt_map.c:6:5: warning: no previous prototype for 'cbt_map_allocate' [-Wmissing-prototypes]
       6 | int cbt_map_allocate(struct cbt_map *cbt_map, unsigned int cbt_sect_in_block_degree,
         |     ^~~~~~~~~~~~~~~~
   In file included from include/linux/printk.h:7,
                    from include/linux/kernel.h:15,
                    from include/linux/list.h:9,
                    from include/linux/mutex.h:15,
                    from drivers/block/blk-snap/common.h:11,
                    from drivers/block/blk-snap/cbt_map.c:3:
   drivers/block/blk-snap/cbt_map.c: In function 'cbt_map_allocate':
   include/linux/kern_levels.h:5:18: warning: format '%lu' expects argument of type 'long unsigned int', but argument 2 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
       5 | #define KERN_SOH "\001"  /* ASCII Start Of Header */
         |                  ^~~~~~
   include/linux/kern_levels.h:14:19: note: in expansion of macro 'KERN_SOH'
      14 | #define KERN_INFO KERN_SOH "6" /* informational */
         |                   ^~~~~~~~
   include/linux/printk.h:369:9: note: in expansion of macro 'KERN_INFO'
     369 |  printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
         |         ^~~~~~~~~
   drivers/block/blk-snap/cbt_map.c:15:2: note: in expansion of macro 'pr_info'
      15 |  pr_info("Allocate CBT map of %lu\n", cbt_map->map_size);
         |  ^~~~~~~
   include/linux/kern_levels.h:5:18: warning: format '%lu' expects argument of type 'long unsigned int', but argument 2 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
       5 | #define KERN_SOH "\001"  /* ASCII Start Of Header */
         |                  ^~~~~~
   include/linux/kern_levels.h:11:18: note: in expansion of macro 'KERN_SOH'
      11 | #define KERN_ERR KERN_SOH "3" /* error conditions */
         |                  ^~~~~~~~
   include/linux/printk.h:339:9: note: in expansion of macro 'KERN_ERR'
     339 |  printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
         |         ^~~~~~~~
   drivers/block/blk-snap/cbt_map.c:30:3: note: in expansion of macro 'pr_err'
      30 |   pr_err("Cannot allocate CBT map. map_size=%lu\n", cbt_map->map_size);
         |   ^~~~~~
   drivers/block/blk-snap/cbt_map.c: At top level:
>> drivers/block/blk-snap/cbt_map.c:45:6: warning: no previous prototype for 'cbt_map_deallocate' [-Wmissing-prototypes]
      45 | void cbt_map_deallocate(struct cbt_map *cbt_map)
         |      ^~~~~~~~~~~~~~~~~~
>> drivers/block/blk-snap/cbt_map.c:92:6: warning: no previous prototype for 'cbt_map_destroy_cb' [-Wmissing-prototypes]
      92 | void cbt_map_destroy_cb(struct kref *kref)
         |      ^~~~~~~~~~~~~~~~~~
>> drivers/block/blk-snap/cbt_map.c:132:5: warning: no previous prototype for '_cbt_map_set' [-Wmissing-prototypes]
     132 | int _cbt_map_set(struct cbt_map *cbt_map, sector_t sector_start, sector_t sector_cnt,
         |     ^~~~~~~~~~~~
   In file included from include/linux/printk.h:7,
                    from include/linux/kernel.h:15,
                    from include/linux/list.h:9,
                    from include/linux/mutex.h:15,
                    from drivers/block/blk-snap/common.h:11,
                    from drivers/block/blk-snap/cbt_map.c:3:
   drivers/block/blk-snap/cbt_map.c: In function '_cbt_map_set':
   include/linux/kern_levels.h:5:18: warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
       5 | #define KERN_SOH "\001"  /* ASCII Start Of Header */
         |                  ^~~~~~
   include/linux/kern_levels.h:11:18: note: in expansion of macro 'KERN_SOH'
      11 | #define KERN_ERR KERN_SOH "3" /* error conditions */
         |                  ^~~~~~~~
   include/linux/printk.h:339:9: note: in expansion of macro 'KERN_ERR'
     339 |  printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
         |         ^~~~~~~~
   drivers/block/blk-snap/cbt_map.c:153:4: note: in expansion of macro 'pr_err'
     153 |    pr_err("Block index is too large. #%ld was demanded, map size %ld\n",
         |    ^~~~~~
   include/linux/kern_levels.h:5:18: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
       5 | #define KERN_SOH "\001"  /* ASCII Start Of Header */
         |                  ^~~~~~
   include/linux/kern_levels.h:11:18: note: in expansion of macro 'KERN_SOH'
      11 | #define KERN_ERR KERN_SOH "3" /* error conditions */
         |                  ^~~~~~~~
   include/linux/printk.h:339:9: note: in expansion of macro 'KERN_ERR'
     339 |  printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
         |         ^~~~~~~~
   drivers/block/blk-snap/cbt_map.c:153:4: note: in expansion of macro 'pr_err'
     153 |    pr_err("Block index is too large. #%ld was demanded, map size %ld\n",
         |    ^~~~~~
   drivers/block/blk-snap/cbt_map.c: In function 'cbt_map_read_to_user':
   include/linux/kern_levels.h:5:18: warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
       5 | #define KERN_SOH "\001"  /* ASCII Start Of Header */
         |                  ^~~~~~
   include/linux/kern_levels.h:11:18: note: in expansion of macro 'KERN_SOH'
      11 | #define KERN_ERR KERN_SOH "3" /* error conditions */
         |                  ^~~~~~~~
   include/linux/printk.h:339:9: note: in expansion of macro 'KERN_ERR'
     339 |  printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
         |         ^~~~~~~~
   drivers/block/blk-snap/cbt_map.c:205:3: note: in expansion of macro 'pr_err'
     205 |   pr_err("Not all CBT data was read. Left [%ld] bytes\n", left_size);
         |   ^~~~~~
--
   In file included from include/linux/kernel.h:11,
                    from include/linux/list.h:9,
                    from include/linux/mutex.h:15,
                    from drivers/block/blk-snap/common.h:11,
                    from drivers/block/blk-snap/ctrl_fops.c:3:
   include/linux/scatterlist.h: In function 'sg_set_buf':
   arch/m68k/include/asm/page_mm.h:169:49: warning: ordered comparison of pointer with null pointer [-Wextra]
     169 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET && (void *)(kaddr) < high_memory)
         |                                                 ^~
   include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
      78 | # define unlikely(x) __builtin_expect(!!(x), 0)
         |                                          ^
   include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
     143 |  BUG_ON(!virt_addr_valid(buf));
         |  ^~~~~~
   include/linux/scatterlist.h:143:10: note: in expansion of macro 'virt_addr_valid'
     143 |  BUG_ON(!virt_addr_valid(buf));
         |          ^~~~~~~~~~~~~~~
   drivers/block/blk-snap/ctrl_fops.c: At top level:
>> drivers/block/blk-snap/ctrl_fops.c:140:5: warning: no previous prototype for 'ioctl_compatibility_flags' [-Wmissing-prototypes]
     140 | int ioctl_compatibility_flags(unsigned long arg)
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/block/blk-snap/ctrl_fops.c:159:5: warning: no previous prototype for 'ioctl_get_version' [-Wmissing-prototypes]
     159 | int ioctl_get_version(unsigned long arg)
         |     ^~~~~~~~~~~~~~~~~
>> drivers/block/blk-snap/ctrl_fops.c:174:5: warning: no previous prototype for 'ioctl_tracking_add' [-Wmissing-prototypes]
     174 | int ioctl_tracking_add(unsigned long arg)
         |     ^~~~~~~~~~~~~~~~~~
>> drivers/block/blk-snap/ctrl_fops.c:189:5: warning: no previous prototype for 'ioctl_tracking_remove' [-Wmissing-prototypes]
     189 | int ioctl_tracking_remove(unsigned long arg)
         |     ^~~~~~~~~~~~~~~~~~~~~
>> drivers/block/blk-snap/ctrl_fops.c:201:5: warning: no previous prototype for 'ioctl_tracking_collect' [-Wmissing-prototypes]
     201 | int ioctl_tracking_collect(unsigned long arg)
         |     ^~~~~~~~~~~~~~~~~~~~~~
>> drivers/block/blk-snap/ctrl_fops.c:264:5: warning: no previous prototype for 'ioctl_tracking_block_size' [-Wmissing-prototypes]
     264 | int ioctl_tracking_block_size(unsigned long arg)
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/block/blk-snap/ctrl_fops.c:277:5: warning: no previous prototype for 'ioctl_tracking_read_cbt_map' [-Wmissing-prototypes]
     277 | int ioctl_tracking_read_cbt_map(unsigned long arg)
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/block/blk-snap/ctrl_fops.c:295:5: warning: no previous prototype for 'ioctl_tracking_mark_dirty_blocks' [-Wmissing-prototypes]
     295 | int ioctl_tracking_mark_dirty_blocks(unsigned long arg)
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from include/linux/printk.h:7,
                    from include/linux/kernel.h:15,
                    from include/linux/list.h:9,
                    from include/linux/mutex.h:15,
                    from drivers/block/blk-snap/common.h:11,
                    from drivers/block/blk-snap/ctrl_fops.c:3:
   drivers/block/blk-snap/ctrl_fops.c: In function 'ioctl_tracking_mark_dirty_blocks':
   include/linux/kern_levels.h:5:18: warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
       5 | #define KERN_SOH "\001"  /* ASCII Start Of Header */
         |                  ^~~~~~
   include/linux/kern_levels.h:11:18: note: in expansion of macro 'KERN_SOH'
      11 | #define KERN_ERR KERN_SOH "3" /* error conditions */
         |                  ^~~~~~~~
   include/linux/printk.h:339:9: note: in expansion of macro 'KERN_ERR'
     339 |  printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
         |         ^~~~~~~~
   drivers/block/blk-snap/ctrl_fops.c:313:3: note: in expansion of macro 'pr_err'
     313 |   pr_err("Unable to mark dirty blocks: cannot allocate [%ld] bytes\n", buffer_size);
         |   ^~~~~~
   drivers/block/blk-snap/ctrl_fops.c: At top level:
>> drivers/block/blk-snap/ctrl_fops.c:335:5: warning: no previous prototype for 'ioctl_snapshot_create' [-Wmissing-prototypes]
     335 | int ioctl_snapshot_create(unsigned long arg)
         |     ^~~~~~~~~~~~~~~~~~~~~
   In file included from include/linux/printk.h:7,
                    from include/linux/kernel.h:15,
                    from include/linux/list.h:9,
                    from include/linux/mutex.h:15,
                    from drivers/block/blk-snap/common.h:11,
                    from drivers/block/blk-snap/ctrl_fops.c:3:
   drivers/block/blk-snap/ctrl_fops.c: In function 'ioctl_snapshot_create':
   include/linux/kern_levels.h:5:18: warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
       5 | #define KERN_SOH "\001"  /* ASCII Start Of Header */
         |                  ^~~~~~
   include/linux/kern_levels.h:11:18: note: in expansion of macro 'KERN_SOH'
      11 | #define KERN_ERR KERN_SOH "3" /* error conditions */
         |                  ^~~~~~~~
   include/linux/printk.h:339:9: note: in expansion of macro 'KERN_ERR'
     339 |  printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
         |         ^~~~~~~~
   drivers/block/blk-snap/ctrl_fops.c:352:3: note: in expansion of macro 'pr_err'
     352 |   pr_err("Unable to create snapshot: cannot allocate [%ld] bytes\n",
         |   ^~~~~~
   include/linux/kern_levels.h:5:18: warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
       5 | #define KERN_SOH "\001"  /* ASCII Start Of Header */
         |                  ^~~~~~
   include/linux/kern_levels.h:11:18: note: in expansion of macro 'KERN_SOH'
      11 | #define KERN_ERR KERN_SOH "3" /* error conditions */
         |                  ^~~~~~~~
   include/linux/printk.h:339:9: note: in expansion of macro 'KERN_ERR'
     339 |  printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
         |         ^~~~~~~~
   drivers/block/blk-snap/ctrl_fops.c:373:4: note: in expansion of macro 'pr_err'
     373 |    pr_err("Unable to create snapshot: cannot allocate [%ld] bytes\n",
         |    ^~~~~~
   drivers/block/blk-snap/ctrl_fops.c: At top level:
>> drivers/block/blk-snap/ctrl_fops.c:403:5: warning: no previous prototype for 'ioctl_snapshot_destroy' [-Wmissing-prototypes]
     403 | int ioctl_snapshot_destroy(unsigned long arg)
         |     ^~~~~~~~~~~~~~~~~~~~~~
>> drivers/block/blk-snap/ctrl_fops.c:428:5: warning: no previous prototype for 'ioctl_snapstore_create' [-Wmissing-prototypes]
     428 | int ioctl_snapstore_create(unsigned long arg)
         |     ^~~~~~~~~~~~~~~~~~~~~~
>> drivers/block/blk-snap/ctrl_fops.c:470:5: warning: no previous prototype for 'ioctl_snapstore_file' [-Wmissing-prototypes]
     470 | int ioctl_snapstore_file(unsigned long arg)
         |     ^~~~~~~~~~~~~~~~~~~~
   In file included from include/linux/printk.h:7,
                    from include/linux/kernel.h:15,
                    from include/linux/list.h:9,
                    from include/linux/mutex.h:15,
                    from drivers/block/blk-snap/common.h:11,
                    from drivers/block/blk-snap/ctrl_fops.c:3:
   drivers/block/blk-snap/ctrl_fops.c: In function 'ioctl_snapstore_file':
   include/linux/kern_levels.h:5:18: warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
       5 | #define KERN_SOH "\001"  /* ASCII Start Of Header */
         |                  ^~~~~~
   include/linux/kern_levels.h:11:18: note: in expansion of macro 'KERN_SOH'
      11 | #define KERN_ERR KERN_SOH "3" /* error conditions */
         |                  ^~~~~~~~
   include/linux/printk.h:339:9: note: in expansion of macro 'KERN_ERR'
     339 |  printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
         |         ^~~~~~~~
   drivers/block/blk-snap/ctrl_fops.c:488:3: note: in expansion of macro 'pr_err'
     488 |   pr_err("Unable to add file to snapstore: cannot allocate [%ld] bytes\n",
         |   ^~~~~~
   drivers/block/blk-snap/ctrl_fops.c: At top level:
>> drivers/block/blk-snap/ctrl_fops.c:506:5: warning: no previous prototype for 'ioctl_snapstore_memory' [-Wmissing-prototypes]
     506 | int ioctl_snapstore_memory(unsigned long arg)
         |     ^~~~~~~~~~~~~~~~~~~~~~
>> drivers/block/blk-snap/ctrl_fops.c:522:5: warning: no previous prototype for 'ioctl_snapstore_cleanup' [-Wmissing-prototypes]
     522 | int ioctl_snapstore_cleanup(unsigned long arg)
         |     ^~~~~~~~~~~~~~~~~~~~~~~
>> drivers/block/blk-snap/ctrl_fops.c:549:5: warning: no previous prototype for 'ioctl_snapstore_file_multidev' [-Wmissing-prototypes]
     549 | int ioctl_snapstore_file_multidev(unsigned long arg)
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from include/linux/printk.h:7,
                    from include/linux/kernel.h:15,
                    from include/linux/list.h:9,
                    from include/linux/mutex.h:15,
                    from drivers/block/blk-snap/common.h:11,
                    from drivers/block/blk-snap/ctrl_fops.c:3:
   drivers/block/blk-snap/ctrl_fops.c: In function 'ioctl_snapstore_file_multidev':
   include/linux/kern_levels.h:5:18: warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
       5 | #define KERN_SOH "\001"  /* ASCII Start Of Header */
         |                  ^~~~~~
   include/linux/kern_levels.h:11:18: note: in expansion of macro 'KERN_SOH'
      11 | #define KERN_ERR KERN_SOH "3" /* error conditions */
         |                  ^~~~~~~~
   include/linux/printk.h:339:9: note: in expansion of macro 'KERN_ERR'
     339 |  printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
         |         ^~~~~~~~
   drivers/block/blk-snap/ctrl_fops.c:568:3: note: in expansion of macro 'pr_err'
     568 |   pr_err("Unable to add file to multidev snapstore: cannot allocate [%ld] bytes\n",
         |   ^~~~~~
   drivers/block/blk-snap/ctrl_fops.c: At top level:
>> drivers/block/blk-snap/ctrl_fops.c:598:5: warning: no previous prototype for 'ioctl_snapshot_errno' [-Wmissing-prototypes]
     598 | int ioctl_snapshot_errno(unsigned long arg)
         |     ^~~~~~~~~~~~~~~~~~~~
>> drivers/block/blk-snap/ctrl_fops.c:625:5: warning: no previous prototype for 'ioctl_collect_snapimages' [-Wmissing-prototypes]
     625 | int ioctl_collect_snapimages(unsigned long arg)
         |     ^~~~~~~~~~~~~~~~~~~~~~~~
..

vim +/_blk_deferred_bio_alloc +140 drivers/block/blk-snap/blk_deferred.c

   139	
 > 140	struct bio *_blk_deferred_bio_alloc(int nr_iovecs)
   141	{
   142		struct bio *new_bio = bio_alloc_bioset(GFP_NOIO, nr_iovecs, &blk_deferred_bioset);
   143	
   144		if (new_bio == NULL)
   145			return NULL;
   146	
   147		new_bio->bi_end_io = blk_deferred_bio_endio;
   148		new_bio->bi_private = ((void *)new_bio) - sizeof(struct dio_bio_complete);
   149	
   150		return new_bio;
   151	}
   152	
   153	static void blk_deferred_complete(struct blk_deferred_request *dio_req, sector_t portion_sect_cnt,
   154					  int result)
   155	{
   156		atomic64_add(portion_sect_cnt, &dio_req->sect_processed);
   157	
   158		if (dio_req->sect_len == atomic64_read(&dio_req->sect_processed))
   159			complete(&dio_req->complete);
   160	
   161		if (result != SUCCESS) {
   162			dio_req->result = result;
   163			pr_err("Failed to process defer IO request. errno=%d\n", result);
   164		}
   165	}
   166	
   167	void blk_deferred_bio_endio(struct bio *bio)
   168	{
   169		int local_err;
   170		struct dio_bio_complete *complete_param = (struct dio_bio_complete *)bio->bi_private;
   171	
   172		if (complete_param == NULL) {
   173			//bio already complete
   174		} else {
   175			if (bio->bi_status != BLK_STS_OK)
   176				local_err = -EIO;
   177			else
   178				local_err = SUCCESS;
   179	
   180			blk_deferred_complete(complete_param->dio_req, complete_param->bio_sect_len,
   181					      local_err);
   182			bio->bi_private = NULL;
   183		}
   184	
   185		bio_put(bio);
   186	}
   187	
   188	static inline size_t _page_count_calculate(sector_t size_sector)
   189	{
   190		size_t page_count = size_sector / (PAGE_SIZE / SECTOR_SIZE);
   191	
   192		if (unlikely(size_sector & ((PAGE_SIZE / SECTOR_SIZE) - 1)))
   193			page_count += 1;
   194	
   195		return page_count;
   196	}
   197	
 > 198	sector_t _blk_deferred_submit_pages(struct block_device *blk_dev,
   199					    struct blk_deferred_request *dio_req, int direction,
   200					    sector_t arr_ofs, struct page **page_array, sector_t ofs_sector,
   201					    sector_t size_sector)
   202	{
   203		struct bio *bio = NULL;
   204		int nr_iovecs;
   205		int page_inx = arr_ofs >> (PAGE_SHIFT - SECTOR_SHIFT);
   206		sector_t process_sect = 0;
   207	
   208		nr_iovecs = _page_count_calculate(size_sector);
   209	
   210		while (NULL == (bio = _blk_deferred_bio_alloc(nr_iovecs))) {
   211			size_sector = (size_sector >> 1) & ~((PAGE_SIZE / SECTOR_SIZE) - 1);
   212			if (size_sector == 0)
   213				return 0;
   214	
   215			nr_iovecs = _page_count_calculate(size_sector);
   216		}
   217	
   218		bio_set_dev(bio, blk_dev);
   219	
   220		if (direction == READ)
   221			bio_set_op_attrs(bio, REQ_OP_READ, 0);
   222		else
   223			bio_set_op_attrs(bio, REQ_OP_WRITE, 0);
   224	
   225		bio->bi_iter.bi_sector = ofs_sector;
   226	
   227		{ //add first
   228			sector_t unordered = arr_ofs & ((PAGE_SIZE / SECTOR_SIZE) - 1);
   229			sector_t bvec_len_sect =
   230				min_t(sector_t, ((PAGE_SIZE / SECTOR_SIZE) - unordered), size_sector);
   231			struct page *page = page_array[page_inx];
   232			unsigned int len = (unsigned int)from_sectors(bvec_len_sect);
   233			unsigned int offset = (unsigned int)from_sectors(unordered);
   234	
   235			if (unlikely(page == NULL)) {
   236				pr_err("NULL found in page array");
   237				bio_put(bio);
   238				return 0;
   239			}
   240			if (unlikely(bio_add_page(bio, page, len, offset) != len)) {
   241				bio_put(bio);
   242				return 0;
   243			}
   244			++page_inx;
   245			process_sect += bvec_len_sect;
   246		}
   247	
   248		while (process_sect < size_sector) {
   249			sector_t bvec_len_sect =
   250				min_t(sector_t, (PAGE_SIZE / SECTOR_SIZE), (size_sector - process_sect));
   251			struct page *page = page_array[page_inx];
   252			unsigned int len = (unsigned int)from_sectors(bvec_len_sect);
   253	
   254	
   255			if (unlikely(page == NULL)) {
   256				pr_err("NULL found in page array");
   257				break;
   258			}
   259			if (unlikely(bio_add_page(bio, page, len, 0) != len))
   260				break;
   261	
   262			++page_inx;
   263			process_sect += bvec_len_sect;
   264		}
   265	
   266		((struct dio_bio_complete *)bio->bi_private)->dio_req = dio_req;
   267		((struct dio_bio_complete *)bio->bi_private)->bio_sect_len = process_sect;
   268	
   269		submit_bio(bio);
   270	
   271		return process_sect;
   272	}
   273	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 57841 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: Sergei Shtepa <sergei.shtepa@veeam.com>,
	axboe@kernel.dk, mchehab+huawei@kernel.org, davem@davemloft.net,
	robh@kernel.org, koct9i@gmail.com, damien.lemoal@wdc.com,
	jack@suse.cz, ming.lei@redhat.com, steve@sk2.org,
	linux-kernel@vger.kernel.org
Cc: kbuild-all@lists.01.org
Subject: Re: [PATCH 1/1] blk-snap - Block snapshot module This module implements snapshot and changed block tracking functionality. It is intended to create backup copies of any block devices without usage of device-mapper.
Date: Fri, 2 Oct 2020 23:49:44 +0800	[thread overview]
Message-ID: <202010022300.is4RAnI9-lkp@intel.com> (raw)
In-Reply-To: <1601643362-7370-2-git-send-email-sergei.shtepa@veeam.com>

[-- Attachment #1: Type: text/plain, Size: 30544 bytes --]

Hi Sergei,

I love your patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v5.9-rc7]
[cannot apply to block/for-next sparc-next/master next-20201002]
[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]

url:    https://github.com/0day-ci/linux/commits/Sergei-Shtepa/Block-snapshot-module-and-block-layer-filter-API/20201002-210406
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 472e5b056f000a778abb41f1e443de58eb259783
config: m68k-allmodconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/61a37e3bb74afbef1b725eaf80405e0e6e5d64b7
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Sergei-Shtepa/Block-snapshot-module-and-block-layer-filter-API/20201002-210406
        git checkout 61a37e3bb74afbef1b725eaf80405e0e6e5d64b7
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=m68k 

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

All warnings (new ones prefixed by >>):

   In file included from include/linux/kernel.h:11,
                    from include/linux/list.h:9,
                    from include/linux/mutex.h:15,
                    from drivers/block/blk-snap/common.h:11,
                    from drivers/block/blk-snap/blk_deferred.c:3:
   include/linux/scatterlist.h: In function 'sg_set_buf':
   arch/m68k/include/asm/page_mm.h:169:49: warning: ordered comparison of pointer with null pointer [-Wextra]
     169 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET && (void *)(kaddr) < high_memory)
         |                                                 ^~
   include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
      78 | # define unlikely(x) __builtin_expect(!!(x), 0)
         |                                          ^
   include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
     143 |  BUG_ON(!virt_addr_valid(buf));
         |  ^~~~~~
   include/linux/scatterlist.h:143:10: note: in expansion of macro 'virt_addr_valid'
     143 |  BUG_ON(!virt_addr_valid(buf));
         |          ^~~~~~~~~~~~~~~
   drivers/block/blk-snap/blk_deferred.c: At top level:
>> drivers/block/blk-snap/blk_deferred.c:140:13: warning: no previous prototype for '_blk_deferred_bio_alloc' [-Wmissing-prototypes]
     140 | struct bio *_blk_deferred_bio_alloc(int nr_iovecs)
         |             ^~~~~~~~~~~~~~~~~~~~~~~
>> drivers/block/blk-snap/blk_deferred.c:198:10: warning: no previous prototype for '_blk_deferred_submit_pages' [-Wmissing-prototypes]
     198 | sector_t _blk_deferred_submit_pages(struct block_device *blk_dev,
         |          ^~~~~~~~~~~~~~~~~~~~~~~~~~
--
   In file included from include/linux/kernel.h:11,
                    from include/linux/list.h:9,
                    from include/linux/mutex.h:15,
                    from drivers/block/blk-snap/common.h:11,
                    from drivers/block/blk-snap/blk_descr_file.c:3:
   include/linux/scatterlist.h: In function 'sg_set_buf':
   arch/m68k/include/asm/page_mm.h:169:49: warning: ordered comparison of pointer with null pointer [-Wextra]
     169 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET && (void *)(kaddr) < high_memory)
         |                                                 ^~
   include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
      78 | # define unlikely(x) __builtin_expect(!!(x), 0)
         |                                          ^
   include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
     143 |  BUG_ON(!virt_addr_valid(buf));
         |  ^~~~~~
   include/linux/scatterlist.h:143:10: note: in expansion of macro 'virt_addr_valid'
     143 |  BUG_ON(!virt_addr_valid(buf));
         |          ^~~~~~~~~~~~~~~
   drivers/block/blk-snap/blk_descr_file.c: At top level:
>> drivers/block/blk-snap/blk_descr_file.c:39:6: warning: no previous prototype for '_blk_descr_file_cleanup' [-Wmissing-prototypes]
      39 | void _blk_descr_file_cleanup(void *descr_array, size_t count)
         |      ^~~~~~~~~~~~~~~~~~~~~~~
--
   In file included from include/linux/kernel.h:11,
                    from include/linux/list.h:9,
                    from include/linux/mutex.h:15,
                    from drivers/block/blk-snap/common.h:11,
                    from drivers/block/blk-snap/blk_descr_mem.c:3:
   include/linux/scatterlist.h: In function 'sg_set_buf':
   arch/m68k/include/asm/page_mm.h:169:49: warning: ordered comparison of pointer with null pointer [-Wextra]
     169 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET && (void *)(kaddr) < high_memory)
         |                                                 ^~
   include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
      78 | # define unlikely(x) __builtin_expect(!!(x), 0)
         |                                          ^
   include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
     143 |  BUG_ON(!virt_addr_valid(buf));
         |  ^~~~~~
   include/linux/scatterlist.h:143:10: note: in expansion of macro 'virt_addr_valid'
     143 |  BUG_ON(!virt_addr_valid(buf));
         |          ^~~~~~~~~~~~~~~
   drivers/block/blk-snap/blk_descr_mem.c: At top level:
>> drivers/block/blk-snap/blk_descr_mem.c:23:6: warning: no previous prototype for 'blk_descr_mem_cleanup' [-Wmissing-prototypes]
      23 | void blk_descr_mem_cleanup(void *descr_array, size_t count)
         |      ^~~~~~~~~~~~~~~~~~~~~
--
   In file included from include/linux/kernel.h:11,
                    from include/linux/list.h:9,
                    from include/linux/mutex.h:15,
                    from drivers/block/blk-snap/common.h:11,
                    from drivers/block/blk-snap/blk_redirect.c:3:
   include/linux/scatterlist.h: In function 'sg_set_buf':
   arch/m68k/include/asm/page_mm.h:169:49: warning: ordered comparison of pointer with null pointer [-Wextra]
     169 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET && (void *)(kaddr) < high_memory)
         |                                                 ^~
   include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
      78 | # define unlikely(x) __builtin_expect(!!(x), 0)
         |                                          ^
   include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
     143 |  BUG_ON(!virt_addr_valid(buf));
         |  ^~~~~~
   include/linux/scatterlist.h:143:10: note: in expansion of macro 'virt_addr_valid'
     143 |  BUG_ON(!virt_addr_valid(buf));
         |          ^~~~~~~~~~~~~~~
   drivers/block/blk-snap/blk_redirect.c: At top level:
>> drivers/block/blk-snap/blk_redirect.c:44:13: warning: no previous prototype for '_blk_dev_redirect_bio_alloc' [-Wmissing-prototypes]
      44 | struct bio *_blk_dev_redirect_bio_alloc(int nr_iovecs, void *bi_private)
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/block/blk-snap/blk_redirect.c:58:31: warning: no previous prototype for '_redirect_bio_allocate_list' [-Wmissing-prototypes]
      58 | struct blk_redirect_bio_list *_redirect_bio_allocate_list(struct bio *new_bio)
         |                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/block/blk-snap/blk_redirect.c:72:5: warning: no previous prototype for 'bio_endio_list_push' [-Wmissing-prototypes]
      72 | int bio_endio_list_push(struct blk_redirect_bio *rq_redir, struct bio *new_bio)
         |     ^~~~~~~~~~~~~~~~~~~
>> drivers/block/blk-snap/blk_redirect.c:97:6: warning: no previous prototype for 'bio_endio_list_cleanup' [-Wmissing-prototypes]
      97 | void bio_endio_list_cleanup(struct blk_redirect_bio_list *curr)
         |      ^~~~~~~~~~~~~~~~~~~~~~
--
   In file included from include/linux/kernel.h:11,
                    from include/linux/list.h:9,
                    from include/linux/mutex.h:15,
                    from drivers/block/blk-snap/common.h:11,
                    from drivers/block/blk-snap/cbt_map.c:3:
   include/linux/scatterlist.h: In function 'sg_set_buf':
   arch/m68k/include/asm/page_mm.h:169:49: warning: ordered comparison of pointer with null pointer [-Wextra]
     169 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET && (void *)(kaddr) < high_memory)
         |                                                 ^~
   include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
      78 | # define unlikely(x) __builtin_expect(!!(x), 0)
         |                                          ^
   include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
     143 |  BUG_ON(!virt_addr_valid(buf));
         |  ^~~~~~
   include/linux/scatterlist.h:143:10: note: in expansion of macro 'virt_addr_valid'
     143 |  BUG_ON(!virt_addr_valid(buf));
         |          ^~~~~~~~~~~~~~~
   drivers/block/blk-snap/cbt_map.c: At top level:
>> drivers/block/blk-snap/cbt_map.c:6:5: warning: no previous prototype for 'cbt_map_allocate' [-Wmissing-prototypes]
       6 | int cbt_map_allocate(struct cbt_map *cbt_map, unsigned int cbt_sect_in_block_degree,
         |     ^~~~~~~~~~~~~~~~
   In file included from include/linux/printk.h:7,
                    from include/linux/kernel.h:15,
                    from include/linux/list.h:9,
                    from include/linux/mutex.h:15,
                    from drivers/block/blk-snap/common.h:11,
                    from drivers/block/blk-snap/cbt_map.c:3:
   drivers/block/blk-snap/cbt_map.c: In function 'cbt_map_allocate':
   include/linux/kern_levels.h:5:18: warning: format '%lu' expects argument of type 'long unsigned int', but argument 2 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
       5 | #define KERN_SOH "\001"  /* ASCII Start Of Header */
         |                  ^~~~~~
   include/linux/kern_levels.h:14:19: note: in expansion of macro 'KERN_SOH'
      14 | #define KERN_INFO KERN_SOH "6" /* informational */
         |                   ^~~~~~~~
   include/linux/printk.h:369:9: note: in expansion of macro 'KERN_INFO'
     369 |  printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
         |         ^~~~~~~~~
   drivers/block/blk-snap/cbt_map.c:15:2: note: in expansion of macro 'pr_info'
      15 |  pr_info("Allocate CBT map of %lu\n", cbt_map->map_size);
         |  ^~~~~~~
   include/linux/kern_levels.h:5:18: warning: format '%lu' expects argument of type 'long unsigned int', but argument 2 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
       5 | #define KERN_SOH "\001"  /* ASCII Start Of Header */
         |                  ^~~~~~
   include/linux/kern_levels.h:11:18: note: in expansion of macro 'KERN_SOH'
      11 | #define KERN_ERR KERN_SOH "3" /* error conditions */
         |                  ^~~~~~~~
   include/linux/printk.h:339:9: note: in expansion of macro 'KERN_ERR'
     339 |  printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
         |         ^~~~~~~~
   drivers/block/blk-snap/cbt_map.c:30:3: note: in expansion of macro 'pr_err'
      30 |   pr_err("Cannot allocate CBT map. map_size=%lu\n", cbt_map->map_size);
         |   ^~~~~~
   drivers/block/blk-snap/cbt_map.c: At top level:
>> drivers/block/blk-snap/cbt_map.c:45:6: warning: no previous prototype for 'cbt_map_deallocate' [-Wmissing-prototypes]
      45 | void cbt_map_deallocate(struct cbt_map *cbt_map)
         |      ^~~~~~~~~~~~~~~~~~
>> drivers/block/blk-snap/cbt_map.c:92:6: warning: no previous prototype for 'cbt_map_destroy_cb' [-Wmissing-prototypes]
      92 | void cbt_map_destroy_cb(struct kref *kref)
         |      ^~~~~~~~~~~~~~~~~~
>> drivers/block/blk-snap/cbt_map.c:132:5: warning: no previous prototype for '_cbt_map_set' [-Wmissing-prototypes]
     132 | int _cbt_map_set(struct cbt_map *cbt_map, sector_t sector_start, sector_t sector_cnt,
         |     ^~~~~~~~~~~~
   In file included from include/linux/printk.h:7,
                    from include/linux/kernel.h:15,
                    from include/linux/list.h:9,
                    from include/linux/mutex.h:15,
                    from drivers/block/blk-snap/common.h:11,
                    from drivers/block/blk-snap/cbt_map.c:3:
   drivers/block/blk-snap/cbt_map.c: In function '_cbt_map_set':
   include/linux/kern_levels.h:5:18: warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
       5 | #define KERN_SOH "\001"  /* ASCII Start Of Header */
         |                  ^~~~~~
   include/linux/kern_levels.h:11:18: note: in expansion of macro 'KERN_SOH'
      11 | #define KERN_ERR KERN_SOH "3" /* error conditions */
         |                  ^~~~~~~~
   include/linux/printk.h:339:9: note: in expansion of macro 'KERN_ERR'
     339 |  printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
         |         ^~~~~~~~
   drivers/block/blk-snap/cbt_map.c:153:4: note: in expansion of macro 'pr_err'
     153 |    pr_err("Block index is too large. #%ld was demanded, map size %ld\n",
         |    ^~~~~~
   include/linux/kern_levels.h:5:18: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
       5 | #define KERN_SOH "\001"  /* ASCII Start Of Header */
         |                  ^~~~~~
   include/linux/kern_levels.h:11:18: note: in expansion of macro 'KERN_SOH'
      11 | #define KERN_ERR KERN_SOH "3" /* error conditions */
         |                  ^~~~~~~~
   include/linux/printk.h:339:9: note: in expansion of macro 'KERN_ERR'
     339 |  printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
         |         ^~~~~~~~
   drivers/block/blk-snap/cbt_map.c:153:4: note: in expansion of macro 'pr_err'
     153 |    pr_err("Block index is too large. #%ld was demanded, map size %ld\n",
         |    ^~~~~~
   drivers/block/blk-snap/cbt_map.c: In function 'cbt_map_read_to_user':
   include/linux/kern_levels.h:5:18: warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
       5 | #define KERN_SOH "\001"  /* ASCII Start Of Header */
         |                  ^~~~~~
   include/linux/kern_levels.h:11:18: note: in expansion of macro 'KERN_SOH'
      11 | #define KERN_ERR KERN_SOH "3" /* error conditions */
         |                  ^~~~~~~~
   include/linux/printk.h:339:9: note: in expansion of macro 'KERN_ERR'
     339 |  printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
         |         ^~~~~~~~
   drivers/block/blk-snap/cbt_map.c:205:3: note: in expansion of macro 'pr_err'
     205 |   pr_err("Not all CBT data was read. Left [%ld] bytes\n", left_size);
         |   ^~~~~~
--
   In file included from include/linux/kernel.h:11,
                    from include/linux/list.h:9,
                    from include/linux/mutex.h:15,
                    from drivers/block/blk-snap/common.h:11,
                    from drivers/block/blk-snap/ctrl_fops.c:3:
   include/linux/scatterlist.h: In function 'sg_set_buf':
   arch/m68k/include/asm/page_mm.h:169:49: warning: ordered comparison of pointer with null pointer [-Wextra]
     169 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET && (void *)(kaddr) < high_memory)
         |                                                 ^~
   include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
      78 | # define unlikely(x) __builtin_expect(!!(x), 0)
         |                                          ^
   include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
     143 |  BUG_ON(!virt_addr_valid(buf));
         |  ^~~~~~
   include/linux/scatterlist.h:143:10: note: in expansion of macro 'virt_addr_valid'
     143 |  BUG_ON(!virt_addr_valid(buf));
         |          ^~~~~~~~~~~~~~~
   drivers/block/blk-snap/ctrl_fops.c: At top level:
>> drivers/block/blk-snap/ctrl_fops.c:140:5: warning: no previous prototype for 'ioctl_compatibility_flags' [-Wmissing-prototypes]
     140 | int ioctl_compatibility_flags(unsigned long arg)
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/block/blk-snap/ctrl_fops.c:159:5: warning: no previous prototype for 'ioctl_get_version' [-Wmissing-prototypes]
     159 | int ioctl_get_version(unsigned long arg)
         |     ^~~~~~~~~~~~~~~~~
>> drivers/block/blk-snap/ctrl_fops.c:174:5: warning: no previous prototype for 'ioctl_tracking_add' [-Wmissing-prototypes]
     174 | int ioctl_tracking_add(unsigned long arg)
         |     ^~~~~~~~~~~~~~~~~~
>> drivers/block/blk-snap/ctrl_fops.c:189:5: warning: no previous prototype for 'ioctl_tracking_remove' [-Wmissing-prototypes]
     189 | int ioctl_tracking_remove(unsigned long arg)
         |     ^~~~~~~~~~~~~~~~~~~~~
>> drivers/block/blk-snap/ctrl_fops.c:201:5: warning: no previous prototype for 'ioctl_tracking_collect' [-Wmissing-prototypes]
     201 | int ioctl_tracking_collect(unsigned long arg)
         |     ^~~~~~~~~~~~~~~~~~~~~~
>> drivers/block/blk-snap/ctrl_fops.c:264:5: warning: no previous prototype for 'ioctl_tracking_block_size' [-Wmissing-prototypes]
     264 | int ioctl_tracking_block_size(unsigned long arg)
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/block/blk-snap/ctrl_fops.c:277:5: warning: no previous prototype for 'ioctl_tracking_read_cbt_map' [-Wmissing-prototypes]
     277 | int ioctl_tracking_read_cbt_map(unsigned long arg)
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/block/blk-snap/ctrl_fops.c:295:5: warning: no previous prototype for 'ioctl_tracking_mark_dirty_blocks' [-Wmissing-prototypes]
     295 | int ioctl_tracking_mark_dirty_blocks(unsigned long arg)
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from include/linux/printk.h:7,
                    from include/linux/kernel.h:15,
                    from include/linux/list.h:9,
                    from include/linux/mutex.h:15,
                    from drivers/block/blk-snap/common.h:11,
                    from drivers/block/blk-snap/ctrl_fops.c:3:
   drivers/block/blk-snap/ctrl_fops.c: In function 'ioctl_tracking_mark_dirty_blocks':
   include/linux/kern_levels.h:5:18: warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
       5 | #define KERN_SOH "\001"  /* ASCII Start Of Header */
         |                  ^~~~~~
   include/linux/kern_levels.h:11:18: note: in expansion of macro 'KERN_SOH'
      11 | #define KERN_ERR KERN_SOH "3" /* error conditions */
         |                  ^~~~~~~~
   include/linux/printk.h:339:9: note: in expansion of macro 'KERN_ERR'
     339 |  printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
         |         ^~~~~~~~
   drivers/block/blk-snap/ctrl_fops.c:313:3: note: in expansion of macro 'pr_err'
     313 |   pr_err("Unable to mark dirty blocks: cannot allocate [%ld] bytes\n", buffer_size);
         |   ^~~~~~
   drivers/block/blk-snap/ctrl_fops.c: At top level:
>> drivers/block/blk-snap/ctrl_fops.c:335:5: warning: no previous prototype for 'ioctl_snapshot_create' [-Wmissing-prototypes]
     335 | int ioctl_snapshot_create(unsigned long arg)
         |     ^~~~~~~~~~~~~~~~~~~~~
   In file included from include/linux/printk.h:7,
                    from include/linux/kernel.h:15,
                    from include/linux/list.h:9,
                    from include/linux/mutex.h:15,
                    from drivers/block/blk-snap/common.h:11,
                    from drivers/block/blk-snap/ctrl_fops.c:3:
   drivers/block/blk-snap/ctrl_fops.c: In function 'ioctl_snapshot_create':
   include/linux/kern_levels.h:5:18: warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
       5 | #define KERN_SOH "\001"  /* ASCII Start Of Header */
         |                  ^~~~~~
   include/linux/kern_levels.h:11:18: note: in expansion of macro 'KERN_SOH'
      11 | #define KERN_ERR KERN_SOH "3" /* error conditions */
         |                  ^~~~~~~~
   include/linux/printk.h:339:9: note: in expansion of macro 'KERN_ERR'
     339 |  printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
         |         ^~~~~~~~
   drivers/block/blk-snap/ctrl_fops.c:352:3: note: in expansion of macro 'pr_err'
     352 |   pr_err("Unable to create snapshot: cannot allocate [%ld] bytes\n",
         |   ^~~~~~
   include/linux/kern_levels.h:5:18: warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
       5 | #define KERN_SOH "\001"  /* ASCII Start Of Header */
         |                  ^~~~~~
   include/linux/kern_levels.h:11:18: note: in expansion of macro 'KERN_SOH'
      11 | #define KERN_ERR KERN_SOH "3" /* error conditions */
         |                  ^~~~~~~~
   include/linux/printk.h:339:9: note: in expansion of macro 'KERN_ERR'
     339 |  printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
         |         ^~~~~~~~
   drivers/block/blk-snap/ctrl_fops.c:373:4: note: in expansion of macro 'pr_err'
     373 |    pr_err("Unable to create snapshot: cannot allocate [%ld] bytes\n",
         |    ^~~~~~
   drivers/block/blk-snap/ctrl_fops.c: At top level:
>> drivers/block/blk-snap/ctrl_fops.c:403:5: warning: no previous prototype for 'ioctl_snapshot_destroy' [-Wmissing-prototypes]
     403 | int ioctl_snapshot_destroy(unsigned long arg)
         |     ^~~~~~~~~~~~~~~~~~~~~~
>> drivers/block/blk-snap/ctrl_fops.c:428:5: warning: no previous prototype for 'ioctl_snapstore_create' [-Wmissing-prototypes]
     428 | int ioctl_snapstore_create(unsigned long arg)
         |     ^~~~~~~~~~~~~~~~~~~~~~
>> drivers/block/blk-snap/ctrl_fops.c:470:5: warning: no previous prototype for 'ioctl_snapstore_file' [-Wmissing-prototypes]
     470 | int ioctl_snapstore_file(unsigned long arg)
         |     ^~~~~~~~~~~~~~~~~~~~
   In file included from include/linux/printk.h:7,
                    from include/linux/kernel.h:15,
                    from include/linux/list.h:9,
                    from include/linux/mutex.h:15,
                    from drivers/block/blk-snap/common.h:11,
                    from drivers/block/blk-snap/ctrl_fops.c:3:
   drivers/block/blk-snap/ctrl_fops.c: In function 'ioctl_snapstore_file':
   include/linux/kern_levels.h:5:18: warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
       5 | #define KERN_SOH "\001"  /* ASCII Start Of Header */
         |                  ^~~~~~
   include/linux/kern_levels.h:11:18: note: in expansion of macro 'KERN_SOH'
      11 | #define KERN_ERR KERN_SOH "3" /* error conditions */
         |                  ^~~~~~~~
   include/linux/printk.h:339:9: note: in expansion of macro 'KERN_ERR'
     339 |  printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
         |         ^~~~~~~~
   drivers/block/blk-snap/ctrl_fops.c:488:3: note: in expansion of macro 'pr_err'
     488 |   pr_err("Unable to add file to snapstore: cannot allocate [%ld] bytes\n",
         |   ^~~~~~
   drivers/block/blk-snap/ctrl_fops.c: At top level:
>> drivers/block/blk-snap/ctrl_fops.c:506:5: warning: no previous prototype for 'ioctl_snapstore_memory' [-Wmissing-prototypes]
     506 | int ioctl_snapstore_memory(unsigned long arg)
         |     ^~~~~~~~~~~~~~~~~~~~~~
>> drivers/block/blk-snap/ctrl_fops.c:522:5: warning: no previous prototype for 'ioctl_snapstore_cleanup' [-Wmissing-prototypes]
     522 | int ioctl_snapstore_cleanup(unsigned long arg)
         |     ^~~~~~~~~~~~~~~~~~~~~~~
>> drivers/block/blk-snap/ctrl_fops.c:549:5: warning: no previous prototype for 'ioctl_snapstore_file_multidev' [-Wmissing-prototypes]
     549 | int ioctl_snapstore_file_multidev(unsigned long arg)
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from include/linux/printk.h:7,
                    from include/linux/kernel.h:15,
                    from include/linux/list.h:9,
                    from include/linux/mutex.h:15,
                    from drivers/block/blk-snap/common.h:11,
                    from drivers/block/blk-snap/ctrl_fops.c:3:
   drivers/block/blk-snap/ctrl_fops.c: In function 'ioctl_snapstore_file_multidev':
   include/linux/kern_levels.h:5:18: warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
       5 | #define KERN_SOH "\001"  /* ASCII Start Of Header */
         |                  ^~~~~~
   include/linux/kern_levels.h:11:18: note: in expansion of macro 'KERN_SOH'
      11 | #define KERN_ERR KERN_SOH "3" /* error conditions */
         |                  ^~~~~~~~
   include/linux/printk.h:339:9: note: in expansion of macro 'KERN_ERR'
     339 |  printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
         |         ^~~~~~~~
   drivers/block/blk-snap/ctrl_fops.c:568:3: note: in expansion of macro 'pr_err'
     568 |   pr_err("Unable to add file to multidev snapstore: cannot allocate [%ld] bytes\n",
         |   ^~~~~~
   drivers/block/blk-snap/ctrl_fops.c: At top level:
>> drivers/block/blk-snap/ctrl_fops.c:598:5: warning: no previous prototype for 'ioctl_snapshot_errno' [-Wmissing-prototypes]
     598 | int ioctl_snapshot_errno(unsigned long arg)
         |     ^~~~~~~~~~~~~~~~~~~~
>> drivers/block/blk-snap/ctrl_fops.c:625:5: warning: no previous prototype for 'ioctl_collect_snapimages' [-Wmissing-prototypes]
     625 | int ioctl_collect_snapimages(unsigned long arg)
         |     ^~~~~~~~~~~~~~~~~~~~~~~~
..

vim +/_blk_deferred_bio_alloc +140 drivers/block/blk-snap/blk_deferred.c

   139	
 > 140	struct bio *_blk_deferred_bio_alloc(int nr_iovecs)
   141	{
   142		struct bio *new_bio = bio_alloc_bioset(GFP_NOIO, nr_iovecs, &blk_deferred_bioset);
   143	
   144		if (new_bio == NULL)
   145			return NULL;
   146	
   147		new_bio->bi_end_io = blk_deferred_bio_endio;
   148		new_bio->bi_private = ((void *)new_bio) - sizeof(struct dio_bio_complete);
   149	
   150		return new_bio;
   151	}
   152	
   153	static void blk_deferred_complete(struct blk_deferred_request *dio_req, sector_t portion_sect_cnt,
   154					  int result)
   155	{
   156		atomic64_add(portion_sect_cnt, &dio_req->sect_processed);
   157	
   158		if (dio_req->sect_len == atomic64_read(&dio_req->sect_processed))
   159			complete(&dio_req->complete);
   160	
   161		if (result != SUCCESS) {
   162			dio_req->result = result;
   163			pr_err("Failed to process defer IO request. errno=%d\n", result);
   164		}
   165	}
   166	
   167	void blk_deferred_bio_endio(struct bio *bio)
   168	{
   169		int local_err;
   170		struct dio_bio_complete *complete_param = (struct dio_bio_complete *)bio->bi_private;
   171	
   172		if (complete_param == NULL) {
   173			//bio already complete
   174		} else {
   175			if (bio->bi_status != BLK_STS_OK)
   176				local_err = -EIO;
   177			else
   178				local_err = SUCCESS;
   179	
   180			blk_deferred_complete(complete_param->dio_req, complete_param->bio_sect_len,
   181					      local_err);
   182			bio->bi_private = NULL;
   183		}
   184	
   185		bio_put(bio);
   186	}
   187	
   188	static inline size_t _page_count_calculate(sector_t size_sector)
   189	{
   190		size_t page_count = size_sector / (PAGE_SIZE / SECTOR_SIZE);
   191	
   192		if (unlikely(size_sector & ((PAGE_SIZE / SECTOR_SIZE) - 1)))
   193			page_count += 1;
   194	
   195		return page_count;
   196	}
   197	
 > 198	sector_t _blk_deferred_submit_pages(struct block_device *blk_dev,
   199					    struct blk_deferred_request *dio_req, int direction,
   200					    sector_t arr_ofs, struct page **page_array, sector_t ofs_sector,
   201					    sector_t size_sector)
   202	{
   203		struct bio *bio = NULL;
   204		int nr_iovecs;
   205		int page_inx = arr_ofs >> (PAGE_SHIFT - SECTOR_SHIFT);
   206		sector_t process_sect = 0;
   207	
   208		nr_iovecs = _page_count_calculate(size_sector);
   209	
   210		while (NULL == (bio = _blk_deferred_bio_alloc(nr_iovecs))) {
   211			size_sector = (size_sector >> 1) & ~((PAGE_SIZE / SECTOR_SIZE) - 1);
   212			if (size_sector == 0)
   213				return 0;
   214	
   215			nr_iovecs = _page_count_calculate(size_sector);
   216		}
   217	
   218		bio_set_dev(bio, blk_dev);
   219	
   220		if (direction == READ)
   221			bio_set_op_attrs(bio, REQ_OP_READ, 0);
   222		else
   223			bio_set_op_attrs(bio, REQ_OP_WRITE, 0);
   224	
   225		bio->bi_iter.bi_sector = ofs_sector;
   226	
   227		{ //add first
   228			sector_t unordered = arr_ofs & ((PAGE_SIZE / SECTOR_SIZE) - 1);
   229			sector_t bvec_len_sect =
   230				min_t(sector_t, ((PAGE_SIZE / SECTOR_SIZE) - unordered), size_sector);
   231			struct page *page = page_array[page_inx];
   232			unsigned int len = (unsigned int)from_sectors(bvec_len_sect);
   233			unsigned int offset = (unsigned int)from_sectors(unordered);
   234	
   235			if (unlikely(page == NULL)) {
   236				pr_err("NULL found in page array");
   237				bio_put(bio);
   238				return 0;
   239			}
   240			if (unlikely(bio_add_page(bio, page, len, offset) != len)) {
   241				bio_put(bio);
   242				return 0;
   243			}
   244			++page_inx;
   245			process_sect += bvec_len_sect;
   246		}
   247	
   248		while (process_sect < size_sector) {
   249			sector_t bvec_len_sect =
   250				min_t(sector_t, (PAGE_SIZE / SECTOR_SIZE), (size_sector - process_sect));
   251			struct page *page = page_array[page_inx];
   252			unsigned int len = (unsigned int)from_sectors(bvec_len_sect);
   253	
   254	
   255			if (unlikely(page == NULL)) {
   256				pr_err("NULL found in page array");
   257				break;
   258			}
   259			if (unlikely(bio_add_page(bio, page, len, 0) != len))
   260				break;
   261	
   262			++page_inx;
   263			process_sect += bvec_len_sect;
   264		}
   265	
   266		((struct dio_bio_complete *)bio->bi_private)->dio_req = dio_req;
   267		((struct dio_bio_complete *)bio->bi_private)->bio_sect_len = process_sect;
   268	
   269		submit_bio(bio);
   270	
   271		return process_sect;
   272	}
   273	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 57841 bytes --]

  reply	other threads:[~2020-10-02 15:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-02 12:56 [PATCH 0/1] Block snapshot module and block layer filter API Sergei Shtepa
2020-10-02 12:56 ` [PATCH 1/1] blk-snap - Block snapshot module This module implements snapshot and changed block tracking functionality. It is intended to create backup copies of any block devices without usage of device-mapper Sergei Shtepa
2020-10-02 15:49   ` kernel test robot [this message]
2020-10-02 15:49     ` kernel test robot
2020-10-02 16:23   ` kernel test robot
2020-10-02 16:23     ` kernel test robot
     [not found]   ` <CALYGNiORw=DrKxoaoQPJP8TNM-S_W0Zdtpvra_eMs+Ri5f2P-g@mail.gmail.com>
2020-10-06  8:43     ` Sergei Shtepa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202010022300.is4RAnI9-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.