veeam / blksnap

Nonpersistent block device snapshot with block-level change-tracking capabilities.
GNU General Public License v2.0
84 stars 22 forks source link

[Solved] Unable to build on Fedora 38 with kernel 6.5.8-200.fc38.x86_64 #70

Closed kkovaletp closed 1 year ago

kkovaletp commented 1 year ago

Distribution

Fedora 38

Architecture

amd64

Kernel version

6.5.8-200.fc38.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Oct 20 15:53:48 UTC 2023 x86_64 GNU/Linux

Blksnap version

commit b019208054dba7076e81dfe01c72c6b3631c203d and kernel module from same commit

Bug description

I'm new here, as I'm faced with the blksnap installation issue onto Fedora 38 with kernel 6.5.8, dkms 3.0.12-1 according to the Veeam Agent installation guide: it failed on post-install build with errors like the same, I'm faced with now. I found in the Veeam community recommendation to try to build blksnap from sources, so I tried and got the same issue. I simply cloned master and followed the guide, running ./mk.sh build from module folder, but got next errors:

Making ...
make: вход в каталог «/usr/src/kernels/6.5.8-200.fc38.x86_64»
CC [M]  /home/kkoval/.veeam-blksnap-src/module/diff_area.o
CC [M]  /home/kkoval/.veeam-blksnap-src/module/diff_storage.o
CC [M]  /home/kkoval/.veeam-blksnap-src/module/main.o
CC [M]  /home/kkoval/.veeam-blksnap-src/module/snapimage.o
In file included from ./include/linux/highmem.h:5,
from ./include/linux/bvec.h:10,
from ./include/linux/blk_types.h:10,
from ./include/linux/blkdev.h:9,
from /home/kkoval/.veeam-blksnap-src/module/diff_area.c:7:
/home/kkoval/.veeam-blksnap-src/module/diff_area.c: В функции «diff_area_free»:
./include/linux/fs.h:111:33: предупреждение: при передаче аргумента 2 «blkdev_put» целое преобразуется в указатель без приведения типа [-Wint-conversion]
111 | #define FMODE_READ              ((__force fmode_t)0x1)
|                                 ^
|                                 |
|                                 unsigned int
/home/kkoval/.veeam-blksnap-src/module/diff_area.c:124:50: замечание: в расширении макроса «FMODE_READ»
124 |                 blkdev_put(diff_area->orig_bdev, FMODE_READ | FMODE_WRITE);
|                                                  ^~~~~~~~~~
./include/linux/blkdev.h:1481:50: замечание: ожидался тип «void *», но аргумент имеет тип «unsigned int»
1481 | void blkdev_put(struct block_device *bdev, void *holder);
|                                            ~~~~~~^~~~~~
/home/kkoval/.veeam-blksnap-src/module/diff_area.c: В функции «diff_area_new»:
/home/kkoval/.veeam-blksnap-src/module/diff_area.c:239:16: ошибка: слишком мало аргументов в вызове функции «blkdev_get_by_dev»
239 |         bdev = blkdev_get_by_dev(dev_id, FMODE_READ | FMODE_WRITE, NULL);
|                ^~~~~~~~~~~~~~~~~
./include/linux/blkdev.h:1474:22: замечание: объявлено здесь
1474 | struct block_device *blkdev_get_by_dev(dev_t dev, blk_mode_t mode, void *holder,
|                      ^~~~~~~~~~~~~~~~~
./include/linux/fs.h:111:33: предупреждение: при передаче аргумента 2 «blkdev_put» целое преобразуется в указатель без приведения типа [-Wint-conversion]
111 | #define FMODE_READ              ((__force fmode_t)0x1)
|                                 ^
|                                 |
|                                 unsigned int
/home/kkoval/.veeam-blksnap-src/module/diff_area.c:249:34: замечание: в расширении макроса «FMODE_READ»
249 |                 blkdev_put(bdev, FMODE_READ | FMODE_WRITE);
|                                  ^~~~~~~~~~
./include/linux/blkdev.h:1481:50: замечание: ожидался тип «void *», но аргумент имеет тип «unsigned int»
1481 | void blkdev_put(struct block_device *bdev, void *holder);
|                                            ~~~~~~^~~~~~
make[2]: *** [scripts/Makefile.build:243: /home/kkoval/.veeam-blksnap-src/module/diff_area.o] Ошибка 1
make[2]: *** Ожидание завершения заданий…
/home/kkoval/.veeam-blksnap-src/module/main.c:23:9: замечание: «#pragma message: Standalone bdevfilter»
23 | #pragma message("Standalone bdevfilter")
|         ^~~~~~~
/home/kkoval/.veeam-blksnap-src/module/main.c:29:9: замечание: «#pragma message: The void submit_bio_noacct(struct bio *) function was found.»
29 | #pragma message("The void submit_bio_noacct(struct bio *) function was found.")
|         ^~~~~~~
/home/kkoval/.veeam-blksnap-src/module/main.c:35:9: замечание: «#pragma message: The struct bio have pointer to struct block_device.»
35 | #pragma message("The struct bio have pointer to struct block_device.")
|         ^~~~~~~
/home/kkoval/.veeam-blksnap-src/module/main.c:41:9: замечание: «#pragma message: The bdev_nr_sectors() function was found.»
41 | #pragma message("The bdev_nr_sectors() function was found.")
|         ^~~~~~~
/home/kkoval/.veeam-blksnap-src/module/main.c:44:9: замечание: «#pragma message: The blk_alloc_disk() function was found.»
44 | #pragma message("The blk_alloc_disk() function was found.")
|         ^~~~~~~
/home/kkoval/.veeam-blksnap-src/module/main.c:50:9: замечание: «#pragma message: The function add_disk() has a return code.»
50 | #pragma message("The function add_disk() has a return code.")
|         ^~~~~~~
/home/kkoval/.veeam-blksnap-src/module/main.c:56:9: замечание: «#pragma message: The function bio_alloc_bioset() has a parameter bdev.»
56 | #pragma message("The function bio_alloc_bioset() has a parameter bdev.")
|         ^~~~~~~
In file included from ./include/linux/highmem.h:5,
from ./include/linux/bvec.h:10,
from ./include/linux/blk_types.h:10,
from /home/kkoval/.veeam-blksnap-src/module/chunk.h:5,
from /home/kkoval/.veeam-blksnap-src/module/diff_storage.c:14:
/home/kkoval/.veeam-blksnap-src/module/diff_storage.c: В функции «diff_storage_free»:
./include/linux/fs.h:111:33: предупреждение: при передаче аргумента 2 «blkdev_put» целое преобразуется в указатель без приведения типа [-Wint-conversion]
111 | #define FMODE_READ              ((__force fmode_t)0x1)
|                                 ^
|                                 |
|                                 unsigned int
/home/kkoval/.veeam-blksnap-src/module/diff_storage.c:142:48: замечание: в расширении макроса «FMODE_READ»
142 |                 blkdev_put(storage_bdev->bdev, FMODE_READ | FMODE_WRITE);
|                                                ^~~~~~~~~~
In file included from /home/kkoval/.veeam-blksnap-src/module/chunk.h:6:
./include/linux/blkdev.h:1481:50: замечание: ожидался тип «void *», но аргумент имеет тип «unsigned int»
1481 | void blkdev_put(struct block_device *bdev, void *holder);
|                                            ~~~~~~^~~~~~
/home/kkoval/.veeam-blksnap-src/module/diff_storage.c: В функции «diff_storage_add_storage_bdev»:
/home/kkoval/.veeam-blksnap-src/module/diff_storage.c:177:16: ошибка: слишком мало аргументов в вызове функции «blkdev_get_by_dev»
177 |         bdev = blkdev_get_by_dev(dev_id, FMODE_READ | FMODE_WRITE, NULL);
|                ^~~~~~~~~~~~~~~~~
./include/linux/blkdev.h:1474:22: замечание: объявлено здесь
1474 | struct block_device *blkdev_get_by_dev(dev_t dev, blk_mode_t mode, void *holder,
|                      ^~~~~~~~~~~~~~~~~
./include/linux/fs.h:111:33: предупреждение: при передаче аргумента 2 «blkdev_put» целое преобразуется в указатель без приведения типа [-Wint-conversion]
111 | #define FMODE_READ              ((__force fmode_t)0x1)
|                                 ^
|                                 |
|                                 unsigned int
/home/kkoval/.veeam-blksnap-src/module/diff_storage.c:186:34: замечание: в расширении макроса «FMODE_READ»
186 |                 blkdev_put(bdev, FMODE_READ | FMODE_WRITE);
|                                  ^~~~~~~~~~
./include/linux/blkdev.h:1481:50: замечание: ожидался тип «void *», но аргумент имеет тип «unsigned int»
1481 | void blkdev_put(struct block_device *bdev, void *holder);
|                                            ~~~~~~^~~~~~
make[2]: *** [scripts/Makefile.build:243: /home/kkoval/.veeam-blksnap-src/module/diff_storage.o] Ошибка 1
make[1]: *** [/usr/src/kernels/6.5.8-200.fc38.x86_64/Makefile:2046: /home/kkoval/.veeam-blksnap-src/module] Ошибка 2
make: *** [Makefile:246: __sub-make] Ошибка 2
make: выход из каталога «/usr/src/kernels/6.5.8-200.fc38.x86_64»

Steps to reproduce

Expected behavior

Dnf-distributed blksnap installs successfully including post-install step. Master branch is built and installed successfully without any errors.

Additional informations

Sorry if I ask something obvious - I'm new here and just try to install the Veeam Agent on my system somehow, so it works with snapshots correctly. Feel free to ask me some more questions if I missed to provide some important details. Feel free to point me to the detailed guide on how to build and install the project on my system successfully if I did the wrong actions.

Fantu commented 1 year ago

hi, unfortunately, as I have already seen, several new users are confused by the current state of the master branch which is no longer updated and I have prepared a PR about it: https://github.com/veeam/blksnap/pull/68 recent changes for upstream required interface and other big changes that made incompatible with first version, latest works require kernel 6.6 + latest patches from Sergei git and blksnap latest commits of branch stable-2.0

in your case using veeam agent for linux 6.0 you need build kernel module latest commit from VAL-6.0 branch that added kernel 6.5 support

SergeiShtepa commented 1 year ago

Yep. That's just the way it is. If you use the package Veeam Agent 6.0.3, you can contact Veeam support. In this case, you will be offered to update the package of the blksnap module, the source code of which is located in the VAL-6.0 branch. The code from the VAL-6.1 branch has not yet passed the full testing cycle and is not considered stable yet. It is not compatible with Veeam Agent 6.0.3. The name of the module has been changed.

kkovaletp commented 1 year ago

@Fantu thanks a lot for the quick reply with helpful tip!

I've successfully built and installed the module, after which I successfully made 1st volume-level backup and then mounted it for recovery to double-check that it is correct.

It solved my problem, so thanks!

The readme in the Master is definitely confusing. It has to contain some clear instructions of users, like me, to find the right branch for the OS + kernel version and veeam version.

While the issue is in fact solved, I'd not close it, as it is a typical one, so users might easily find it in the list of open issues of the repo. But if it is not the right practice in the repo, feel free to close it.

Fantu commented 1 year ago

@SergeiShtepa merged today my PR that added an header with note to help users now I tried to do a fast PR with improvement: https://github.com/veeam/blksnap/pull/71 @kkovaletp any opinion or advice to improve it is welcome keeping the bug open after the README has been improved is not necessary, users can carry out a search quickly and easily including closed bugs (and it seems very logical to me to also search in closed ones to have the greatest probability of a solution)