diff -Nru dm-writeboost-2.2.8/ChangeLog dm-writeboost-2.2.9/ChangeLog --- dm-writeboost-2.2.8/ChangeLog 2017-10-15 13:30:54.000000000 +0000 +++ dm-writeboost-2.2.9/ChangeLog 2018-06-09 14:14:54.000000000 +0000 @@ -1,3 +1,9 @@ +2018-06-09 Akira Hayakawa + + * v2.2.9 + * Fix build error with 4.15 kernel + * Fix build error with 4.17 kernel + 2017-10-15 Akira Hayakawa * v2.2.8 diff -Nru dm-writeboost-2.2.8/debian/changelog dm-writeboost-2.2.9/debian/changelog --- dm-writeboost-2.2.8/debian/changelog 2018-05-25 14:30:11.000000000 +0000 +++ dm-writeboost-2.2.9/debian/changelog 2018-11-07 22:41:49.000000000 +0000 @@ -1,3 +1,21 @@ +dm-writeboost (2.2.9-1ubuntu1) disco; urgency=low + + * Merge from Debian unstable. Remaining changes: + - Adding DEP8 functional test case + * Fix building for linux 4.19 (LP: #1801975) + * Fix calling dm_kcopyd_zero on linux 4.19 (LP: #1801975) + + -- Thadeu Lima de Souza Cascardo Wed, 07 Nov 2018 20:41:49 -0200 + +dm-writeboost (2.2.9-1) unstable; urgency=medium + + * New upstream release [June 2018]. + + fixed build on Linux 4.15 and 4.17 (Closes: #892064). + * Standards-Version: 4.1.4. + * Vcs URLs to Salsa. + + -- Dmitry Smirnov Mon, 11 Jun 2018 14:55:40 +1000 + dm-writeboost (2.2.8-1ubuntu3) cosmic; urgency=medium * debian/patches/buildfix-4.17.patch @@ -136,3 +154,4 @@ * Initial release (Closes: #787854). -- Dmitry Smirnov Tue, 16 Jun 2015 19:00:34 +1000 + diff -Nru dm-writeboost-2.2.8/debian/control dm-writeboost-2.2.9/debian/control --- dm-writeboost-2.2.8/debian/control 2017-11-15 09:43:14.000000000 +0000 +++ dm-writeboost-2.2.9/debian/control 2018-06-11 10:16:35.000000000 +0000 @@ -4,10 +4,10 @@ Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Dmitry Smirnov Build-Depends: debhelper (>= 10), dkms -Standards-Version: 4.1.1 +Standards-Version: 4.1.4 Homepage: https://github.com/akiradeveloper/dm-writeboost -Vcs-Browser: https://anonscm.debian.org/cgit/collab-maint/dm-writeboost.git -Vcs-Git: https://anonscm.debian.org/git/collab-maint/dm-writeboost.git +Vcs-Browser: https://salsa.debian.org/debian/dm-writeboost +Vcs-Git: https://salsa.debian.org/debian/dm-writeboost.git Package: dm-writeboost-dkms Architecture: all diff -Nru dm-writeboost-2.2.8/debian/copyright dm-writeboost-2.2.9/debian/copyright --- dm-writeboost-2.2.8/debian/copyright 2017-07-01 12:22:56.000000000 +0000 +++ dm-writeboost-2.2.9/debian/copyright 2018-06-11 10:16:35.000000000 +0000 @@ -1,14 +1,14 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: dm-writeboost Upstream-Contact: Akira Hayakawa Source: https://github.com/akiradeveloper/dm-writeboost Files: * -Copyright: 2012-2017 Akira Hayakawa +Copyright: 2012-2018 Akira Hayakawa License: GPL-2+ Files: debian/* -Copyright: 2015-2017 Dmitry Smirnov +Copyright: 2015-2018 Dmitry Smirnov License: GPL-2+ License: GPL-2+ diff -Nru dm-writeboost-2.2.8/debian/patches/0001-Fix-building-for-linux-4.19 dm-writeboost-2.2.9/debian/patches/0001-Fix-building-for-linux-4.19 --- dm-writeboost-2.2.8/debian/patches/0001-Fix-building-for-linux-4.19 1970-01-01 00:00:00.000000000 +0000 +++ dm-writeboost-2.2.9/debian/patches/0001-Fix-building-for-linux-4.19 2018-11-07 22:41:49.000000000 +0000 @@ -0,0 +1,54 @@ +From: Thadeu Lima de Souza Cascardo +Description: Fix building for linux 4.19. + +linux 4.19 has introduced STAT_WRITE and STAT_READ for partition stat +entries. This conflicts with dm-writeboost own STAT_WRITE, which was +renamed as WB_STAT_WRITE. The same pattern renaming was applied to other +values. + +Signed-off-by: Thadeu Lima de Souza Cascardo + +Origin: upstream, commit:af218c398d1f18877a3c54a2c255d8fb5b867df0 +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1801975 + +diff --git a/src/dm-writeboost-target.c b/src/dm-writeboost-target.c +index a0b104789d42..9846bf650adb 100644 +--- a/src/dm-writeboost-target.c ++++ b/src/dm-writeboost-target.c +@@ -424,13 +424,13 @@ static void inc_stat(struct wb_device *wb, + + int i = 0; + if (rw) +- i |= (1 << STAT_WRITE); ++ i |= (1 << WB_STAT_WRITE); + if (found) +- i |= (1 << STAT_HIT); ++ i |= (1 << WB_STAT_HIT); + if (on_buffer) +- i |= (1 << STAT_ON_BUFFER); ++ i |= (1 << WB_STAT_ON_BUFFER); + if (fullsize) +- i |= (1 << STAT_FULLSIZE); ++ i |= (1 << WB_STAT_FULLSIZE); + + v = &wb->stat[i]; + atomic64_inc(v); +diff --git a/src/dm-writeboost.h b/src/dm-writeboost.h +index f771dde34e3e..da6dd1b6d97f 100644 +--- a/src/dm-writeboost.h ++++ b/src/dm-writeboost.h +@@ -232,10 +232,10 @@ struct read_cache_cells { + /*----------------------------------------------------------------------------*/ + + enum STATFLAG { +- STAT_WRITE = 3, /* Write or read */ +- STAT_HIT = 2, /* Hit or miss */ +- STAT_ON_BUFFER = 1, /* Found on buffer or on the cache device */ +- STAT_FULLSIZE = 0, /* Bio is fullsize or partial */ ++ WB_STAT_WRITE = 3, /* Write or read */ ++ WB_STAT_HIT = 2, /* Hit or miss */ ++ WB_STAT_ON_BUFFER = 1, /* Found on buffer or on the cache device */ ++ WB_STAT_FULLSIZE = 0, /* Bio is fullsize or partial */ + }; + #define STATLEN (1 << 4) + diff -Nru dm-writeboost-2.2.8/debian/patches/0001-Fix-calling-dm_kcopyd_zero-on-linux-4.19 dm-writeboost-2.2.9/debian/patches/0001-Fix-calling-dm_kcopyd_zero-on-linux-4.19 --- dm-writeboost-2.2.8/debian/patches/0001-Fix-calling-dm_kcopyd_zero-on-linux-4.19 1970-01-01 00:00:00.000000000 +0000 +++ dm-writeboost-2.2.9/debian/patches/0001-Fix-calling-dm_kcopyd_zero-on-linux-4.19 2018-11-07 22:41:49.000000000 +0000 @@ -0,0 +1,32 @@ +From: Thadeu Lima de Souza Cascardo +Description: Fix calling dm_kcopyd_zero on linux 4.19. + +On linux 4.19, dm_kcopyd_zero was changed to return void instead of int, +because dm_kcopyd_copy always returned 0. As that has been since the +introduction of kcopyd, there should be no problem ignoring its return +value even on versions where it would still return an int. + +Signed-off-by: Thadeu Lima de Souza Cascardo + +Origin: upstream, commit:f81f0f9df7629099fda7adbfaaa991b3aa71af1a +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1801975 + +diff --git a/src/dm-writeboost-metadata.c b/src/dm-writeboost-metadata.c +index ea9227161374..456ab7eeaffa 100644 +--- a/src/dm-writeboost-metadata.c ++++ b/src/dm-writeboost-metadata.c +@@ -438,13 +438,10 @@ static void zeroing_complete(int read_err, unsigned long write_err, void *contex + */ + static int do_zeroing_region(struct wb_device *wb, struct dm_io_region *region) + { +- int err; + struct zeroing_context zc; + zc.error = 0; + init_completion(&zc.complete); +- err = dm_kcopyd_zero(wb->copier, 1, region, 0, zeroing_complete, &zc); +- if (err) +- return err; ++ dm_kcopyd_zero(wb->copier, 1, region, 0, zeroing_complete, &zc); + wait_for_completion(&zc.complete); + return zc.error; + } diff -Nru dm-writeboost-2.2.8/debian/patches/0001-use-read_once.patch dm-writeboost-2.2.9/debian/patches/0001-use-read_once.patch --- dm-writeboost-2.2.8/debian/patches/0001-use-read_once.patch 2018-02-08 17:27:16.000000000 +0000 +++ dm-writeboost-2.2.9/debian/patches/0001-use-read_once.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,75 +0,0 @@ -Index: dm-writeboost-2.2.8/src/dm-writeboost-daemon.c -=================================================================== ---- dm-writeboost-2.2.8.orig/src/dm-writeboost-daemon.c -+++ dm-writeboost-2.2.8/src/dm-writeboost-daemon.c -@@ -395,7 +395,7 @@ static u32 calc_nr_writeback(struct wb_d - atomic64_read(&wb->last_flushed_segment_id) - - atomic64_read(&wb->last_writeback_segment_id); - -- u32 nr_max_batch = ACCESS_ONCE(wb->nr_max_batched_writeback); -+ u32 nr_max_batch = READ_ONCE(wb->nr_max_batched_writeback); - if (wb->nr_writeback_segs != nr_max_batch) - try_alloc_writeback_ios(wb, nr_max_batch, GFP_NOIO | __GFP_NOWARN); - -@@ -404,9 +404,9 @@ static u32 calc_nr_writeback(struct wb_d - - static bool should_writeback(struct wb_device *wb) - { -- return ACCESS_ONCE(wb->allow_writeback) || -- ACCESS_ONCE(wb->urge_writeback) || -- ACCESS_ONCE(wb->force_drop); -+ return READ_ONCE(wb->allow_writeback) || -+ READ_ONCE(wb->urge_writeback) || -+ READ_ONCE(wb->force_drop); - } - - static void do_writeback_proc(struct wb_device *wb) -@@ -487,7 +487,7 @@ int writeback_modulator_proc(void *data) - - util = div_u64(100 * (new - old), 1000); - -- if (util < ACCESS_ONCE(wb->writeback_threshold)) -+ if (util < READ_ONCE(wb->writeback_threshold)) - wb->allow_writeback = true; - else - wb->allow_writeback = false; -@@ -545,7 +545,7 @@ int sb_record_updater_proc(void *data) - - while (!kthread_should_stop()) { - /* sec -> ms */ -- intvl = ACCESS_ONCE(wb->update_sb_record_interval) * 1000; -+ intvl = READ_ONCE(wb->update_sb_record_interval) * 1000; - - if (!intvl) { - schedule_timeout_interruptible(msecs_to_jiffies(1000)); -@@ -567,7 +567,7 @@ int data_synchronizer_proc(void *data) - - while (!kthread_should_stop()) { - /* sec -> ms */ -- intvl = ACCESS_ONCE(wb->sync_data_interval) * 1000; -+ intvl = READ_ONCE(wb->sync_data_interval) * 1000; - - if (!intvl) { - schedule_timeout_interruptible(msecs_to_jiffies(1000)); -Index: dm-writeboost-2.2.8/src/dm-writeboost-target.c -=================================================================== ---- dm-writeboost-2.2.8.orig/src/dm-writeboost-target.c -+++ dm-writeboost-2.2.8/src/dm-writeboost-target.c -@@ -782,7 +782,7 @@ static bool reserve_read_cache_cell(stru - - ASSERT(cells->threshold > 0); - -- if (!ACCESS_ONCE(wb->read_cache_threshold)) -+ if (!READ_ONCE(wb->read_cache_threshold)) - return false; - - if (!cells->cursor) -@@ -973,7 +973,7 @@ static void reinit_read_cache_cells(stru - struct read_cache_cell *cell = cells->array + i; - cell->cancelled = false; - } -- cur_threshold = ACCESS_ONCE(wb->read_cache_threshold); -+ cur_threshold = READ_ONCE(wb->read_cache_threshold); - if (cur_threshold && (cur_threshold != cells->threshold)) { - cells->threshold = cur_threshold; - cells->over_threshold = false; diff -Nru dm-writeboost-2.2.8/debian/patches/buildfix-4.17.patch dm-writeboost-2.2.9/debian/patches/buildfix-4.17.patch --- dm-writeboost-2.2.8/debian/patches/buildfix-4.17.patch 2018-05-25 14:30:04.000000000 +0000 +++ dm-writeboost-2.2.9/debian/patches/buildfix-4.17.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -Index: dm-writeboost-2.2.8/src/dm-writeboost-target.c -=================================================================== ---- dm-writeboost-2.2.8.orig/src/dm-writeboost-target.c -+++ dm-writeboost-2.2.8/src/dm-writeboost-target.c -@@ -1840,7 +1840,12 @@ static void writeboost_postsuspend(struc - blkdev_issue_flush(wb->cache_dev->bdev, GFP_NOIO, NULL); - } - -+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,17,0) - static int writeboost_message(struct dm_target *ti, unsigned argc, char **argv) -+#else -+static int writeboost_message(struct dm_target *ti, unsigned argc, char **argv, -+ char *result, unsigned maxlen) -+#endif - { - struct wb_device *wb = ti->private; - diff -Nru dm-writeboost-2.2.8/debian/patches/series dm-writeboost-2.2.9/debian/patches/series --- dm-writeboost-2.2.8/debian/patches/series 2018-05-25 14:27:59.000000000 +0000 +++ dm-writeboost-2.2.9/debian/patches/series 2018-11-06 17:20:28.000000000 +0000 @@ -1,2 +1,2 @@ -0001-use-read_once.patch -buildfix-4.17.patch +0001-Fix-building-for-linux-4.19 +0001-Fix-calling-dm_kcopyd_zero-on-linux-4.19 diff -Nru dm-writeboost-2.2.8/Makefile dm-writeboost-2.2.9/Makefile --- dm-writeboost-2.2.8/Makefile 2017-10-15 13:30:54.000000000 +0000 +++ dm-writeboost-2.2.9/Makefile 2018-06-09 14:14:54.000000000 +0000 @@ -1,4 +1,4 @@ -MODULE_VERSION ?= 2.2.8 +MODULE_VERSION ?= 2.2.9 DKMS_DIR := /usr/src/dm-writeboost-$(MODULE_VERSION) DKMS_KEY := -m dm-writeboost -v $(MODULE_VERSION) diff -Nru dm-writeboost-2.2.8/README.md dm-writeboost-2.2.9/README.md --- dm-writeboost-2.2.8/README.md 2017-10-15 13:30:54.000000000 +0000 +++ dm-writeboost-2.2.9/README.md 2018-06-09 14:14:54.000000000 +0000 @@ -61,7 +61,7 @@ ## License ``` -Copyright (C) 2012-2017 Akira Hayakawa +Copyright (C) 2012-2018 Akira Hayakawa This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru dm-writeboost-2.2.8/src/dkms.conf dm-writeboost-2.2.9/src/dkms.conf --- dm-writeboost-2.2.8/src/dkms.conf 2017-10-15 13:30:54.000000000 +0000 +++ dm-writeboost-2.2.9/src/dkms.conf 2018-06-09 14:14:54.000000000 +0000 @@ -1,5 +1,5 @@ PACKAGE_NAME="dm-writeboost" -PACKAGE_VERSION="2.2.8" +PACKAGE_VERSION="2.2.9" BUILT_MODULE_NAME="dm-writeboost" DEST_MODULE_LOCATION="/kernel/drivers/md" MAKE="make all KERNEL_TREE=$kernel_source_dir" diff -Nru dm-writeboost-2.2.8/src/dm-writeboost-daemon.c dm-writeboost-2.2.9/src/dm-writeboost-daemon.c --- dm-writeboost-2.2.8/src/dm-writeboost-daemon.c 2017-10-15 13:30:54.000000000 +0000 +++ dm-writeboost-2.2.9/src/dm-writeboost-daemon.c 2018-06-09 14:14:54.000000000 +0000 @@ -1,6 +1,6 @@ /* * This file is part of dm-writeboost - * Copyright (C) 2012-2017 Akira Hayakawa + * Copyright (C) 2012-2018 Akira Hayakawa * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -395,7 +395,7 @@ atomic64_read(&wb->last_flushed_segment_id) - atomic64_read(&wb->last_writeback_segment_id); - u32 nr_max_batch = ACCESS_ONCE(wb->nr_max_batched_writeback); + u32 nr_max_batch = read_once(wb->nr_max_batched_writeback); if (wb->nr_writeback_segs != nr_max_batch) try_alloc_writeback_ios(wb, nr_max_batch, GFP_NOIO | __GFP_NOWARN); @@ -404,9 +404,9 @@ static bool should_writeback(struct wb_device *wb) { - return ACCESS_ONCE(wb->allow_writeback) || - ACCESS_ONCE(wb->urge_writeback) || - ACCESS_ONCE(wb->force_drop); + return read_once(wb->allow_writeback) || + read_once(wb->urge_writeback) || + read_once(wb->force_drop); } static void do_writeback_proc(struct wb_device *wb) @@ -487,7 +487,7 @@ util = div_u64(100 * (new - old), 1000); - if (util < ACCESS_ONCE(wb->writeback_threshold)) + if (util < read_once(wb->writeback_threshold)) wb->allow_writeback = true; else wb->allow_writeback = false; @@ -545,7 +545,7 @@ while (!kthread_should_stop()) { /* sec -> ms */ - intvl = ACCESS_ONCE(wb->update_sb_record_interval) * 1000; + intvl = read_once(wb->update_sb_record_interval) * 1000; if (!intvl) { schedule_timeout_interruptible(msecs_to_jiffies(1000)); @@ -567,7 +567,7 @@ while (!kthread_should_stop()) { /* sec -> ms */ - intvl = ACCESS_ONCE(wb->sync_data_interval) * 1000; + intvl = read_once(wb->sync_data_interval) * 1000; if (!intvl) { schedule_timeout_interruptible(msecs_to_jiffies(1000)); diff -Nru dm-writeboost-2.2.8/src/dm-writeboost-daemon.h dm-writeboost-2.2.9/src/dm-writeboost-daemon.h --- dm-writeboost-2.2.8/src/dm-writeboost-daemon.h 2017-10-15 13:30:54.000000000 +0000 +++ dm-writeboost-2.2.9/src/dm-writeboost-daemon.h 2018-06-09 14:14:54.000000000 +0000 @@ -1,6 +1,6 @@ /* * This file is part of dm-writeboost - * Copyright (C) 2012-2017 Akira Hayakawa + * Copyright (C) 2012-2018 Akira Hayakawa * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -Nru dm-writeboost-2.2.8/src/dm-writeboost.h dm-writeboost-2.2.9/src/dm-writeboost.h --- dm-writeboost-2.2.8/src/dm-writeboost.h 2017-10-15 13:30:54.000000000 +0000 +++ dm-writeboost-2.2.9/src/dm-writeboost.h 2018-06-09 14:14:54.000000000 +0000 @@ -1,6 +1,6 @@ /* * This file is part of dm-writeboost - * Copyright (C) 2012-2017 Akira Hayakawa + * Copyright (C) 2012-2018 Akira Hayakawa * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -519,5 +519,13 @@ #endif /*----------------------------------------------------------------------------*/ + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0) +#define read_once(x) READ_ONCE(x) +#else +#define read_once(x) ACCESS_ONCE(x) +#endif + +/*----------------------------------------------------------------------------*/ #endif diff -Nru dm-writeboost-2.2.8/src/dm-writeboost-metadata.c dm-writeboost-2.2.9/src/dm-writeboost-metadata.c --- dm-writeboost-2.2.8/src/dm-writeboost-metadata.c 2017-10-15 13:30:54.000000000 +0000 +++ dm-writeboost-2.2.9/src/dm-writeboost-metadata.c 2018-06-09 14:14:54.000000000 +0000 @@ -1,6 +1,6 @@ /* * This file is part of dm-writeboost - * Copyright (C) 2012-2017 Akira Hayakawa + * Copyright (C) 2012-2018 Akira Hayakawa * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -Nru dm-writeboost-2.2.8/src/dm-writeboost-metadata.h dm-writeboost-2.2.9/src/dm-writeboost-metadata.h --- dm-writeboost-2.2.8/src/dm-writeboost-metadata.h 2017-10-15 13:30:54.000000000 +0000 +++ dm-writeboost-2.2.9/src/dm-writeboost-metadata.h 2018-06-09 14:14:54.000000000 +0000 @@ -1,6 +1,6 @@ /* * This file is part of dm-writeboost - * Copyright (C) 2012-2017 Akira Hayakawa + * Copyright (C) 2012-2018 Akira Hayakawa * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -Nru dm-writeboost-2.2.8/src/dm-writeboost-target.c dm-writeboost-2.2.9/src/dm-writeboost-target.c --- dm-writeboost-2.2.8/src/dm-writeboost-target.c 2017-10-15 13:30:54.000000000 +0000 +++ dm-writeboost-2.2.9/src/dm-writeboost-target.c 2018-06-09 14:14:54.000000000 +0000 @@ -3,7 +3,7 @@ * Log-structured Caching for Linux * * This file is part of dm-writeboost - * Copyright (C) 2012-2017 Akira Hayakawa + * Copyright (C) 2012-2018 Akira Hayakawa * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -782,7 +782,7 @@ ASSERT(cells->threshold > 0); - if (!ACCESS_ONCE(wb->read_cache_threshold)) + if (!read_once(wb->read_cache_threshold)) return false; if (!cells->cursor) @@ -973,7 +973,7 @@ struct read_cache_cell *cell = cells->array + i; cell->cancelled = false; } - cur_threshold = ACCESS_ONCE(wb->read_cache_threshold); + cur_threshold = read_once(wb->read_cache_threshold); if (cur_threshold && (cur_threshold != cells->threshold)) { cells->threshold = cur_threshold; cells->over_threshold = false; @@ -1840,7 +1840,12 @@ blkdev_issue_flush(wb->cache_dev->bdev, GFP_NOIO, NULL); } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0) +static int writeboost_message(struct dm_target *ti, unsigned argc, char **argv, + char *result, unsigned maxlen) +#else static int writeboost_message(struct dm_target *ti, unsigned argc, char **argv) +#endif { struct wb_device *wb = ti->private; @@ -1942,7 +1947,7 @@ static struct target_type writeboost_target = { .name = "writeboost", - .version = {2, 2, 8}, + .version = {2, 2, 9}, .module = THIS_MODULE, .map = writeboost_map, .end_io = writeboost_end_io,