diff options
author | Niclas Zeising <zeising@FreeBSD.org> | 2020-06-15 17:44:20 +0000 |
---|---|---|
committer | Niclas Zeising <zeising@FreeBSD.org> | 2020-06-15 17:44:20 +0000 |
commit | 84039a00844089107101fa0c968f1d0a1113ce36 (patch) | |
tree | c789c1676245047b3b8724cee4066b892d9d20e1 | |
parent | 175e8b9c8dc4b250d6f5c492e1675df51122ed17 (diff) | |
download | ports-84039a00844089107101fa0c968f1d0a1113ce36.tar.gz ports-84039a00844089107101fa0c968f1d0a1113ce36.zip |
MFH: r538811
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
Approved by: ports-secteam (joenum)
Notes
Notes:
svn path=/branches/2020Q2/; revision=538923
-rw-r--r-- | databases/rrdtool/Makefile | 2 | ||||
-rw-r--r-- | databases/rrdtool/files/patch-8829fa7.c | 35 |
2 files changed, 36 insertions, 1 deletions
diff --git a/databases/rrdtool/Makefile b/databases/rrdtool/Makefile index 507d71c64f35..6d8fefeefd6d 100644 --- a/databases/rrdtool/Makefile +++ b/databases/rrdtool/Makefile @@ -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/ diff --git a/databases/rrdtool/files/patch-8829fa7.c b/databases/rrdtool/files/patch-8829fa7.c new file mode 100644 index 000000000000..c6406a3f327c --- /dev/null +++ b/databases/rrdtool/files/patch-8829fa7.c @@ -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; |