datto / dattobd

kernel module for taking block-level snapshots and incremental backups of Linux block devices
GNU General Public License v2.0
576 stars 122 forks source link

fix build failed in old ubuntu #347

Closed hongyuntw closed 2 months ago

hongyuntw commented 10 months ago

If (void)rq is not added during compilation, an unused warning will appear. However, in the src/configure-tests/feature-tests/Makefile, the Werror flag is included, causing the feature not to be tested. Consequently, this leads to the module using unexpected parameters for blk_alloc_queue.

Currently, the issue is observed in older kernel versions, such as Fedora 30 (5.6.13-100.fc30.x86_64) and Ubuntu 16 (4.4.0-186-generic).

Swistusmen commented 10 months ago

Thank you for this contribution, can you please tell how did you detect this? Are there any signs from the site of given OSes that such an error occurs? We aren't testing on fedora at all, and if it comes to ubuntu we put bigger pressure on newer ones

hongyuntw commented 9 months ago

Hi, I discovered this issue during simple testing to ensure that this module functions correctly on different operating systems. I didn't observe any specific indicators. Thank you.

hongyuntw commented 9 months ago

In addition, I later discovered an additional issue on Ubuntu 16 (4.4.0-186-generic). In this version of the kernel, the feature testing does not define HAVE_BIO_BI_OPFand HAVE_ENUM_REQ_OP. Therefore, an additional conditional statement should be added to avoid compile errors due to redefinition of dattobd_set_bio_ops.

The issue may stem from this PR, but I am not entirely certain about the problem the PR intends to address. Based on my understanding, both HAVE_BIO_BI_OPFand HAVE_ENUM_REQ_OPflags are used to check for a kernel version >= 4.8. Therefore, my current fix may not necessarily be the best solution, and it's even possible that only one of the dattobd_set_bio_ops is needed.

Swistusmen commented 9 months ago

Thank you for your input, we will take care about it asap, but for now we're dealing with 1 issue and need to stop for a sec

iamandrii commented 2 months ago

Hi, @hongyuntw! Thanks you for contributing to DattoBD! Described problem was fixed within #382 so I close the PR.