aboutsummaryrefslogtreecommitdiffstats
path: root/main/nfs-utils
diff options
context:
space:
mode:
authorJan Tatje <jan@jnt.io>2017-07-24 18:08:21 +0000
committerTimo Teräs <timo.teras@iki.fi>2017-08-29 08:16:45 +0000
commit16c9711c3468272f0edb6bc7eb17435188aa01b3 (patch)
treedf64157aa2b03cba143af4ce942040e09adfaeda /main/nfs-utils
parent2dd190173acb3b33a0ddbd23ec323e7581746f2d (diff)
downloadaports-16c9711c3468272f0edb6bc7eb17435188aa01b3.tar.bz2
aports-16c9711c3468272f0edb6bc7eb17435188aa01b3.tar.xz
main/nfs-utils: Patch idmapd to remove dependency on DNOTIFY
idmapd requires CONFIG_DNOTIFY, which is not enabled in linux-vanilla or linux-hardened. This is fixed by applying this patch (https://patchwork.kernel.org/patch/9802949/) by Alan Swanson which uses INOTIFY instead. [TT: bump pkgrel, use mbox version of patch]
Diffstat (limited to 'main/nfs-utils')
-rw-r--r--main/nfs-utils/APKBUILD4
-rw-r--r--main/nfs-utils/idmapd-dnotify-to-inotify.patch105
2 files changed, 108 insertions, 1 deletions
diff --git a/main/nfs-utils/APKBUILD b/main/nfs-utils/APKBUILD
index 120e0c2d34..6bd11fe427 100644
--- a/main/nfs-utils/APKBUILD
+++ b/main/nfs-utils/APKBUILD
@@ -3,7 +3,7 @@
pkgname=nfs-utils
pkgver=2.1.1
_basever=$pkgver
-pkgrel=2
+pkgrel=3
pkgdesc="kernel-mode NFS"
url="http://nfs.sourceforge.net/"
arch="all"
@@ -20,6 +20,7 @@ source="http://downloads.sourceforge.net/nfs/$pkgname-$_basever.tar.bz2
nfs-utils-mtab-sym.patch
musl-getservbyport.patch
+ idmapd-dnotify-to-inotify.patch
nfs.initd
nfsmount.initd
@@ -88,6 +89,7 @@ sha512sums="ed358280b7e124154632040bf747f6e4c3c6e4156bf90e82ff6915b1488f1c0dd652
9561a979a2313f00c0bbb2ffb3193ca089e5de2f15cf5b6c142e65e04a9401bbc962e490e5b1de026750262a05e5258b286a79781444e7f2ac6bd581b426211a 0011-exportfs-only-do-glibc-specific-hackery-on-glibc.patch
5fd9039a61a0cdaeb57b5332ea545034101e6f15be200b7cf8fc7d0a3d22836a6fc778e0560656c1825808a4dc09046d9923d81b4d1324a6e526b226c657d064 nfs-utils-mtab-sym.patch
a14fc747cc75f65bb206b28eb4f838ae85687c917893531318d3991adc3ed9914316b97fc507bf34881855c9978ad9d4617f33e464d1a0d746a65b31177687c1 musl-getservbyport.patch
+33410c469348adf5e6b5ec91d8cda6b246f1a38a0b234a52f54a49ab8395ede43dfedd58914a59c342923ba45722f6fd4e4aebeffbe4a730f31c9d1ad19de9a9 idmapd-dnotify-to-inotify.patch
f7feb79cfcab0478affb640d1e5ad059757c88d51cc790fd54cde2fd7ed2e3cfd8f7f4c2de993d99da03e8ce3bdfb2750a4cb997b850fe33d0ef76d9b91c9018 nfs.initd
89259b9f0878658d48792b5b2f42b43c966ed098dba1fecf9e07fb0de4aab37ad67655ea8dbcc2361ddab2b5013b2de35a03048a513aaeedf790e4b416a35a54 nfsmount.initd
6e23897885cc33c49d9c7353b456585a1e0c7300822edba81bc48ba4ccc18297adce137260cc0aa9487aa5ef0aab3eecf931532cfa5bd40fd03bc9e0ddacfb28 nfsmount.confd
diff --git a/main/nfs-utils/idmapd-dnotify-to-inotify.patch b/main/nfs-utils/idmapd-dnotify-to-inotify.patch
new file mode 100644
index 0000000000..d1a3011f7f
--- /dev/null
+++ b/main/nfs-utils/idmapd-dnotify-to-inotify.patch
@@ -0,0 +1,105 @@
+From patchwork Wed Jun 21 21:23:38 2017
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [V2] idmapd: Use inotify instead of dnotify
+From: Alan Swanson <reiver@improbability.net>
+X-Patchwork-Id: 9802949
+Message-Id: <20170621212338.32460-1-reiver@improbability.net>
+To: linux-nfs@vger.kernel.org
+Cc: Alan Swanson <reiver@improbability.net>
+Date: Wed, 21 Jun 2017 22:23:38 +0100
+
+Remove last use of dnotify in nfs-utils by bringing idmapd upto
+date with (required) inotify use by gssd and blkmapd.
+---
+ utils/idmapd/idmapd.c | 32 +++++++++++++++++---------------
+ 1 file changed, 17 insertions(+), 15 deletions(-)
+
+Got annoyed by the dnotify kernel requirement. Read the last
+discussion "DNOTIFY to INOTIFY migration" posted in 2014 and while
+still not officially depreciated, dnotify was officially "replaced"
+by inotify in Linux 2.6.13 in 2005. Would be nice to sync this
+requirement across the codebase.
+
+V2: Init wd to -1 not 0
+
+diff --git a/utils/idmapd/idmapd.c b/utils/idmapd/idmapd.c
+index c12e878..c29dba6 100644
+--- a/utils/idmapd/idmapd.c
++++ b/utils/idmapd/idmapd.c
+@@ -36,7 +36,7 @@
+
+ #include <sys/types.h>
+ #include <sys/time.h>
+-#include <sys/poll.h>
++#include <sys/inotify.h>
+ #include <sys/socket.h>
+ #include <sys/stat.h>
+ #include <time.h>
+@@ -205,15 +205,16 @@ void usage(char *progname)
+ int
+ main(int argc, char **argv)
+ {
+- int fd = 0, opt, fg = 0, nfsdret = -1;
++ int wd = -1, opt, fg = 0, nfsdret = -1;
+ struct idmap_clientq icq;
+- struct event rootdirev, clntdirev, svrdirev;
++ struct event rootdirev, clntdirev, svrdirev, inotifyev;
+ struct event initialize;
+ struct passwd *pw;
+ struct group *gr;
+ struct stat sb;
+ char *xpipefsdir = NULL;
+ int serverstart = 1, clientstart = 1;
++ int inotify_fd;
+ int ret;
+ char *progname;
+ char *conf_path = NULL;
+@@ -373,18 +374,15 @@ main(int argc, char **argv)
+ }
+ }
+
+- if ((fd = open(pipefsdir, O_RDONLY)) == -1)
+- xlog_err("main: open(%s): %s", pipefsdir, strerror(errno));
+-
+- if (fcntl(fd, F_SETSIG, SIGUSR1) == -1)
+- xlog_err("main: fcntl(%s): %s", pipefsdir, strerror(errno));
+-
+- if (fcntl(fd, F_NOTIFY,
+- DN_CREATE | DN_DELETE | DN_MODIFY | DN_MULTISHOT) == -1) {
+- xlog_err("main: fcntl(%s): %s", pipefsdir, strerror(errno));
+- if (errno == EINVAL)
+- xlog_err("main: Possibly no Dnotify support in kernel.");
++ inotify_fd = inotify_init1(IN_NONBLOCK);
++ if (inotify_fd == -1) {
++ xlog_err("Unable to initialise inotify_init1: %s\n", strerror(errno));
++ } else {
++ wd = inotify_add_watch(inotify_fd, pipefsdir, IN_CREATE | IN_DELETE | IN_MODIFY);
++ if (wd < 0)
++ xlog_err("Unable to inotify_add_watch(%s): %s\n", pipefsdir, strerror(errno));
+ }
++
+ TAILQ_INIT(&icq);
+
+ /* These events are persistent */
+@@ -394,6 +392,10 @@ main(int argc, char **argv)
+ signal_add(&clntdirev, NULL);
+ signal_set(&svrdirev, SIGHUP, svrreopen, NULL);
+ signal_add(&svrdirev, NULL);
++ if ( wd >= 0) {
++ event_set(&inotifyev, inotify_fd, EV_READ | EV_PERSIST, dirscancb, &icq);
++ event_add(&inotifyev, NULL);
++ }
+
+ /* Fetch current state */
+ /* (Delay till start of event_dispatch to avoid possibly losing
+@@ -402,7 +404,7 @@ main(int argc, char **argv)
+ evtimer_add(&initialize, &now);
+ }
+
+- if (nfsdret != 0 && fd == 0)
++ if (nfsdret != 0 && wd < 0)
+ xlog_err("main: Neither NFS client nor NFSd found");
+
+ daemon_ready();