From fabb771e0554213099e9ac3e07d2ebbbf850471d Mon Sep 17 00:00:00 2001 From: Petros Koutoupis Date: Sun, 13 Jun 2021 13:17:07 +0000 Subject: [PATCH 1/2] Added support for libmicrohttpd v0.9.71 while still supporting legacy versions. --- src/Makefile | 4 ++++ src/net.c | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/src/Makefile b/src/Makefile index 4162629..87de743 100644 --- a/src/Makefile +++ b/src/Makefile @@ -53,7 +53,11 @@ json-server.o: json.c $(CC) -c json.c -DSERVER -o json-server.o net.o: net.c +ifeq ($(shell grep -q "enum MHD_Result" $(DESTDIR)/usr/include/microhttpd.h; echo $$?),1) + $(CC) -c net.c -DLEGACY -o net.o +else $(CC) -c net.c -o net.o +endif rdsk.o: rdsk.c $(CC) -c rdsk.c -o rdsk.o diff --git a/src/net.c b/src/net.c index 3e59f56..dd60e04 100644 --- a/src/net.c +++ b/src/net.c @@ -40,7 +40,11 @@ unsigned char path[NAMELEN] = {0}; * The responses to our GET requests. Although, we are not SPECIFICALLY checking that they are GETs. * We are just check the URL and the string command. */ +#if !defined LEGACY +static enum MHD_Result answer_to_connection(void *cls, struct MHD_Connection *connection, const char *url, +#else static int answer_to_connection(void *cls, struct MHD_Connection *connection, const char *url, +#endif const char *method, const char *version, const char *upload_data, size_t *upload_data_size, void **con_cls) { @@ -54,7 +58,11 @@ static int answer_to_connection(void *cls, struct MHD_Connection *connection, co unsigned char *page = (unsigned char *)calloc(1, BUFSZ); if (page == NULL) { printf("%s: %s: calloc: %s\n", DAEMON, __func__, strerror(errno)); +#if !defined LEGACY + return MHD_NO; +#else return INVALID_VALUE; +#endif } if (strcmp(method, "GET") == SUCCESS) { From d24ff5dab05f4b371a77ea4ec0989cd935728c6c Mon Sep 17 00:00:00 2001 From: Petros Koutoupis Date: Wed, 16 Jun 2021 19:07:00 +0000 Subject: [PATCH 2/2] Fixed compilation issue in RHEL 8.4 --- CHANGELOG.md | 5 +++++ debian/changelog | 5 +++++ debian/control | 2 +- debian/postinst | 6 +++--- debian/prerm | 2 +- misc/rapiddisk-legacy/rapiddisk-legacy.sh | 2 +- module/Makefile | 2 +- module/dkms.conf | 2 +- module/rapiddisk-cache.c | 4 ++-- module/rapiddisk.c | 4 ++-- rapiddisk.spec.rhel | 5 ++++- rapiddisk.spec.sles | 5 ++++- src/common.h | 2 +- 13 files changed, 31 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a8a464..90cddc9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +### Release 7.2.1 ### + +- module: Added support for RHEL 8.4 kernel +- utility: Added support for libmicrohttpd v0.9.71 and newer while still supporting legacy versions + ### Release 7.2.0 ### - module: Updated for 5.12 kernels and later (thank you Michael) diff --git a/debian/changelog b/debian/changelog index 77581d0..d4e42b0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,8 @@ +rapiddisk (7.2.1-1) released; urgency=medium + +* module: Added support for RHEL 8.4 kernel +* utility: added support for libmicrohttpd v0.9.71 and newer while still supporting legacy versions + rapiddisk (7.2.0-1) released; urgency=medium * module: Updated for 5.12 kernels and later (thank you Michael) diff --git a/debian/control b/debian/control index 786c8ae..5700e08 100755 --- a/debian/control +++ b/debian/control @@ -1,5 +1,5 @@ Package: rapiddisk -Version: 7.2.0-1 +Version: 7.2.1-1 Section: base Priority: optional Architecture: amd64 diff --git a/debian/postinst b/debian/postinst index 9431ae0..241d6a9 100755 --- a/debian/postinst +++ b/debian/postinst @@ -16,9 +16,9 @@ fi case "$1" in configure) - dkms add -m rapiddisk -v 7.2.0 - dkms build -m rapiddisk -v 7.2.0 - dkms install -m rapiddisk -v 7.2.0 + dkms add -m rapiddisk -v 7.2.1 + dkms build -m rapiddisk -v 7.2.1 + dkms install -m rapiddisk -v 7.2.1 echo "rapiddisk max_sectors=2048 nr_requests=1024" >> /etc/modules echo "rapiddisk-cache" >> /etc/modules echo "dm_mod" >> /etc/modules diff --git a/debian/prerm b/debian/prerm index 2224ef3..5d6fd32 100755 --- a/debian/prerm +++ b/debian/prerm @@ -14,7 +14,7 @@ fi case "$1" in remove|upgrade|deconfigure) - dkms remove -m rapiddisk -v 7.2.0 --all + dkms remove -m rapiddisk -v 7.2.1 --all ;; failed-upgrade) diff --git a/misc/rapiddisk-legacy/rapiddisk-legacy.sh b/misc/rapiddisk-legacy/rapiddisk-legacy.sh index 2d48d0a..44663a8 100644 --- a/misc/rapiddisk-legacy/rapiddisk-legacy.sh +++ b/misc/rapiddisk-legacy/rapiddisk-legacy.sh @@ -8,7 +8,7 @@ fi ## usage ## function help_menu() { - echo -e "$1 7.2.0" + echo -e "$1 7.2.1" echo -e "Copyright 2011 - 2021 Petros Koutoupis" echo -e "" echo -e "$1 is an administration tool to manage the RapidDisk RAM disk devices and" diff --git a/module/Makefile b/module/Makefile index 71e2b52..b49679c 100644 --- a/module/Makefile +++ b/module/Makefile @@ -15,7 +15,7 @@ # # SPDX-License-Identifier: GPL-2.0-only -VERSION = 7.2.0 +VERSION = 7.2.1 ifeq ($(KSRC),) KSRC := /lib/modules/$(shell uname -r)/build diff --git a/module/dkms.conf b/module/dkms.conf index 46316e6..050e6ef 100644 --- a/module/dkms.conf +++ b/module/dkms.conf @@ -1,5 +1,5 @@ PACKAGE_NAME="rapiddisk" -PACKAGE_VERSION="7.2.0" +PACKAGE_VERSION="7.2.1" BUILT_MODULE_NAME[0]="rapiddisk" BUILT_MODULE_NAME[1]="rapiddisk-cache" DEST_MODULE_LOCATION[0]="/kernel/rapiddisk/" diff --git a/module/rapiddisk-cache.c b/module/rapiddisk-cache.c index 0774508..e1651c5 100644 --- a/module/rapiddisk-cache.c +++ b/module/rapiddisk-cache.c @@ -54,7 +54,7 @@ } \ } while (0) -#define VERSION_STR "7.2.0" +#define VERSION_STR "7.2.1" #define DM_MSG_PREFIX "rapiddisk-cache" #define READCACHE 1 @@ -1234,7 +1234,7 @@ cache_status(struct dm_target *ti, status_type_t type, unsigned status_flags, static struct target_type cache_target = { .name = "rapiddisk-cache", - .version = {7, 2, 0}, + .version = {7, 2, 1}, .module = THIS_MODULE, .ctr = cache_ctr, .dtr = cache_dtr, diff --git a/module/rapiddisk.c b/module/rapiddisk.c index 8773cbe..9257e01 100644 --- a/module/rapiddisk.c +++ b/module/rapiddisk.c @@ -41,7 +41,7 @@ #include #include -#define VERSION_STR "7.2.0" +#define VERSION_STR "7.2.1" #define PREFIX "rapiddisk" #define BYTES_PER_SECTOR 512 #define MAX_RDSKS 128 @@ -637,7 +637,7 @@ static int rdsk_ioctl(struct block_device *bdev, fmode_t mode, error = -EBUSY; if (bdev->bd_openers <= 1) { #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0) -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,8,0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,8,0) || (defined(RHEL_MAJOR) && RHEL_MAJOR == 8 && RHEL_MINOR >= 4) invalidate_bdev(bdev); #else kill_bdev(bdev); diff --git a/rapiddisk.spec.rhel b/rapiddisk.spec.rhel index 8e6d111..9690fe4 100644 --- a/rapiddisk.spec.rhel +++ b/rapiddisk.spec.rhel @@ -1,6 +1,6 @@ Summary: The RapidDisk software defined advanced RAM drive and storage caching solution. Name: rapiddisk -Version: 7.2.0 +Version: 7.2.1 Release: 1 License: General Public License Version 2 Group: Applications/System @@ -78,6 +78,9 @@ rm -rf %{buildroot} %doc %attr(0444,root,root) /usr/share/man/man1/* %changelog +* Sun Jun 13 2021 Petros Koutoupis +- module: Added support for RHEL 8.4 kernel +- utility: added support for libmicrohttpd v0.9.71 and newer while still supporting legacy versions * Fri May 28 2021 Petros Koutoupis - module: Updated for 5.12 kernels and later (thank you Michael) - utility: remove unused headers (thank you Marcel Huber) diff --git a/rapiddisk.spec.sles b/rapiddisk.spec.sles index 0779627..54463da 100644 --- a/rapiddisk.spec.sles +++ b/rapiddisk.spec.sles @@ -1,6 +1,6 @@ Summary: The RapidDisk software defined advanced RAM drive and storage caching solution. Name: rapiddisk -Version: 7.2.0 +Version: 7.2.1 Release: 1 License: General Public License Version 2 Group: Applications/System @@ -79,6 +79,9 @@ rm -rf %{buildroot} %doc %attr(0444,root,root) /usr/share/man/man1/* %changelog +* Sun Jun 13 2021 Petros Koutoupis +- module: Added support for RHEL 8.4 kernel +- utility: added support for libmicrohttpd v0.9.71 and newer while still supporting legacy versions * Fri May 28 2021 Petros Koutoupis - module: Updated for 5.12 kernels and later (thank you Michael) - utility: remove unused headers (thank you Marcel Huber) diff --git a/src/common.h b/src/common.h index 72b613e..ce20e4a 100644 --- a/src/common.h +++ b/src/common.h @@ -44,7 +44,7 @@ #define PROCESS "rapiddisk" #define DAEMON PROCESS "d" #define COPYRIGHT "Copyright 2011 - 2021 Petros Koutoupis" -#define VERSION_NUM "7.2.0" +#define VERSION_NUM "7.2.1" #define SUCCESS 0 #define INVALID_VALUE -1 #define NAMELEN 0x200