datto / dattobd

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

cannot build in old kernel: error: ‘struct bio’ has no member named ‘bi_blkg’ #295

Open zjuchenyuan opened 1 year ago

zjuchenyuan commented 1 year ago
#uname -a
Linux f2 4.15.0-200-generic #211-Ubuntu SMP Thu Nov 24 18:16:04 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

#make
...
  CC [M]  /root/dattobd/src/bio_helper.o
/root/dattobd/src/bio_helper.c: In function ‘bio_make_read_clone’:
/root/dattobd/src/bio_helper.c:705:23: error: ‘struct bio’ has no member named ‘bi_blkg’; did you mean ‘bi_flags’?
         if (orig_bio->bi_blkg) {
                       ^~~~~~~
                       bi_flags
/root/dattobd/src/bio_helper.c:706:36: error: ‘struct bio’ has no member named ‘bi_blkg’; did you mean ‘bi_flags’?
                 blkg_get(orig_bio->bi_blkg);
                                    ^~~~~~~
                                    bi_flags
/root/dattobd/src/bio_helper.c:707:26: error: ‘struct bio’ has no member named ‘bi_blkg’; did you mean ‘bi_flags’?
                 new_bio->bi_blkg = orig_bio->bi_blkg;
                          ^~~~~~~
                          bi_flags
/root/dattobd/src/bio_helper.c:707:46: error: ‘struct bio’ has no member named ‘bi_blkg’; did you mean ‘bi_flags’?
                 new_bio->bi_blkg = orig_bio->bi_blkg;
                                              ^~~~~~~
                                              bi_flags
scripts/Makefile.build:333: recipe for target '/root/dattobd/src/bio_helper.o' failed
make[3]: *** [/root/dattobd/src/bio_helper.o] Error 1
Makefile:1594: recipe for target '_module_/root/dattobd/src' failed
make[2]: *** [_module_/root/dattobd/src] Error 2
make[2]: Leaving directory '/usr/src/linux-headers-4.15.0-200-generic'
Makefile:16: recipe for target 'default' failed
make[1]: *** [default] Error 2
make[1]: Leaving directory '/root/dattobd/src'
Makefile:24: recipe for target 'driver' failed
make: *** [driver] Error 2
dakotarwilliams commented 1 year ago

Can you verify that #296 fixes this?