[Pkg-ceph-commits] [ceph] 03/05: bug-8624 patch
Dmitry Smirnov
onlyjob at moszumanska.debian.org
Sun Jul 6 00:52:38 UTC 2014
This is an automated email from the git hooks/post-receive script.
onlyjob pushed a commit to branch master
in repository ceph.
commit feb9998
Author: Dmitry Smirnov <onlyjob at member.fsf.org>
Date: Sat Jul 5 08:16:35 2014
bug-8624 patch
---
debian/patches/bug-8624a.patch | 64 ++++++++++++++++++++++++++++++++++++++++++
debian/patches/bug-8624b.patch | 41 +++++++++++++++++++++++++++
debian/patches/series | 2 ++
3 files changed, 107 insertions(+)
diff --git a/debian/patches/bug-8624a.patch b/debian/patches/bug-8624a.patch
new file mode 100644
index 0000000..e7ba865
--- /dev/null
+++ b/debian/patches/bug-8624a.patch
@@ -0,0 +1,64 @@
+From d6f68132cead3b03027827c621864d5fc322daca Mon Sep 17 00:00:00 2001
+From: Joao Eduardo Luis <joao.luis at inktank.com>
+Date: Fri, 20 Jun 2014 16:13:28 +0100
+Subject: [PATCH] mon: MDSMonitor: do not allow ec pools to be used for data or
+ metadata
+
+Fixes: #8624
+
+Signed-off-by: Joao Eduardo Luis <joao.luis at inktank.com>
+---
+ src/mon/MDSMonitor.cc | 31 +++++++++++++++++++++++++++++++
+ 1 file changed, 31 insertions(+)
+
+--- a/src/mon/MDSMonitor.cc
++++ b/src/mon/MDSMonitor.cc
+@@ -1067,8 +1067,16 @@
+ poolid = -1;
+ ss << "pool '" << poolname << "' does not exist";
+ }
+ }
++ const pg_pool_t *p = mon->osdmon()->osdmap.get_pg_pool(poolid);
++ assert(p != NULL);
++ if (p->is_erasure()) {
++ // I'm sorry Dave, I'm afraid I can't do that
++ r = -EINVAL;
++ poolid = -1;
++ ss << "can't use pool '" << poolname << "' as it's an erasure-code pool";
++ }
+ if (poolid >= 0) {
+ pending_mdsmap.add_data_pool(poolid);
+ ss << "added data pool " << poolid << " to mdsmap";
+ r = 0;
+@@ -1115,8 +1123,31 @@
+ << cmd_vartype_stringify(cmdmap["data"]) << "'";
+ r = -EINVAL;
+ goto out;
+ }
++
++ const pg_pool_t *p = mon->osdmon()->osdmap.get_pg_pool(data);
++ if (!p) {
++ ss << "pool id '" << data << "' does not exist";
++ r = -ENOENT;
++ goto out;
++ } else if (p->is_erasure()) {
++ ss << "pool id '" << data << "' is an erasure-code pool";
++ r = -EINVAL;
++ goto out;
++ }
++
++ p = mon->osdmon()->osdmap.get_pg_pool(metadata);
++ if (!p) {
++ ss << "pool id '" << metadata << "' does not exist";
++ r = -ENOENT;
++ goto out;
++ } else if (p->is_erasure()) {
++ ss << "pool id '" << metadata << "' is an erasure-code pool";
++ r = -EINVAL;
++ goto out;
++ }
++
+ string sure;
+ cmd_getval(g_ceph_context, cmdmap, "sure", sure);
+ if (sure != "--yes-i-really-mean-it") {
+ ss << "this is DANGEROUS and will wipe out the mdsmap's fs, and may clobber data in the new pools you specify. add --yes-i-really-mean-it if you do.";
diff --git a/debian/patches/bug-8624b.patch b/debian/patches/bug-8624b.patch
new file mode 100644
index 0000000..7b0969c
--- /dev/null
+++ b/debian/patches/bug-8624b.patch
@@ -0,0 +1,41 @@
+From 2b007c25bc6d383cec0f9fd0e76f0742c2e9a671 Mon Sep 17 00:00:00 2001
+From: Joao Eduardo Luis <joao.luis at inktank.com>
+Date: Mon, 23 Jun 2014 23:27:05 +0100
+Subject: [PATCH] mon: MDSMonitor: print pool name along with id during 'newfs'
+ errors
+
+Signed-off-by: Joao Eduardo Luis <joao.luis at inktank.com>
+---
+ src/mon/MDSMonitor.cc | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+--- a/src/mon/MDSMonitor.cc
++++ b/src/mon/MDSMonitor.cc
+@@ -1130,9 +1130,12 @@
+ ss << "pool id '" << data << "' does not exist";
+ r = -ENOENT;
+ goto out;
+ } else if (p->is_erasure()) {
+- ss << "pool id '" << data << "' is an erasure-code pool";
++ const char *pn = mon->osdmon()->osdmap.get_pool_name(data);
++ assert(pn != NULL);
++ ss << "pool '" << pn << "' (id '" << data << "')"
++ << " is an erasure-code pool";
+ r = -EINVAL;
+ goto out;
+ }
+
+@@ -1141,9 +1144,12 @@
+ ss << "pool id '" << metadata << "' does not exist";
+ r = -ENOENT;
+ goto out;
+ } else if (p->is_erasure()) {
+- ss << "pool id '" << metadata << "' is an erasure-code pool";
++ const char *pn = mon->osdmon()->osdmap.get_pool_name(metadata);
++ assert(pn != NULL);
++ ss << "pool '" << pn << "' (id '" << metadata << "')"
++ << " is an erasure-code pool";
+ r = -EINVAL;
+ goto out;
+ }
+
diff --git a/debian/patches/series b/debian/patches/series
index 1678ce4..4cfd604 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,6 +1,8 @@
## Backported / Upstream
firefly-post-release.patch
bug-8342.patch
+bug-8624a.patch
+bug-8624b.patch
client-sleep1.patch
client-sleep2.patch
client-sleep3.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ceph/ceph.git
More information about the Pkg-ceph-commits
mailing list