Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package bees for openSUSE:Factory checked in 
at 2022-09-05 21:22:15
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/bees (Old)
 and      /work/SRC/openSUSE:Factory/.bees.new.2083 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "bees"

Mon Sep  5 21:22:15 2022 rev:3 rq:1001259 version:0.7

Changes:
--------
--- /work/SRC/openSUSE:Factory/bees/bees.changes        2021-10-06 
19:50:19.852070317 +0200
+++ /work/SRC/openSUSE:Factory/.bees.new.2083/bees.changes      2022-09-05 
21:22:21.649189936 +0200
@@ -1,0 +2,6 @@
+Mon Sep  5 00:00:00 CEST 2022 - dste...@suse.cz
+
+- Added patch: 0001-fs-fix-FIEMAP_MAX_OFFSET-type-silliness-in-fiemap.h.patch
+  (fix build on ppc64le)
+
+-------------------------------------------------------------------

New:
----
  0001-fs-fix-FIEMAP_MAX_OFFSET-type-silliness-in-fiemap.h.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ bees.spec ++++++
--- /var/tmp/diff_new_pack.TVSNVA/_old  2022-09-05 21:22:22.141191235 +0200
+++ /var/tmp/diff_new_pack.TVSNVA/_new  2022-09-05 21:22:22.145191245 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package bees
 #
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -25,6 +25,7 @@
 URL:            https://github.com/Zygo/bees
 Source:         
https://github.com/Zygo/bees/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
 Patch1:         fix-Makefile-version.diff
+Patch2:         0001-fs-fix-FIEMAP_MAX_OFFSET-type-silliness-in-fiemap.h.patch
 BuildRequires:  gcc-c++
 BuildRequires:  libbtrfs-devel
 BuildRequires:  libuuid-devel
@@ -50,6 +51,7 @@
 %prep
 %setup -q
 %patch1 -p1
+%patch2 -p1
 
 %build
 cat >localconf <<-EOF

++++++ 0001-fs-fix-FIEMAP_MAX_OFFSET-type-silliness-in-fiemap.h.patch ++++++
>From 12e80658a8cfb5dc1d8676e3696681ad32fab552 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <b...@furryterror.org>
Date: Wed, 6 Oct 2021 15:05:28 -0400
Subject: [PATCH] fs: fix FIEMAP_MAX_OFFSET type silliness in fiemap.h

In fiemap.h the members of struct fiemap are declared as __u64, but the
FIEMAP_MAX_OFFSET macro is an unsigned long long value:

        $ grep FIEMAP_MAX_OFFSET -r /usr/include/
        /usr/include/linux/fiemap.h:#define FIEMAP_MAX_OFFSET   (~0ULL)
        $ grep fe_length -r /usr/include/
        /usr/include/linux/fiemap.h:    __u64 fe_length;   /* length in bytes 
for this extent */

This results in a type mismatch error on architectures like ppc64le:

        fiemap.cc:31:35: note:   deduced conflicting types for parameter 'const 
_Tp' ('long unsigned int' and 'long long unsigned int')
            31 |                 fm.fm_length = min(fm.fm_length, 
FIEMAP_MAX_OFFSET - fm.fm_start);
               |                                
~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Work around this by copying the macro into a uint64_t constant,
and not using the macro any more.

Fixes: https://github.com/Zygo/bees/issues/194

Signed-off-by: Zygo Blaxell <b...@furryterror.org>
---
 include/crucible/fs.h | 6 +++++-
 src/fiemap.cc         | 4 ++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/include/crucible/fs.h b/include/crucible/fs.h
index fcd61e055197..dae574015f8c 100644
--- a/include/crucible/fs.h
+++ b/include/crucible/fs.h
@@ -143,8 +143,12 @@ namespace crucible {
 
        struct Fiemap : public fiemap {
 
+               // because fiemap.h insists on giving FIEMAP_MAX_OFFSET
+               // a different type from the struct fiemap members
+               static const uint64_t s_fiemap_max_offset = FIEMAP_MAX_OFFSET;
+
                // Get entire file
-               Fiemap(uint64_t start = 0, uint64_t length = FIEMAP_MAX_OFFSET);
+               Fiemap(uint64_t start = 0, uint64_t length = 
s_fiemap_max_offset);
 
                void do_ioctl(int fd);
 
diff --git a/src/fiemap.cc b/src/fiemap.cc
index 1618d3b04308..fb6085ac9738 100644
--- a/src/fiemap.cc
+++ b/src/fiemap.cc
@@ -28,13 +28,13 @@ main(int argc, char **argv)
                if (argc > 2) { fm.fm_start = stoull(argv[2], nullptr, 0); }
                if (argc > 3) { fm.fm_length = stoull(argv[3], nullptr, 0); }
                if (argc > 4) { fm.fm_flags = stoull(argv[4], nullptr, 0); }
-               fm.fm_length = min(fm.fm_length, FIEMAP_MAX_OFFSET - 
fm.fm_start);
+               fm.fm_length = min(fm.fm_length, Fiemap::s_fiemap_max_offset - 
fm.fm_start);
                uint64_t stop_at = fm.fm_start + fm.fm_length;
                uint64_t last_byte = fm.fm_start;
                do {
                        fm.do_ioctl(fd);
                        // cerr << fm;
-                       uint64_t last_logical = FIEMAP_MAX_OFFSET;
+                       uint64_t last_logical = Fiemap::s_fiemap_max_offset;
                        for (auto &extent : fm.m_extents) {
                                if (extent.fe_logical > last_byte) {
                                        cout << "Log " << to_hex(last_byte) << 
".." << to_hex(extent.fe_logical) << " Hole" << endl;
-- 
2.33.0

Reply via email to