diff -Nru dm-writeboost-2.2.9/debian/changelog dm-writeboost-2.2.9/debian/changelog --- dm-writeboost-2.2.9/debian/changelog 2021-04-29 15:07:23.000000000 +0000 +++ dm-writeboost-2.2.9/debian/changelog 2021-06-17 07:35:05.000000000 +0000 @@ -1,3 +1,11 @@ +dm-writeboost (2.2.9-1ubuntu1.3) focal; urgency=medium + + * Linux 5.11 compatibility (LP: #1932257): + - debian/patches/0004-Fix-Linux-5.9-build-remove-uninitialized_var-usage.patch + - debian/patches/0005-Linux-5.11-accomodate-part_stat_read-argument-change.patch + + -- Andrea Righi Thu, 17 Jun 2021 07:35:05 +0000 + dm-writeboost (2.2.9-1ubuntu1.2) focal; urgency=medium * No change rebuild in security pocket. LP: #1914279. diff -Nru dm-writeboost-2.2.9/debian/patches/0004-Fix-Linux-5.9-build-remove-uninitialized_var-usage.patch dm-writeboost-2.2.9/debian/patches/0004-Fix-Linux-5.9-build-remove-uninitialized_var-usage.patch --- dm-writeboost-2.2.9/debian/patches/0004-Fix-Linux-5.9-build-remove-uninitialized_var-usage.patch 1970-01-01 00:00:00.000000000 +0000 +++ dm-writeboost-2.2.9/debian/patches/0004-Fix-Linux-5.9-build-remove-uninitialized_var-usage.patch 2021-06-17 07:33:08.000000000 +0000 @@ -0,0 +1,30 @@ +From: Paolo Pisati +Subject: Fix Linux 5.9 build: remove uninitialized_var() usage + +It's dangerous, can hide real bugs and suppress compiler warnings (see also +63a0895d960a "compiler: Remove uninitialized_var() macroi") and it has been +retired upstream in 5.9. + +Signed-off-by: Paolo Pisati +Origin: upstream, https://github.com/akiradeveloper/dm-writeboost +Author: Paolo Pisati +--- + src/dm-writeboost-metadata.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/dm-writeboost-metadata.c b/src/dm-writeboost-metadata.c +index 4cc1a1f..3e8e8c2 100644 +--- a/src/dm-writeboost-metadata.c ++++ b/src/dm-writeboost-metadata.c +@@ -981,7 +981,7 @@ static int infer_last_writeback_id(struct wb_device *wb) + u64 inferred_last_writeback_id; + u64 record_id; + +- struct superblock_record_device uninitialized_var(record); ++ struct superblock_record_device record; + err = read_superblock_record(&record, wb); + if (err) + return err; +-- +2.31.1 + diff -Nru dm-writeboost-2.2.9/debian/patches/0005-Linux-5.11-accomodate-part_stat_read-argument-change.patch dm-writeboost-2.2.9/debian/patches/0005-Linux-5.11-accomodate-part_stat_read-argument-change.patch --- dm-writeboost-2.2.9/debian/patches/0005-Linux-5.11-accomodate-part_stat_read-argument-change.patch 1970-01-01 00:00:00.000000000 +0000 +++ dm-writeboost-2.2.9/debian/patches/0005-Linux-5.11-accomodate-part_stat_read-argument-change.patch 2021-06-17 07:33:14.000000000 +0000 @@ -0,0 +1,36 @@ +From: Paolo Pisati +Subject: Linux 5.11: accomodate part_stat_read() argument change + +Signed-off-by: Paolo Pisati +Origin: upstream, https://github.com/akiradeveloper/dm-writeboost +Author: Paolo Pisati +--- + src/dm-writeboost-daemon.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/src/dm-writeboost-daemon.c b/src/dm-writeboost-daemon.c +index 4166823..b51f488 100644 +--- a/src/dm-writeboost-daemon.c ++++ b/src/dm-writeboost-daemon.c +@@ -481,12 +481,16 @@ int writeback_modulator_proc(void *data) + { + struct wb_device *wb = data; + +- struct hd_struct *hd = wb->backing_dev->bdev->bd_part; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0) ++ struct block_device *part = wb->backing_dev->bdev; ++#else ++ struct hd_struct *part = wb->backing_dev->bdev->bd_part; ++#endif + unsigned long old = 0, new, util; + unsigned long intvl = 1000; + + while (!kthread_should_stop()) { +- new = jiffies_to_msecs(part_stat_read(hd, io_ticks)); ++ new = jiffies_to_msecs(part_stat_read(part, io_ticks)); + + util = div_u64(100 * (new - old), 1000); + +-- +2.31.1 + diff -Nru dm-writeboost-2.2.9/debian/patches/series dm-writeboost-2.2.9/debian/patches/series --- dm-writeboost-2.2.9/debian/patches/series 2020-10-13 09:29:19.000000000 +0000 +++ dm-writeboost-2.2.9/debian/patches/series 2021-06-17 07:33:14.000000000 +0000 @@ -2,3 +2,5 @@ 0001-Fix-calling-dm_kcopyd_zero-on-linux-4.19 0002-fix-missing-stat-header.patch 0003-Fix-Linux-5.8-build-gc-error-parameter-from-blkdev_i.patch +0005-Linux-5.11-accomodate-part_stat_read-argument-change.patch +0004-Fix-Linux-5.9-build-remove-uninitialized_var-usage.patch