Ema has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/350561 )
Change subject: Release 4.1.5-1wm4 ...................................................................... Release 4.1.5-1wm4 - Drop -spersistent patches - Fix VSM file permissions - Do not split -sfile in 2^30 chunks, use INT64_MAX / INT32_MAX instead depending on the architecture Bug: T145661 Change-Id: I9d0e9f9ecbccdc32703f75ca34a433f1f0ad78d7 --- M debian/changelog R debian/patches/0001-gethdr_extrachance.patch D debian/patches/0001-varnishd-persistent-addrarg.patch R debian/patches/0002-exp-thread-realtime.patch D debian/patches/0002-varnishd-persistent-fallocate.patch A debian/patches/0003-vsm-perms.patch A debian/patches/0004-storage-file-off-t.patch D debian/patches/0004-varnishd-persistent-mmap-exit.patch M debian/patches/series 9 files changed, 47 insertions(+), 116 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/debs/varnish4 refs/changes/61/350561/1 diff --git a/debian/changelog b/debian/changelog index 9629d47..51f1b28 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +varnish (4.1.5-1wm4) jessie-wikimedia; urgency=medium + + * Drop -spersistent patches + * Fix VSM file permissions + * Do not split -sfile in 2^30 chunks, use INT64_MAX / INT32_MAX instead + depending on the architecture Bug: #T145661 + + -- Emanuele Rocca <[email protected]> Thu, 27 Apr 2017 16:13:00 +0200 + varnish (4.1.5-1wm3) jessie-wikimedia; urgency=medium * Introduce two varnish parameters to selectively activate the expiry thread diff --git a/debian/patches/0005-gethdr_extrachance.patch b/debian/patches/0001-gethdr_extrachance.patch similarity index 100% rename from debian/patches/0005-gethdr_extrachance.patch rename to debian/patches/0001-gethdr_extrachance.patch diff --git a/debian/patches/0001-varnishd-persistent-addrarg.patch b/debian/patches/0001-varnishd-persistent-addrarg.patch deleted file mode 100644 index b732c3e..0000000 --- a/debian/patches/0001-varnishd-persistent-addrarg.patch +++ /dev/null @@ -1,36 +0,0 @@ -From: Emanuele Rocca <[email protected]> -Date: Sat, 16 Jan 2016 14:23:07 +0100 -Subject: varnishd-persistent-addrarg - ---- - bin/varnishd/storage/mgt_storage_persistent.c | 10 ++++++++-- - 1 file changed, 8 insertions(+), 2 deletions(-) - -diff --git a/bin/varnishd/storage/mgt_storage_persistent.c b/bin/varnishd/storage/mgt_storage_persistent.c -index 76d6436..31b17d3 100644 ---- a/bin/varnishd/storage/mgt_storage_persistent.c -+++ b/bin/varnishd/storage/mgt_storage_persistent.c -@@ -160,8 +160,8 @@ smp_mgt_init(struct stevedore *parent, int ac, char * const *av) - VTAILQ_INIT(&sc->segments); - - /* Argument processing */ -- if (ac != 2) -- ARGV_ERR("(-spersistent) wrong number of arguments\n"); -+ if (ac < 2 || ac >3) -+ ARGV_ERR("(-spersistent) wrong number of arguments; should be file,address]\n"); - - i = STV_GetFile(av[0], &sc->fd, &sc->filename, "-spersistent"); - if (i == 2) -@@ -179,6 +179,12 @@ smp_mgt_init(struct stevedore *parent, int ac, char * const *av) - assert(i == sizeof sgn); - if (!strcmp(sgn.ident, "SILO")) - target = (void*)(uintptr_t)sgn.mapped; -+ else if(ac == 3) { // provided explicit addr arg for new storage -+ errno = 0; -+ target = (void*)(uintptr_t)strtoull(av[2], NULL, 0); -+ if(errno) -+ ARGV_ERR("(-spersistent) address argument '%s' invalid: %s", av[2], strerror(errno)); -+ } - else - target = NULL; - diff --git a/debian/patches/0006-exp-thread-realtime.patch b/debian/patches/0002-exp-thread-realtime.patch similarity index 100% rename from debian/patches/0006-exp-thread-realtime.patch rename to debian/patches/0002-exp-thread-realtime.patch diff --git a/debian/patches/0002-varnishd-persistent-fallocate.patch b/debian/patches/0002-varnishd-persistent-fallocate.patch deleted file mode 100644 index a356e16..0000000 --- a/debian/patches/0002-varnishd-persistent-fallocate.patch +++ /dev/null @@ -1,49 +0,0 @@ -From: Emanuele Rocca <[email protected]> -Date: Sat, 16 Jan 2016 14:23:44 +0100 -Subject: varnishd-persistent-fallocate - ---- - bin/varnishd/storage/mgt_storage_persistent.c | 23 +++++++++++++++++++++++ - 1 file changed, 23 insertions(+) - -diff --git a/bin/varnishd/storage/mgt_storage_persistent.c b/bin/varnishd/storage/mgt_storage_persistent.c -index 31b17d3..9ea6047 100644 ---- a/bin/varnishd/storage/mgt_storage_persistent.c -+++ b/bin/varnishd/storage/mgt_storage_persistent.c -@@ -36,6 +36,7 @@ - #include "config.h" - - #include <sys/mman.h> -+#include <fcntl.h> - - #include <errno.h> - #include <math.h> -@@ -174,6 +175,28 @@ smp_mgt_init(struct stevedore *parent, int ac, char * const *av) - - AZ(ftruncate(sc->fd, sc->mediasize)); - -+#if defined __linux__ && defined HAVE_FALLOCATE -+ /* fallocate new persistent files on Linux. -+ * Notes: -+ * 1) posix_fallocate() silently does horrible things if the kernel/fs -+ * doesn't have native support, hence direct fallocate() below. -+ * 2) XFS (but not ext4) has an odd behavior where it will fail with -+ * ENOSPC when fallocate() is called for a second time on the same -+ * large file (> half fs size) that was already fallocate()'d earlier. -+ */ -+ if(fallocate(sc->fd, 0, 0, sc->mediasize)) { -+ if(errno == ENOSYS || errno == EOPNOTSUPP) -+ printf("Warning: (-spersistent): fallocate() not supported by kernel/fs for file %s\n", sc->filename); -+ else -+ ARGV_ERR("(-spersistent): fallocate() for file %s failed: %s\n", -+ sc->filename, strerror(errno)); -+ } -+ else { -+ printf("(-spersistent): file %s fallocate()'d to size %lli\n", -+ sc->filename, (long long int)sc->mediasize); -+ } -+#endif -+ - /* Try to determine correct mmap address */ - i = read(sc->fd, &sgn, sizeof sgn); - assert(i == sizeof sgn); diff --git a/debian/patches/0003-vsm-perms.patch b/debian/patches/0003-vsm-perms.patch new file mode 100644 index 0000000..039cf63 --- /dev/null +++ b/debian/patches/0003-vsm-perms.patch @@ -0,0 +1,13 @@ +diff --git a/bin/varnishd/mgt/mgt_jail_unix.c b/bin/varnishd/mgt/mgt_jail_unix.c +index 3c9f65806..029c2b068 100644 +--- a/bin/varnishd/mgt/mgt_jail_unix.c ++++ b/bin/varnishd/mgt/mgt_jail_unix.c +@@ -257,7 +257,7 @@ vju_vsm_file(int fd) + { + /* Called under JAIL_MASTER_FILE */ + +- AZ(fchmod(fd, 0640)); ++ AZ(fchmod(fd, 0644)); + AZ(fchown(fd, 0, vju_gid)); + } + diff --git a/debian/patches/0004-storage-file-off-t.patch b/debian/patches/0004-storage-file-off-t.patch new file mode 100644 index 0000000..d1ce5c7 --- /dev/null +++ b/debian/patches/0004-storage-file-off-t.patch @@ -0,0 +1,21 @@ +diff --git a/bin/varnishd/storage/storage_file.c b/bin/varnishd/storage/storage_file.c +index 395e6081d..03bb4ed0f 100644 +--- a/bin/varnishd/storage/storage_file.c ++++ b/bin/varnishd/storage/storage_file.c +@@ -35,6 +35,7 @@ + + #include <errno.h> + #include <stdio.h> ++#include <stdint.h> + #include <stdlib.h> + + #include "cache/cache.h" +@@ -418,7 +419,7 @@ static void + smf_open(const struct stevedore *st) + { + struct smf_sc *sc; +- off_t fail = 1 << 30; /* XXX: where is OFF_T_MAX ? */ ++ off_t fail = sizeof(off_t) == sizeof(int32_t) ? INT32_MAX : INT64_MAX; + off_t sum = 0; + + ASSERT_CLI(); diff --git a/debian/patches/0004-varnishd-persistent-mmap-exit.patch b/debian/patches/0004-varnishd-persistent-mmap-exit.patch deleted file mode 100644 index ce63454..0000000 --- a/debian/patches/0004-varnishd-persistent-mmap-exit.patch +++ /dev/null @@ -1,26 +0,0 @@ -From: Emanuele Rocca <[email protected]> -Date: Sat, 16 Jan 2016 15:39:45 +0100 -Subject: varnishd-persistent-mmap-exit - -Detect and exit when persistent storage can't mmap a file at the -required address. ---- - bin/varnishd/storage/mgt_storage_persistent.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/bin/varnishd/storage/mgt_storage_persistent.c b/bin/varnishd/storage/mgt_storage_persistent.c -index 9ea6047..b311ba3 100644 ---- a/bin/varnishd/storage/mgt_storage_persistent.c -+++ b/bin/varnishd/storage/mgt_storage_persistent.c -@@ -218,6 +218,11 @@ smp_mgt_init(struct stevedore *parent, int ac, char * const *av) - ARGV_ERR("(-spersistent) failed to mmap (%s)\n", - strerror(errno)); - -+ if (target != NULL && sc->base != target) { -+ fprintf(stderr, "Could not mmap SILO (%s) at target %p, was mapped at %p instead\n", sc->filename, target, sc->base); -+ exit(75); /* EX_TEMPFAIL */ -+ } -+ - smp_def_sign(sc, &sc->idn, 0, "SILO"); - sc->ident = SIGN_DATA(&sc->idn); - diff --git a/debian/patches/series b/debian/patches/series index 4965e07..4efdcfa 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,5 +1,4 @@ -0001-varnishd-persistent-addrarg.patch -0002-varnishd-persistent-fallocate.patch -0004-varnishd-persistent-mmap-exit.patch -0005-gethdr_extrachance.patch -0006-exp-thread-realtime.patch +0001-gethdr_extrachance.patch +0002-exp-thread-realtime.patch +0003-vsm-perms.patch +0004-storage-file-off-t.patch -- To view, visit https://gerrit.wikimedia.org/r/350561 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9d0e9f9ecbccdc32703f75ca34a433f1f0ad78d7 Gerrit-PatchSet: 1 Gerrit-Project: operations/debs/varnish4 Gerrit-Branch: debian-wmf Gerrit-Owner: Ema <[email protected]> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
