From owner-svn-ports-all@freebsd.org Sun Jun 14 15:22:25 2020 Return-Path: Delivered-To: svn-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F254033CF3D; Sun, 14 Jun 2020 15:22:25 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49lJ9Y6Bcqz4YyH; Sun, 14 Jun 2020 15:22:25 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CFC85E37E; Sun, 14 Jun 2020 15:22:25 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05EFMPgZ038273; Sun, 14 Jun 2020 15:22:25 GMT (envelope-from zeising@FreeBSD.org) Received: (from zeising@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05EFMPFa038270; Sun, 14 Jun 2020 15:22:25 GMT (envelope-from zeising@FreeBSD.org) Message-Id: <202006141522.05EFMPFa038270@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zeising set sender to zeising@FreeBSD.org using -f From: Niclas Zeising Date: Sun, 14 Jun 2020 15:22:25 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r538811 - in head/databases/rrdtool: . files X-SVN-Group: ports-head X-SVN-Commit-Author: zeising X-SVN-Commit-Paths: in head/databases/rrdtool: . files X-SVN-Commit-Revision: 538811 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2020 15:22:26 -0000 Author: zeising Date: Sun Jun 14 15:22:25 2020 New Revision: 538811 URL: https://svnweb.freebsd.org/changeset/ports/538811 Log: databases/rrdtool: Fix resize on ZFS Add an upstream patch that fixes resize on ZFS. Since ZFS does not support posix_fallocate(), returning EINVAL, the patch simply ignores this error from posix_fallocate(). PR: 245898 Reported by: Tomohiro Hosaka MFH: 2020Q2 Added: head/databases/rrdtool/files/patch-8829fa7.c (contents, props changed) Modified: head/databases/rrdtool/Makefile Modified: head/databases/rrdtool/Makefile ============================================================================== --- head/databases/rrdtool/Makefile Sun Jun 14 15:19:27 2020 (r538810) +++ head/databases/rrdtool/Makefile Sun Jun 14 15:22:25 2020 (r538811) @@ -3,7 +3,7 @@ PORTNAME= rrdtool PORTVERSION= 1.7.2 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= databases graphics MASTER_SITES= http://oss.oetiker.ch/rrdtool/pub/ Added: head/databases/rrdtool/files/patch-8829fa7.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/databases/rrdtool/files/patch-8829fa7.c Sun Jun 14 15:22:25 2020 (r538811) @@ -0,0 +1,35 @@ +From 8829fa758f3e585f20094cff69b32489f4cce3e7 Mon Sep 17 00:00:00 2001 +From: Niclas Zeising +Date: Sun, 14 Jun 2020 11:31:33 +0200 +Subject: [PATCH] rrd_open: Ignore EINVAL from posix_fallocate() + +ZFS on FreeBSD (at least) does not support posix_fallocate(), +returning EINVAL instead. Ignore this error and continue normally. +Without this change, it is not possible to resize rrd files on ZFS. + +This fixes #1082 + +Signed-off-by: Niclas Zeising +--- + src/rrd_open.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/src/rrd_open.c b/src/rrd_open.c +index d8005fe4..00dfb8ca 100644 +--- src/rrd_open.c ++++ src/rrd_open.c +@@ -363,7 +363,13 @@ rrd_file_t *rrd_open( + */ + int fret = + posix_fallocate(rrd_simple_file->fd, 0, newfile_size); +- if (fret) { ++ /* ZFS (on FreeBSD) does not support posix_fallocate(), always returning ++ * EINVAL. Ignore this error and continue anyway. ++ * Without this, resize isn't possible on ZFS filesystems. ++ */ ++ if (fret == EINVAL) { ++ /* DO NOTHING */ ++ } else if (fret) { + rrd_set_error("posix_fallocate '%s': %s", file_name, + rrd_strerror(fret)); + goto out_close;