sys-cluster/ceph: remove unused patches

Closes: https://github.com/gentoo/gentoo/pull/3900
This commit is contained in:
Michael Mair-Keimberger (asterix)
2017-02-10 23:32:47 +01:00
committed by David Seifert
parent 9448a406d7
commit df8009b5aa
4 changed files with 0 additions and 271 deletions
@@ -1,50 +0,0 @@
diff --git a/src/common/RWLock.h b/src/common/RWLock.h
index 1a70ef1..2676ede 100644
--- a/src/common/RWLock.h
+++ b/src/common/RWLock.h
@@ -18,6 +18,7 @@
#define CEPH_RWLock_Posix__H
#include <pthread.h>
+#include "include/assert.h"
#include "lockdep.h"
#include "include/atomic.h"
diff --git a/src/osd/ECBackend.cc b/src/osd/ECBackend.cc
index 39e3429..64cd74f 100644
--- a/src/osd/ECBackend.cc
+++ b/src/osd/ECBackend.cc
@@ -13,7 +13,7 @@
*/
#include <boost/variant.hpp>
-#include <boost/optional.hpp>
+#include <boost/optional/optional_io.hpp>
#include <iostream>
#include <sstream>
@@ -81,7 +81,7 @@ ostream &operator<<(ostream &lhs, const ECBackend::read_result_t &rhs)
lhs << "read_result_t(r=" << rhs.r
<< ", errors=" << rhs.errors;
if (rhs.attrs) {
- lhs << ", attrs=" << rhs.attrs;
+ lhs << ", attrs=" << rhs.attrs.get();
} else {
lhs << ", noattrs";
}
diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc
index c8fb01e..b04f8f4 100644
--- a/src/osd/ReplicatedPG.cc
+++ b/src/osd/ReplicatedPG.cc
@@ -5065,7 +5065,10 @@ void ReplicatedPG::do_osd_op_effects(OpContext *ctx)
for (list<OpContext::NotifyAck>::iterator p = ctx->notify_acks.begin();
p != ctx->notify_acks.end();
++p) {
- dout(10) << "notify_ack " << make_pair(p->watch_cookie, p->notify_id) << dendl;
+ if (p->watch_cookie)
+ dout(10) << "notify_ack " << make_pair(p->watch_cookie.get(), p->notify_id) << dendl;
+ else
+ dout(10) << "notify_ack " << make_pair("NULL", p->notify_id) << dendl;
for (map<pair<uint64_t, entity_name_t>, WatchRef>::iterator i =
ctx->obc->watchers.begin();
i != ctx->obc->watchers.end();
@@ -1,109 +0,0 @@
From b78a1be835706e7dabc505be343945d0ac05697d Mon Sep 17 00:00:00 2001
From: Kefu Chai <kchai@redhat.com>
Date: Thu, 30 Jun 2016 13:24:22 +0800
Subject: [PATCH] mon: Monitor: validate prefix on handle_command()
Fixes: http://tracker.ceph.com/issues/16297
Signed-off-by: You Ji <youji@ebay.com>
(cherry picked from commit 7cb3434fed03a5497abfd00bcec7276b70df0654)
Conflicts:
src/mon/Monitor.cc (the signature of Monitor::reply_command()
changed a little bit in master, so adapt the
commit to work with the old method)
---
src/mon/Monitor.cc | 23 ++++++++++++++++++++++-
src/test/librados/cmd.cc | 35 +++++++++++++++++++++++++++++++++++
2 files changed, 57 insertions(+), 1 deletion(-)
diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc
index 48563ad..d499f0c 100644
--- a/src/mon/Monitor.cc
+++ b/src/mon/Monitor.cc
@@ -2565,7 +2565,19 @@ void Monitor::handle_command(MMonCommand *m)
return;
}
- cmd_getval(g_ceph_context, cmdmap, "prefix", prefix);
+ // check return value. If no prefix parameter provided,
+ // return value will be false, then return error info.
+ if(!cmd_getval(g_ceph_context, cmdmap, "prefix", prefix)) {
+ reply_command(m, -EINVAL, "command prefix not found", 0);
+ return;
+ }
+
+ // check prefix is empty
+ if (prefix.empty()) {
+ reply_command(m, -EINVAL, "command prefix must not be empty", 0);
+ return;
+ }
+
if (prefix == "get_command_descriptions") {
bufferlist rdata;
Formatter *f = Formatter::create("json");
@@ -2586,6 +2598,15 @@ void Monitor::handle_command(MMonCommand *m)
boost::scoped_ptr<Formatter> f(Formatter::create(format));
get_str_vec(prefix, fullcmd);
+
+ // make sure fullcmd is not empty.
+ // invalid prefix will cause empty vector fullcmd.
+ // such as, prefix=";,,;"
+ if (fullcmd.empty()) {
+ reply_command(m, -EINVAL, "command requires a prefix to be valid", 0);
+ return;
+ }
+
module = fullcmd[0];
// validate command is in leader map
diff --git a/src/test/librados/cmd.cc b/src/test/librados/cmd.cc
index 4f327a0..0a7ed16 100644
--- a/src/test/librados/cmd.cc
+++ b/src/test/librados/cmd.cc
@@ -49,6 +49,41 @@ TEST(LibRadosCmd, MonDescribe) {
rados_buffer_free(buf);
rados_buffer_free(st);
+ cmd[0] = (char *)"";
+ ASSERT_EQ(-EINVAL, rados_mon_command(cluster, (const char **)cmd, 1, "{}", 2, &buf, &buflen, &st, &stlen));
+ rados_buffer_free(buf);
+ rados_buffer_free(st);
+
+ cmd[0] = (char *)"{}";
+ ASSERT_EQ(-EINVAL, rados_mon_command(cluster, (const char **)cmd, 1, "", 0, &buf, &buflen, &st, &stlen));
+ rados_buffer_free(buf);
+ rados_buffer_free(st);
+
+ cmd[0] = (char *)"{\"abc\":\"something\"}";
+ ASSERT_EQ(-EINVAL, rados_mon_command(cluster, (const char **)cmd, 1, "", 0, &buf, &buflen, &st, &stlen));
+ rados_buffer_free(buf);
+ rados_buffer_free(st);
+
+ cmd[0] = (char *)"{\"prefix\":\"\"}";
+ ASSERT_EQ(-EINVAL, rados_mon_command(cluster, (const char **)cmd, 1, "", 0, &buf, &buflen, &st, &stlen));
+ rados_buffer_free(buf);
+ rados_buffer_free(st);
+
+ cmd[0] = (char *)"{\"prefix\":\" \"}";
+ ASSERT_EQ(-EINVAL, rados_mon_command(cluster, (const char **)cmd, 1, "", 0, &buf, &buflen, &st, &stlen));
+ rados_buffer_free(buf);
+ rados_buffer_free(st);
+
+ cmd[0] = (char *)"{\"prefix\":\";;;,,,;;,,\"}";
+ ASSERT_EQ(-EINVAL, rados_mon_command(cluster, (const char **)cmd, 1, "", 0, &buf, &buflen, &st, &stlen));
+ rados_buffer_free(buf);
+ rados_buffer_free(st);
+
+ cmd[0] = (char *)"{\"prefix\":\"extra command\"}";
+ ASSERT_EQ(-EINVAL, rados_mon_command(cluster, (const char **)cmd, 1, "", 0, &buf, &buflen, &st, &stlen));
+ rados_buffer_free(buf);
+ rados_buffer_free(st);
+
cmd[0] = (char *)"{\"prefix\":\"mon_status\"}";
ASSERT_EQ(0, rados_mon_command(cluster, (const char **)cmd, 1, "", 0, &buf, &buflen, &st, &stlen));
ASSERT_LT(0u, buflen);
--
2.9.0
@@ -1,25 +0,0 @@
From 0160e50fa9b255ad338a50b97bcbb2bfa56aa93d Mon Sep 17 00:00:00 2001
From: Your Name <you@example.com>
Date: Tue, 3 May 2016 10:51:54 -0500
Subject: [PATCH] armv7l doesnt support -momit-leaf-frame-pointer
---
src/rocksdb/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/rocksdb/Makefile b/src/rocksdb/Makefile
index c64ea36..541dbf3 100644
--- a/src/rocksdb/Makefile
+++ b/src/rocksdb/Makefile
@@ -84,7 +84,7 @@ endif
# compile with -O2 if debug level is not 2
ifneq ($(DEBUG_LEVEL), 2)
OPT += -O2 -fno-omit-frame-pointer
-ifneq ($(MACHINE),ppc64) # ppc64 doesn't support -momit-leaf-frame-pointer
+ifneq ($(MACHINE),$(filter $(MACHINE),ppc64 armv7l)) # ppc64 and armv7l doesn't support -momit-leaf-frame-pointer
OPT += -momit-leaf-frame-pointer
endif
endif
--
2.7.3
@@ -1,87 +0,0 @@
diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc
index 10c8bfc..98843d7 100644
--- a/src/mon/Monitor.cc
+++ b/src/mon/Monitor.cc
@@ -2631,7 +2631,19 @@ void Monitor::handle_command(MonOpRequestRef op)
return;
}
- cmd_getval(g_ceph_context, cmdmap, "prefix", prefix);
+ // check return value. If no prefix parameter provided,
+ // return value will be false, then return error info.
+ if(!cmd_getval(g_ceph_context, cmdmap, "prefix", prefix)) {
+ reply_command(op, -EINVAL, "command prefix not found", 0);
+ return;
+ }
+
+ // check prefix is empty
+ if (prefix.empty()) {
+ reply_command(op, -EINVAL, "command prefix must not be empty", 0);
+ return;
+ }
+
if (prefix == "get_command_descriptions") {
bufferlist rdata;
Formatter *f = Formatter::create("json");
@@ -2652,6 +2664,15 @@ void Monitor::handle_command(MonOpRequestRef op)
boost::scoped_ptr<Formatter> f(Formatter::create(format));
get_str_vec(prefix, fullcmd);
+
+ // make sure fullcmd is not empty.
+ // invalid prefix will cause empty vector fullcmd.
+ // such as, prefix=";,,;"
+ if (fullcmd.empty()) {
+ reply_command(op, -EINVAL, "command requires a prefix to be valid", 0);
+ return;
+ }
+
module = fullcmd[0];
// validate command is in leader map
diff --git a/src/test/librados/cmd.cc b/src/test/librados/cmd.cc
index 9261fb5..878a8af 100644
--- a/src/test/librados/cmd.cc
+++ b/src/test/librados/cmd.cc
@@ -48,6 +48,41 @@ TEST(LibRadosCmd, MonDescribe) {
rados_buffer_free(buf);
rados_buffer_free(st);
+ cmd[0] = (char *)"";
+ ASSERT_EQ(-EINVAL, rados_mon_command(cluster, (const char **)cmd, 1, "{}", 2, &buf, &buflen, &st, &stlen));
+ rados_buffer_free(buf);
+ rados_buffer_free(st);
+
+ cmd[0] = (char *)"{}";
+ ASSERT_EQ(-EINVAL, rados_mon_command(cluster, (const char **)cmd, 1, "", 0, &buf, &buflen, &st, &stlen));
+ rados_buffer_free(buf);
+ rados_buffer_free(st);
+
+ cmd[0] = (char *)"{\"abc\":\"something\"}";
+ ASSERT_EQ(-EINVAL, rados_mon_command(cluster, (const char **)cmd, 1, "", 0, &buf, &buflen, &st, &stlen));
+ rados_buffer_free(buf);
+ rados_buffer_free(st);
+
+ cmd[0] = (char *)"{\"prefix\":\"\"}";
+ ASSERT_EQ(-EINVAL, rados_mon_command(cluster, (const char **)cmd, 1, "", 0, &buf, &buflen, &st, &stlen));
+ rados_buffer_free(buf);
+ rados_buffer_free(st);
+
+ cmd[0] = (char *)"{\"prefix\":\" \"}";
+ ASSERT_EQ(-EINVAL, rados_mon_command(cluster, (const char **)cmd, 1, "", 0, &buf, &buflen, &st, &stlen));
+ rados_buffer_free(buf);
+ rados_buffer_free(st);
+
+ cmd[0] = (char *)"{\"prefix\":\";;;,,,;;,,\"}";
+ ASSERT_EQ(-EINVAL, rados_mon_command(cluster, (const char **)cmd, 1, "", 0, &buf, &buflen, &st, &stlen));
+ rados_buffer_free(buf);
+ rados_buffer_free(st);
+
+ cmd[0] = (char *)"{\"prefix\":\"extra command\"}";
+ ASSERT_EQ(-EINVAL, rados_mon_command(cluster, (const char **)cmd, 1, "", 0, &buf, &buflen, &st, &stlen));
+ rados_buffer_free(buf);
+ rados_buffer_free(st);
+
cmd[0] = (char *)"{\"prefix\":\"mon_status\"}";
ASSERT_EQ(0, rados_mon_command(cluster, (const char **)cmd, 1, "", 0, &buf, &buflen, &st, &stlen));
ASSERT_LT(0u, buflen);