All of lore.kernel.org
 help / color / mirror / Atom feed
* [dm:for-next 29/30] drivers//md/dm-clone-target.c:563:14: error: implicit declaration of function 'vmalloc'; did you mean 'kmalloc'?
@ 2019-09-11 16:03 kbuild test robot
  2019-09-11 18:22 ` Mike Snitzer
  0 siblings, 1 reply; 4+ messages in thread
From: kbuild test robot @ 2019-09-11 16:03 UTC (permalink / raw)
  To: Nikos Tsironis; +Cc: dm-devel, kbuild-all, Mike Snitzer, Ilias Tsitsimpis

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

tree:   https://kernel.googlesource.com/pub/scm/linux/kernel/git/device-mapper/linux-dm.git for-next
head:   509818079bf1fefff4ed02d6a1b994e20efc0480
commit: 1529a543debdf75fb26e7ecd732da0cc36f78a36 [29/30] dm: add clone target
config: sparc64-allmodconfig (attached as .config)
compiler: sparc64-linux-gcc (GCC) 7.4.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout 1529a543debdf75fb26e7ecd732da0cc36f78a36
        # save the attached .config to linux build tree
        GCC_VERSION=7.4.0 make.cross ARCH=sparc64 

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

All error/warnings (new ones prefixed by >>):

   drivers//md/dm-clone-target.c: In function 'hash_table_init':
>> drivers//md/dm-clone-target.c:563:14: error: implicit declaration of function 'vmalloc'; did you mean 'kmalloc'? [-Werror=implicit-function-declaration]
     clone->ht = vmalloc(sz * sizeof(struct hash_table_bucket));
                 ^~~~~~~
                 kmalloc
>> drivers//md/dm-clone-target.c:563:12: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     clone->ht = vmalloc(sz * sizeof(struct hash_table_bucket));
               ^
   drivers//md/dm-clone-target.c: In function 'hash_table_exit':
>> drivers//md/dm-clone-target.c:579:2: error: implicit declaration of function 'vfree'; did you mean 'kfree'? [-Werror=implicit-function-declaration]
     vfree(clone->ht);
     ^~~~~
     kfree
   cc1: some warnings being treated as errors
--
   drivers//md/dm-clone-metadata.c: In function 'dirty_map_init':
>> drivers//md/dm-clone-metadata.c:466:28: error: implicit declaration of function 'vzalloc'; did you mean 'kvzalloc'? [-Werror=implicit-function-declaration]
     md->dmap[0].dirty_words = vzalloc(bitmap_size(md->nr_words));
                               ^~~~~~~
                               kvzalloc
>> drivers//md/dm-clone-metadata.c:466:26: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     md->dmap[0].dirty_words = vzalloc(bitmap_size(md->nr_words));
                             ^
   drivers//md/dm-clone-metadata.c:474:26: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     md->dmap[1].dirty_words = vzalloc(bitmap_size(md->nr_words));
                             ^
>> drivers//md/dm-clone-metadata.c:478:3: error: implicit declaration of function 'vfree'; did you mean 'kvfree'? [-Werror=implicit-function-declaration]
      vfree(md->dmap[0].dirty_words);
      ^~~~~
      kvfree
   drivers//md/dm-clone-metadata.c: In function 'dm_clone_metadata_open':
>> drivers//md/dm-clone-metadata.c:553:19: error: implicit declaration of function 'vmalloc'; did you mean 'kvmalloc'? [-Werror=implicit-function-declaration]
     md->region_map = vmalloc(bitmap_size(md->nr_regions));
                      ^~~~~~~
                      kvmalloc
   drivers//md/dm-clone-metadata.c:553:17: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     md->region_map = vmalloc(bitmap_size(md->nr_regions));
                    ^
   cc1: some warnings being treated as errors

vim +563 drivers//md/dm-clone-target.c

   549	
   550	#define bucket_lock_irqsave(bucket, flags) \
   551		spin_lock_irqsave(&(bucket)->lock, flags)
   552	
   553	#define bucket_unlock_irqrestore(bucket, flags) \
   554		spin_unlock_irqrestore(&(bucket)->lock, flags)
   555	
   556	static int hash_table_init(struct clone *clone)
   557	{
   558		unsigned int i, sz;
   559		struct hash_table_bucket *bucket;
   560	
   561		sz = 1 << HASH_TABLE_BITS;
   562	
 > 563		clone->ht = vmalloc(sz * sizeof(struct hash_table_bucket));
   564		if (!clone->ht)
   565			return -ENOMEM;
   566	
   567		for (i = 0; i < sz; i++) {
   568			bucket = clone->ht + i;
   569	
   570			INIT_HLIST_HEAD(&bucket->head);
   571			spin_lock_init(&bucket->lock);
   572		}
   573	
   574		return 0;
   575	}
   576	
   577	static void hash_table_exit(struct clone *clone)
   578	{
 > 579		vfree(clone->ht);
   580	}
   581	

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

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

[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dm:for-next 29/30] drivers//md/dm-clone-target.c:563:14: error: implicit declaration of function 'vmalloc'; did you mean 'kmalloc'?
  2019-09-11 16:03 [dm:for-next 29/30] drivers//md/dm-clone-target.c:563:14: error: implicit declaration of function 'vmalloc'; did you mean 'kmalloc'? kbuild test robot
@ 2019-09-11 18:22 ` Mike Snitzer
  2019-09-11 18:46   ` Nikos Tsironis
  0 siblings, 1 reply; 4+ messages in thread
From: Mike Snitzer @ 2019-09-11 18:22 UTC (permalink / raw)
  To: kbuild test robot; +Cc: dm-devel, Ilias Tsitsimpis, Nikos Tsironis, kbuild-all


I resolved this and pushed new code, thanks!

On Wed, Sep 11 2019 at 12:03pm -0400,
kbuild test robot <lkp@intel.com> wrote:

> tree:   https://kernel.googlesource.com/pub/scm/linux/kernel/git/device-mapper/linux-dm.git for-next
> head:   509818079bf1fefff4ed02d6a1b994e20efc0480
> commit: 1529a543debdf75fb26e7ecd732da0cc36f78a36 [29/30] dm: add clone target
> config: sparc64-allmodconfig (attached as .config)
> compiler: sparc64-linux-gcc (GCC) 7.4.0
> reproduce:
>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         git checkout 1529a543debdf75fb26e7ecd732da0cc36f78a36
>         # save the attached .config to linux build tree
>         GCC_VERSION=7.4.0 make.cross ARCH=sparc64 
> 
> If you fix the issue, kindly add following tag
> Reported-by: kbuild test robot <lkp@intel.com>
> 
> All error/warnings (new ones prefixed by >>):
> 
>    drivers//md/dm-clone-target.c: In function 'hash_table_init':
> >> drivers//md/dm-clone-target.c:563:14: error: implicit declaration of function 'vmalloc'; did you mean 'kmalloc'? [-Werror=implicit-function-declaration]
>      clone->ht = vmalloc(sz * sizeof(struct hash_table_bucket));
>                  ^~~~~~~
>                  kmalloc
> >> drivers//md/dm-clone-target.c:563:12: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
>      clone->ht = vmalloc(sz * sizeof(struct hash_table_bucket));
>                ^
>    drivers//md/dm-clone-target.c: In function 'hash_table_exit':
> >> drivers//md/dm-clone-target.c:579:2: error: implicit declaration of function 'vfree'; did you mean 'kfree'? [-Werror=implicit-function-declaration]
>      vfree(clone->ht);
>      ^~~~~
>      kfree
>    cc1: some warnings being treated as errors
> --
>    drivers//md/dm-clone-metadata.c: In function 'dirty_map_init':
> >> drivers//md/dm-clone-metadata.c:466:28: error: implicit declaration of function 'vzalloc'; did you mean 'kvzalloc'? [-Werror=implicit-function-declaration]
>      md->dmap[0].dirty_words = vzalloc(bitmap_size(md->nr_words));
>                                ^~~~~~~
>                                kvzalloc
> >> drivers//md/dm-clone-metadata.c:466:26: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
>      md->dmap[0].dirty_words = vzalloc(bitmap_size(md->nr_words));
>                              ^
>    drivers//md/dm-clone-metadata.c:474:26: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
>      md->dmap[1].dirty_words = vzalloc(bitmap_size(md->nr_words));
>                              ^
> >> drivers//md/dm-clone-metadata.c:478:3: error: implicit declaration of function 'vfree'; did you mean 'kvfree'? [-Werror=implicit-function-declaration]
>       vfree(md->dmap[0].dirty_words);
>       ^~~~~
>       kvfree
>    drivers//md/dm-clone-metadata.c: In function 'dm_clone_metadata_open':
> >> drivers//md/dm-clone-metadata.c:553:19: error: implicit declaration of function 'vmalloc'; did you mean 'kvmalloc'? [-Werror=implicit-function-declaration]
>      md->region_map = vmalloc(bitmap_size(md->nr_regions));
>                       ^~~~~~~
>                       kvmalloc
>    drivers//md/dm-clone-metadata.c:553:17: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
>      md->region_map = vmalloc(bitmap_size(md->nr_regions));
>                     ^
>    cc1: some warnings being treated as errors
> 
> vim +563 drivers//md/dm-clone-target.c
> 
>    549	
>    550	#define bucket_lock_irqsave(bucket, flags) \
>    551		spin_lock_irqsave(&(bucket)->lock, flags)
>    552	
>    553	#define bucket_unlock_irqrestore(bucket, flags) \
>    554		spin_unlock_irqrestore(&(bucket)->lock, flags)
>    555	
>    556	static int hash_table_init(struct clone *clone)
>    557	{
>    558		unsigned int i, sz;
>    559		struct hash_table_bucket *bucket;
>    560	
>    561		sz = 1 << HASH_TABLE_BITS;
>    562	
>  > 563		clone->ht = vmalloc(sz * sizeof(struct hash_table_bucket));
>    564		if (!clone->ht)
>    565			return -ENOMEM;
>    566	
>    567		for (i = 0; i < sz; i++) {
>    568			bucket = clone->ht + i;
>    569	
>    570			INIT_HLIST_HEAD(&bucket->head);
>    571			spin_lock_init(&bucket->lock);
>    572		}
>    573	
>    574		return 0;
>    575	}
>    576	
>    577	static void hash_table_exit(struct clone *clone)
>    578	{
>  > 579		vfree(clone->ht);
>    580	}
>    581	
> 
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dm:for-next 29/30] drivers//md/dm-clone-target.c:563:14: error: implicit declaration of function 'vmalloc'; did you mean 'kmalloc'?
  2019-09-11 18:22 ` Mike Snitzer
