[v2,20/21] block, blksnap: adds a blksnap to the kernel tree

Message ID 20221209142331.26395-21-sergei.shtepa@veeam.com
State New
Headers
Series blksnap - block devices snapshots module |

Commit Message

Sergei Shtepa Dec. 9, 2022, 2:23 p.m. UTC
  Signed-off-by: Sergei Shtepa <sergei.shtepa@veeam.com>
---
 drivers/block/Kconfig  | 2 ++
 drivers/block/Makefile | 2 ++
 2 files changed, 4 insertions(+)
  

Comments

kernel test robot Dec. 9, 2022, 9:53 p.m. UTC | #1
Hi Sergei,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on axboe-block/for-next]
[also build test ERROR on linus/master v6.1-rc8 next-20221208]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Sergei-Shtepa/blksnap-block-devices-snapshots-module/20221209-231603
base:   https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git for-next
patch link:    https://lore.kernel.org/r/20221209142331.26395-21-sergei.shtepa%40veeam.com
patch subject: [PATCH v2 20/21] block, blksnap: adds a blksnap to the kernel tree
config: arm-randconfig-r035-20221210
compiler: arm-linux-gnueabi-gcc (GCC) 12.1.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/intel-lab-lkp/linux/commit/79aebb9891b15d1de8770c4fc61f73bc5e251b04
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Sergei-Shtepa/blksnap-block-devices-snapshots-module/20221209-231603
        git checkout 79aebb9891b15d1de8770c4fc61f73bc5e251b04
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash drivers/block/blksnap/

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

All errors (new ones prefixed by >>):

   drivers/block/blksnap/ctrl.c: In function 'ctrl_init':
>> drivers/block/blksnap/ctrl.c:45:45: error: invalid use of undefined type 'struct module'
      45 |         ret = register_chrdev(0, THIS_MODULE->name, &ctrl_fops);
         |                                             ^~
   drivers/block/blksnap/ctrl.c: In function 'ctrl_done':
   drivers/block/blksnap/ctrl.c:61:54: error: invalid use of undefined type 'struct module'
      61 |         unregister_chrdev(blk_snap_major, THIS_MODULE->name);
         |                                                      ^~
--
   In file included from include/linux/device.h:31,
                    from include/linux/blk_types.h:11,
                    from include/linux/blkdev.h:9,
                    from drivers/block/blksnap/sysfs.c:5:
   drivers/block/blksnap/sysfs.c: In function 'sysfs_initialize':
>> drivers/block/blksnap/sysfs.c:31:63: error: invalid use of undefined type 'struct module'
      31 |         blk_snap_class = class_create(THIS_MODULE, THIS_MODULE->name);
         |                                                               ^~
   include/linux/device/class.h:276:31: note: in definition of macro 'class_create'
     276 |         __class_create(owner, name, &__key);    \
         |                               ^~~~
   drivers/block/blksnap/sysfs.c:51:40: error: invalid use of undefined type 'struct module'
      51 |                             THIS_MODULE->name);
         |                                        ^~


vim +45 drivers/block/blksnap/ctrl.c

2c91bb136c2522 Sergei Shtepa 2022-12-09  40  
2c91bb136c2522 Sergei Shtepa 2022-12-09  41  int ctrl_init(void)
2c91bb136c2522 Sergei Shtepa 2022-12-09  42  {
2c91bb136c2522 Sergei Shtepa 2022-12-09  43  	int ret;
2c91bb136c2522 Sergei Shtepa 2022-12-09  44  
2c91bb136c2522 Sergei Shtepa 2022-12-09 @45  	ret = register_chrdev(0, THIS_MODULE->name, &ctrl_fops);
2c91bb136c2522 Sergei Shtepa 2022-12-09  46  	if (ret < 0) {
2c91bb136c2522 Sergei Shtepa 2022-12-09  47  		pr_err("Failed to register a character device. errno=%d\n",
2c91bb136c2522 Sergei Shtepa 2022-12-09  48  		       abs(blk_snap_major));
2c91bb136c2522 Sergei Shtepa 2022-12-09  49  		return ret;
2c91bb136c2522 Sergei Shtepa 2022-12-09  50  	}
2c91bb136c2522 Sergei Shtepa 2022-12-09  51  
2c91bb136c2522 Sergei Shtepa 2022-12-09  52  	blk_snap_major = ret;
2c91bb136c2522 Sergei Shtepa 2022-12-09  53  	pr_info("Register control device [%d:0].\n", blk_snap_major);
2c91bb136c2522 Sergei Shtepa 2022-12-09  54  	return 0;
2c91bb136c2522 Sergei Shtepa 2022-12-09  55  }
2c91bb136c2522 Sergei Shtepa 2022-12-09  56
  

Patch

diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig
index a41145d52de9..81304bfdc30c 100644
--- a/drivers/block/Kconfig
+++ b/drivers/block/Kconfig
@@ -416,4 +416,6 @@  config BLK_DEV_UBLK
 
 source "drivers/block/rnbd/Kconfig"
 
+source "drivers/block/blksnap/Kconfig"
+
 endif # BLK_DEV
diff --git a/drivers/block/Makefile b/drivers/block/Makefile
index 101612cba303..8414c47960c2 100644
--- a/drivers/block/Makefile
+++ b/drivers/block/Makefile
@@ -40,3 +40,5 @@  obj-$(CONFIG_BLK_DEV_NULL_BLK)	+= null_blk/
 obj-$(CONFIG_BLK_DEV_UBLK)			+= ublk_drv.o
 
 swim_mod-y	:= swim.o swim_asm.o
+
+obj-$(CONFIG_BLK_SNAP) += blksnap/