commit:     2a677e4cdb886a25f62f26059c4247b96c7545a4
Author:     Tomáš Mózes <hydrapolic <AT> gmail <DOT> com>
AuthorDate: Mon Jan 27 06:54:03 2020 +0000
Commit:     Alexys Jacob <ultrabug <AT> gentoo <DOT> org>
CommitDate: Sun Feb  9 16:31:54 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2a677e4c

sys-cluster/glusterfs: fix seek

Bug: https://bugs.gentoo.org/705536
Package-Manager: Portage-2.3.85, Repoman-2.3.20
Signed-off-by: Tomáš Mózes <hydrapolic <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/14468
Signed-off-by: Alexys Jacob <ultrabug <AT> gentoo.org>

 .../glusterfs/files/glusterfs-6.7-fix-seek.patch   | 45 ++++++++++++++++++++++
 ...lusterfs-6.7.ebuild => glusterfs-6.7-r1.ebuild} |  4 ++
 ...lusterfs-7.2.ebuild => glusterfs-7.2-r1.ebuild} |  4 ++
 3 files changed, 53 insertions(+)

diff --git a/sys-cluster/glusterfs/files/glusterfs-6.7-fix-seek.patch 
b/sys-cluster/glusterfs/files/glusterfs-6.7-fix-seek.patch
new file mode 100644
index 00000000000..07d1ecef037
--- /dev/null
+++ b/sys-cluster/glusterfs/files/glusterfs-6.7-fix-seek.patch
@@ -0,0 +1,45 @@
+diff --git a/xlators/performance/open-behind/src/open-behind.c 
b/xlators/performance/open-behind/src/open-behind.c
+index 70a144abb5..95e00dbd79 100644
+--- a/xlators/performance/open-behind/src/open-behind.c
++++ b/xlators/performance/open-behind/src/open-behind.c
+@@ -708,6 +708,32 @@ ob_fstat(call_frame_t *frame, xlator_t *this, fd_t *fd, 
dict_t *xdata)
+     return 0;
+ }
+ 
++int
++ob_seek(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
++        gf_seek_what_t what, dict_t *xdata)
++{
++    call_stub_t *stub = NULL;
++    fd_t *wind_fd = NULL;
++
++    wind_fd = ob_get_wind_fd(this, fd, NULL);
++
++    stub = fop_seek_stub(frame, default_seek_resume, wind_fd, offset, what,
++                         xdata);
++
++    fd_unref(wind_fd);
++
++    if (!stub)
++        goto err;
++
++    open_and_resume(this, wind_fd, stub);
++
++    return 0;
++err:
++    STACK_UNWIND_STRICT(fstat, frame, -1, ENOMEM, 0, 0);
++
++    return 0;
++}
++
+ int
+ ob_flush(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata)
+ {
+@@ -1256,6 +1282,7 @@ struct xlator_fops fops = {
+     .flush = ob_flush,
+     .fsync = ob_fsync,
+     .fstat = ob_fstat,
++    .seek = ob_seek,
+     .ftruncate = ob_ftruncate,
+     .fsetxattr = ob_fsetxattr,
+     .setxattr = ob_setxattr,

diff --git a/sys-cluster/glusterfs/glusterfs-6.7.ebuild 
b/sys-cluster/glusterfs/glusterfs-6.7-r1.ebuild
similarity index 97%
rename from sys-cluster/glusterfs/glusterfs-6.7.ebuild
rename to sys-cluster/glusterfs/glusterfs-6.7-r1.ebuild
index 9bb5a61620b..d36a647109c 100644
--- a/sys-cluster/glusterfs/glusterfs-6.7.ebuild
+++ b/sys-cluster/glusterfs/glusterfs-6.7-r1.ebuild
@@ -83,6 +83,10 @@ src_prepare() {
        # https://bugzilla.redhat.com/show_bug.cgi?id=1786983
        eapply "${FILESDIR}/glusterfs-6.7-fix-rebalance-crash.patch"
 
+       # https://bugs.gentoo.org/705536
+       # https://bugzilla.redhat.com/show_bug.cgi?id=1793990
+       eapply "${FILESDIR}/glusterfs-6.7-fix-seek.patch"
+
        # build rpc-transport and xlators only once as shared libs
        find rpc/rpc-transport xlators -name Makefile.am |
                xargs sed -i 's|.*$(top_srcdir).*\.sym|\0 -shared|' || die

diff --git a/sys-cluster/glusterfs/glusterfs-7.2.ebuild 
b/sys-cluster/glusterfs/glusterfs-7.2-r1.ebuild
similarity index 97%
rename from sys-cluster/glusterfs/glusterfs-7.2.ebuild
rename to sys-cluster/glusterfs/glusterfs-7.2-r1.ebuild
index 27be5d5543a..d122e64c226 100644
--- a/sys-cluster/glusterfs/glusterfs-7.2.ebuild
+++ b/sys-cluster/glusterfs/glusterfs-7.2-r1.ebuild
@@ -80,6 +80,10 @@ pkg_setup() {
 src_prepare() {
        default
 
+       # https://bugs.gentoo.org/705536
+       # https://bugzilla.redhat.com/show_bug.cgi?id=1793990
+       eapply "${FILESDIR}/glusterfs-6.7-fix-seek.patch"
+
        # build rpc-transport and xlators only once as shared libs
        find rpc/rpc-transport xlators -name Makefile.am |
                xargs sed -i 's|.*$(top_srcdir).*\.sym|\0 -shared|' || die

Reply via email to