summaryrefslogtreecommitdiff
path: root/skip/ceph/32-upstream32bitcleanup.patch
blob: 1fe036ed831ae9b57f132d931dd026744c6fd603 (plain)
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
submitted as https://github.com/ceph/ceph/pull/41239

commit 558adef26a2149b0dd644a2c9a7e2db8d370b556
Author: Kefu Chai <kchai@redhat.com>
Date:   Sat May 8 21:02:54 2021 +0800

    librbd/deep_copy: cast uint64_t to size_t for constructing SparseBufferlistExtent
    
    SparseBufferlistExtent's ctor accepts size_t, so, on a 32-bit platform,
    the parameter would be narrowed before passing to the ctor, and GCC
    complains at seeing this:
    
    /builds/a16bitsysop/aports/community/ceph/src/ceph-16.2.3/src/librbd/deep_copy/ObjectCopyRequest.cc:789:60: warning: narrowing conversion of 'object_extent.striper::LightweightObjectExtent::length'
    from 'uint64_t' {aka 'long long unsigned int'} to 'size_t' {aka 'unsigned int'} [-Wnarrowing]
      789 |             {io::SPARSE_EXTENT_STATE_ZEROED, object_extent.length});
          |                                              ~~~~~~~~~~~~~~^~~~~~
    
    this change make this cast explicit and silences the warning.
    
    Signed-off-by: Kefu Chai <kchai@redhat.com>