@ 2019-09-11 18:46   ` Nikos Tsironis
  2019-09-11 20:22     ` Mike Snitzer
  0 siblings, 1 reply; 4+ messages in thread
From: Nikos Tsironis @ 2019-09-11 18:46 UTC (permalink / raw)
  To: Mike Snitzer, kbuild test robot; +Cc: dm-devel, kbuild-all, Ilias Tsitsimpis

On 9/11/19 9:22 PM, Mike Snitzer wrote:> 
> I resolved this and pushed new code, thanks!
> 

Hi Mike,

I just saw the report and was about to fix it, but I noticed you have
already fixed it. Thanks a lot.

I had forgotten to include the header file for vmalloc(), but I saw you
used kvmalloc(), which is even better.

I took a quick look at the diff and there are a few places that still
need fixing:

drivers/md/dm-clone-target.c:563: clone->ht = vmalloc(sz *sizeof(struct hash_table_bucket));
drivers/md/dm-clone-target.c:579: vfree(clone->ht);

Also, the allocation of cmd->region_map is done with kvmalloc(), but the
deallocation is still done with vfree():

drivers/md/dm-clone-metadata.c:597: vfree(cmd->region_map);

I will be away from keyboard for the rest of the day, but I will take a
closer look at the diff tomorrow and I will send a new version fixing
these and any other issues I might find.

