aboutsummaryrefslogtreecommitdiffstats
path: root/community/ceph/44-missing-include2.patch
blob: 6974cd86ff0ae58c04f05b45a4129db9f3ce260e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
commit ff79cae5a1243111c8a039426081638d40a258fa
Author: Kefu Chai <kchai@redhat.com>
Date:   Mon Apr 12 17:28:56 2021 +0800

    common/Formatter: include used header
    
    otherwise it fails to build with gcc-toolset-10, like:
    
    ../src/common/Formatter.cc: In member function ‘virtual void ceph::XMLFormatter::close_section()’:
    ../src/common/Formatter.cc:449:8: error: ‘transform’ is not a member of ‘std’
      449 |   std::transform(section.begin(), section.end(), section.begin(),
          |        ^~~~~~~~~
    
    Signed-off-by: Kefu Chai <kchai@redhat.com>

diff --git a/src/common/Formatter.cc b/src/common/Formatter.cc
index b599e48b34..362deffb5a 100644
--- a/src/common/Formatter.cc
+++ b/src/common/Formatter.cc
@@ -19,6 +19,7 @@
 #include "include/buffer.h"
 
 #include <fmt/format.h>
+#include <algorithm>
 #include <set>
 #include <limits>
 
From 7c2f58ea5ec70e5606ab362e6f4cfda087cec65a Mon Sep 17 00:00:00 2001
From: Kefu Chai <kchai@redhat.com>
Date: Mon, 12 Apr 2021 17:32:59 +0800
Subject: [PATCH] mon,osd: always init local variable
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

this change silences the warning like:

../src/mon/Monitor.cc: In member function ‘void Monitor::handle_command(MonOpRequestRef)’:
../src/mon/Monitor.cc:3703:55: warning: ‘osd’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 3703 |     uint64_t seq = mgrstatmon()->get_last_osd_stat_seq(osd);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~

Signed-off-by: Kefu Chai <kchai@redhat.com>
---
 src/mon/Monitor.cc  | 2 +-
 src/osd/osd_types.h | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc
index 6126db9caa609..ffac8be278c16 100644
--- a/src/mon/Monitor.cc
+++ b/src/mon/Monitor.cc
@@ -3698,7 +3698,7 @@ void Monitor::handle_command(MonOpRequestRef op)
     rs = ss2.str();
     r = 0;
   } else if (prefix == "osd last-stat-seq") {
-    int64_t osd;
+    int64_t osd = 0;
     cmd_getval(cmdmap, "id", osd);
     uint64_t seq = mgrstatmon()->get_last_osd_stat_seq(osd);
     if (f) {
diff --git a/src/osd/osd_types.h b/src/osd/osd_types.h
index c0fe8f781c21e..fe2fe7defa9a8 100644
--- a/src/osd/osd_types.h
+++ b/src/osd/osd_types.h
@@ -1631,12 +1631,12 @@ struct pg_pool_t {
   }
 
   int64_t get_dedup_tier() const {
-    int64_t tier_id;
+    int64_t tier_id = 0;
     opts.get(pool_opts_t::DEDUP_TIER, &tier_id);
     return tier_id;
   }
   int64_t get_dedup_cdc_chunk_size() const {
-    int64_t chunk_size;
+    int64_t chunk_size = 0;
     opts.get(pool_opts_t::DEDUP_CDC_CHUNK_SIZE, &chunk_size);
     return chunk_size;
   }
From 03770f75562812c683ff1503d2032dcd66d83289 Mon Sep 17 00:00:00 2001
From: Kefu Chai <kchai@redhat.com>
Date: Mon, 12 Apr 2021 17:43:13 +0800
Subject: [PATCH] include/denc: include used header
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

to address the FTBFS like:

/home/kchai/ceph/src/include/denc.h: In member function ‘void DencDumper<T>::dump() const’:
/home/kchai/ceph/src/include/denc.h:121:60: error: ‘O_BINARY’ was not declared in this scope
     int fd = ::open(fn, O_WRONLY|O_TRUNC|O_CREAT|O_CLOEXEC|O_BINARY, 0644);
                                                            ^~~~~~~~
/home/kchai/ceph/src/include/denc.h:121:60: note: the macro ‘O_BINARY’ had not yet been defined
In file included from /home/kchai/ceph/src/include/statlite.h:14,
                 from /home/kchai/ceph/src/include/types.h:41,
                 from /home/kchai/ceph/src/auth/Crypto.h:19,
                 from /home/kchai/ceph/src/auth/Crypto.cc:21:

Signed-off-by: Kefu Chai <kchai@redhat.com>
---
 src/include/denc.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/include/denc.h b/src/include/denc.h
index 266121bd20cda..10fa8d0c87124 100644
--- a/src/include/denc.h
+++ b/src/include/denc.h
@@ -39,6 +39,7 @@
 #include <boost/intrusive/set.hpp>
 #include <boost/optional.hpp>
 
+#include "include/compat.h"
 #include "include/intarith.h"
 #include "include/int_types.h"
 #include "include/scope_guard.h"