diff --git a/src/librbd/deep_copy/ObjectCopyRequest.cc b/src/librbd/deep_copy/ObjectCopyRequest.cc
index e86ed5ea1c..efc6749536 100644
--- a/src/librbd/deep_copy/ObjectCopyRequest.cc
+++ b/src/librbd/deep_copy/ObjectCopyRequest.cc
@@ -614,7 +614,8 @@ void ObjectCopyRequest<I>::merge_write_ops() {
 
         m_snapshot_sparse_bufferlist[src_snap_seq].insert(
           object_extent.offset, object_extent.length,
-          {io::SPARSE_EXTENT_STATE_DATA, object_extent.length,\
+          {io::SPARSE_EXTENT_STATE_DATA,
+           static_cast<size_t>(object_extent.length),
            std::move(sub_bl)});
 
         buffer_offset += object_extent.length;
diff --git a/src/librbd/io/CopyupRequest.cc b/src/librbd/io/CopyupRequest.cc
index d70851409f..a3af713151 100644
--- a/src/librbd/io/CopyupRequest.cc
+++ b/src/librbd/io/CopyupRequest.cc
@@ -711,7 +711,9 @@ int CopyupRequest<I>::prepare_copyup_data() {
 
       sparse_bufferlist.insert(
         object_offset, object_length,
-        {SPARSE_EXTENT_STATE_DATA, object_length, std::move(sub_bl)});
+        {SPARSE_EXTENT_STATE_DATA,
+         static_cast<size_t>(object_length),
+         std::move(sub_bl)});
     }
   } else {
     // copyup that will concurrently written to the HEAD revision with the
commit 130fdf7bcfd2b4c5a5b34809952b69b70e9c11a4
Author: Kefu Chai <kchai@redhat.com>
Date:   Sat May 8 20:59:07 2021 +0800

    mgr/PyModule: use Py_ssize_t for the PyList index
    
    also silences the warnings like:
    
    mgr/PyModule.cc:574:30: warning: comparison of integer expressions of different signedness: 'unsigned int' and 'Py_ssize_t' {aka 'int'} [-Wsign-compare]
      574 |       for (unsigned i = 0; i < PyList_Size(p); ++i) {
          |                            ~~^~~~~~~~~~~~~~~~
    
    Signed-off-by: Kefu Chai <kchai@redhat.com>

diff --git a/src/mgr/PyModule.cc b/src/mgr/PyModule.cc
index 28c76fe7ed..ff1ff85e7e 100644
--- a/src/mgr/PyModule.cc
+++ b/src/mgr/PyModule.cc
@@ -562,7 +562,7 @@ int PyModule::load_options()
     }
     p = PyDict_GetItemString(pOption, "enum_allowed");
     if (p && PyObject_TypeCheck(p, &PyList_Type)) {
-      for (unsigned i = 0; i < PyList_Size(p); ++i) {
+      for (Py_ssize_t i = 0; i < PyList_Size(p); ++i) {
 	auto q = PyList_GetItem(p, i);
 	if (q) {
 	  auto r = PyObject_Str(q);
@@ -573,7 +573,7 @@ int PyModule::load_options()
     }
     p = PyDict_GetItemString(pOption, "see_also");
     if (p && PyObject_TypeCheck(p, &PyList_Type)) {
-      for (unsigned i = 0; i < PyList_Size(p); ++i) {
+      for (Py_ssize_t i = 0; i < PyList_Size(p); ++i) {
 	auto q = PyList_GetItem(p, i);
 	if (q && PyObject_TypeCheck(q, &PyUnicode_Type)) {
 	  option.see_also.insert(PyUnicode_AsUTF8(q));
@@ -582,7 +582,7 @@ int PyModule::load_options()
     }
     p = PyDict_GetItemString(pOption, "tags");
     if (p && PyObject_TypeCheck(p, &PyList_Type)) {
-      for (unsigned i = 0; i < PyList_Size(p); ++i) {
+      for (Py_ssize_t i = 0; i < PyList_Size(p); ++i) {
 	auto q = PyList_GetItem(p, i);
 	if (q && PyObject_TypeCheck(q, &PyUnicode_Type)) {
 	  option.tags.insert(PyUnicode_AsUTF8(q));
commit 3bf4b32c9bd15652b24bc4b8c8ea07fb6bb04357
Author: Kefu Chai <kchai@redhat.com>
Date:   Sat May 8 20:51:19 2021 +0800

    os/bluestore: print size_t using %xz
    
    we cannot assume that size_t is an alias of "long"
    
    Signed-off-by: Kefu Chai <kchai@redhat.com>

diff --git a/src/os/bluestore/Allocator.cc b/src/os/bluestore/Allocator.cc
index 75f3172ca5..3428545414 100644
--- a/src/os/bluestore/Allocator.cc
+++ b/src/os/bluestore/Allocator.cc
@@ -81,8 +81,8 @@ public:
         f->open_object_section("free");
         char off_hex[30];
         char len_hex[30];
-        snprintf(off_hex, sizeof(off_hex) - 1, "0x%lx", off);
-        snprintf(len_hex, sizeof(len_hex) - 1, "0x%lx", len);
+        snprintf(off_hex, sizeof(off_hex) - 1, "0x%zx", off);
+        snprintf(len_hex, sizeof(len_hex) - 1, "0x%zx", len);
         f->dump_string("offset", off_hex);
         f->dump_string("length", len_hex);
         f->close_section();
commit 3af466ee84209896f8671046c837350e736f15de
Author: Kefu Chai <kchai@redhat.com>
Date:   Sat May 8 20:50:08 2021 +0800

    client: print int64_t using PRId64
    
    we cannot assume that int64_t is an alias of "long"
    
    Signed-off-by: Kefu Chai <kchai@redhat.com>

diff --git a/src/client/Client.cc b/src/client/Client.cc
index acdd8f0934..7352824f6c 100644
--- a/src/client/Client.cc
+++ b/src/client/Client.cc
@@ -12772,7 +12772,7 @@ size_t Client::_vxattrcb_cluster_fsid(Inode *in, char *val, size_t size)
 size_t Client::_vxattrcb_client_id(Inode *in, char *val, size_t size)
 {
   auto name = messenger->get_myname();
-  return snprintf(val, size, "%s%ld", name.type_str(), name.num());
+  return snprintf(val, size, "%s%" PRId64, name.type_str(), name.num());
 }
 
 #define CEPH_XATTR_NAME(_type, _name) "ceph." #_type "." #_name