Thanks,
Nikos.

> On Wed, Sep 11 2019 at 12:03pm -0400,
> kbuild test robot <lkp@intel.com> wrote:
> 
>> tree:   https://kernel.googlesource.com/pub/scm/linux/kernel/git/device-mapper/linux-dm.git for-next
>> head:   509818079bf1fefff4ed02d6a1b994e20efc0480
>> commit: 1529a543debdf75fb26e7ecd732da0cc36f78a36 [29/30] dm: add clone target
>> config: sparc64-allmodconfig (attached as .config)
>> compiler: sparc64-linux-gcc (GCC) 7.4.0
>> reproduce:
>>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>>         chmod +x ~/bin/make.cross
>>         git checkout 1529a543debdf75fb26e7ecd732da0cc36f78a36
>>         # save the attached .config to linux build tree
>>         GCC_VERSION=7.4.0 make.cross ARCH=sparc64 
>>
>> If you fix the issue, kindly add following tag
>> Reported-by: kbuild test robot <lkp@intel.com>
>>
>> All error/warnings (new ones prefixed by >>):
>>
>>    drivers//md/dm-clone-target.c: In function 'hash_table_init':
>>>> drivers//md/dm-clone-target.c:563:14: error: implicit declaration of function 'vmalloc'; did you mean 'kmalloc'? [-Werror=implicit-function-declaration]
>>      clone->ht = vmalloc(sz * sizeof(struct hash_table_bucket));
>>                  ^~~~~~~
>>                  kmalloc
>>>> drivers//md/dm-clone-target.c:563:12: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
>>      clone->ht = vmalloc(sz * sizeof(struct hash_table_bucket));
>>                ^
>>    drivers//md/dm-clone-target.c: In function 'hash_table_exit':
>>>> drivers//md/dm-clone-target.c:579:2: error: implicit declaration of function 'vfree'; did you mean 'kfree'? [-Werror=implicit-function-declaration]
>>      vfree(clone->ht);
>>      ^~~~~
>>      kfree
>>    cc1: some warnings being treated as errors
>> --
>>    drivers//md/dm-clone-metadata.c: In function 'dirty_map_init':
>>>> drivers//md/dm-clone-metadata.c:466:28: error: implicit declaration of function 'vzalloc'; did you mean 'kvzalloc'? [-Werror=implicit-function-declaration]
>>      md->dmap[0].dirty_words = vzalloc(bitmap_size(md->nr_words));
>>                                ^~~~~~~
>>                                kvzalloc
>>>> drivers//md/dm-clone-metadata.c:466:26: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
>>      md->dmap[0].dirty_words = vzalloc(bitmap_size(md->nr_words));
>>                              ^
>>    drivers//md/dm-clone-metadata.c:474:26: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
>>      md->dmap[1].dirty_words = vzalloc(bitmap_size(md->nr_words));
>>                              ^
>>>> drivers//md/dm-clone-metadata.c:478:3: error: implicit declaration of function 'vfree'; did you mean 'kvfree'? [-Werror=implicit-function-declaration]
>>       vfree(md->dmap[0].dirty_words);
>>       ^~~~~
>>       kvfree
>>    drivers//md/dm-clone-metadata.c: In function 'dm_clone_metadata_open':
>>>> drivers//md/dm-clone-metadata.c:553:19: error: implicit declaration of function 'vmalloc'; did you mean 'kvmalloc'? [-Werror=implicit-function-declaration]
>>      md->region_map = vmalloc(bitmap_size(md->nr_regions));
>>                       ^~~~~~~
>>                       kvmalloc
>>    drivers//md/dm-clone-metadata.c:553:17: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
>>      md->region_map = vmalloc(bitmap_size(md->nr_regions));
>>                     ^
>>    cc1: some warnings being treated as errors
>>
>> vim +563 drivers//md/dm-clone-target.c
>>
>>    549	
>>    550	#define bucket_lock_irqsave(bucket, flags) \
>>    551		spin_lock_irqsave(&(bucket)->lock, flags)
>>    552	
>>    553	#define bucket_unlock_irqrestore(bucket, flags) \
>>    554		spin_unlock_irqrestore(&(bucket)->lock, flags)
>>    555	
>>    556	static int hash_table_init(struct clone *clone)
>>    557	{
>>    558		unsigned int i, sz;
>>    559		struct hash_table_bucket *bucket;
>>    560	
>>    561		sz = 1 << HASH_TABLE_BITS;
>>    562	
>>  > 563		clone->ht = vmalloc(sz * sizeof(struct hash_table_bucket));
>>    564		if (!clone->ht)
>>    565			return -ENOMEM;
>>    566	
>>    567		for (i = 0; i < sz; i++) {
>>    568			bucket = clone->ht + i;
>>    569	
>>    570			INIT_HLIST_HEAD(&bucket->head);
>>    571			spin_lock_init(&bucket->lock);
>>    572		}
>>    573	
>>    574		return 0;
>>    575	}
>>    576	
>>    577	static void hash_table_exit(struct clone *clone)
>>    578	{
>>  > 579		vfree(clone->ht);
>>    580	}
>>    581	
>>
>> ---
>> 0-DAY kernel test infrastructure                Open Source Technology Center
>> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
> 
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dm:for-next 29/30] drivers//md/dm-clone-target.c:563:14: error: implicit declaration of function 'vmalloc'; did you mean 'kmalloc'?
  2019-09-11 18:46   ` Nikos Tsironis
@ 2019-09-11 20:22     ` Mike Snitzer
  0 siblings, 0 replies; 4+ messages in thread
