Package: src:gdnsd Version: 2.2.0-1 Severity: wishlist Tags: upstream patch
Hi, Over in Ubuntu, our builders are running old (3.13) kernels on some architectures. This causes problems when running code built against newer ones (e.g. libc or kernel headers in the development release). For gdnsd, the buildtime kernels have F_OFD_SETLK available but they do not at runtime - this means that the testsuite fails. See this build log: https://launchpadlibrarian.net/226939617/buildlog_ubuntu-xenial-arm64.gdnsd_2.2.0-1_BUILDING.txt.gz It's fixed by the attached patch from upstream. Do you think you could upload it to Debian so that we can remain in sync? (Or let me know and I can NMU.) Cheers, -- Iain Lane [ [email protected] ] Debian Developer [ [email protected] ] Ubuntu Developer [ [email protected] ]
>From 552e9065324f2dae7aaadf27b468b7173ddcedc3 Mon Sep 17 00:00:00 2001 From: Brandon L Black <[email protected]> Date: Thu, 20 Aug 2015 12:37:50 +0000 Subject: [PATCH] Fallback from F_OFD_SETLK if runtime-vs-build kernel mismatch Found this issue in OpenMandriva's distro patches: https://abf.io/openmandriva/gdnsd/commit/7d23fe8026823f89cfc59e2240bbd580b0054cf3 --- libgdnsd/file.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/libgdnsd/file.c b/libgdnsd/file.c index e074876..e3cc416 100644 --- a/libgdnsd/file.c +++ b/libgdnsd/file.c @@ -66,9 +66,14 @@ gdnsd_fmap_t* gdnsd_fmap_new(const char* fn, const bool seq) { locker.l_type = F_RDLCK; locker.l_whence = SEEK_SET; if(fcntl(fd, F_OFD_SETLK, &locker)) { - dmn_log_err("Cannot get readlock on '%s': %s", fn, dmn_logf_errno()); - close(fd); - return NULL; + // try fallback to F_SETLK on EINVAL, in case binary was built with + // F_OFD_SETLK support, but runtime kernel doesn't have it. + if(errno != EINVAL + || (F_OFD_SETLK != F_SETLK && fcntl(fd, F_SETLK, &locker))) { + dmn_log_err("Cannot get readlock on '%s': %s", fn, dmn_logf_errno()); + close(fd); + return NULL; + } } struct stat st; -- 2.6.2