From: Mike Snitzer @ 2019-09-11 20:22 UTC (permalink / raw)
  To: Nikos Tsironis; +Cc: dm-devel, Ilias Tsitsimpis, kbuild test robot, kbuild-all

On Wed, Sep 11 2019 at  2:46pm -0400,
Nikos Tsironis <ntsironis@arrikto.com> wrote:

> On 9/11/19 9:22 PM, Mike Snitzer wrote:> 
> > I resolved this and pushed new code, thanks!
> > 
> 
> Hi Mike,
> 
> I just saw the report and was about to fix it, but I noticed you have
> already fixed it. Thanks a lot.
> 
> I had forgotten to include the header file for vmalloc(), but I saw you
> used kvmalloc(), which is even better.
> 
> I took a quick look at the diff and there are a few places that still
> need fixing:
> 
> drivers/md/dm-clone-target.c:563: clone->ht = vmalloc(sz *sizeof(struct hash_table_bucket));
> drivers/md/dm-clone-target.c:579: vfree(clone->ht);
> 
> Also, the allocation of cmd->region_map is done with kvmalloc(), but the
> deallocation is still done with vfree():
> 
> drivers/md/dm-clone-metadata.c:597: vfree(cmd->region_map);
> 
> I will be away from keyboard for the rest of the day, but I will take a
> closer look at the diff tomorrow and I will send a new version fixing
> these and any other issues I might find.

I fixed the above up, thanks.

Please just send any incremental patches relative to what I have staged
now.

Mike

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-09-11 20:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-11 16:03 [dm:for-next 29/30] drivers//md/dm-clone-target.c:563:14: error: implicit declaration of function 'vmalloc'; did you mean 'kmalloc'? kbuild test robot
2019-09-11 18:22 ` Mike Snitzer
2019-09-11 18:46   ` Nikos Tsironis
2019-09-11 20:22     ` Mike Snitzer

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.