summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-08-24 14:12:44 -0700
committerSage Weil <sage@inktank.com>2013-08-24 14:12:44 -0700
commit8b1b74598bae0e13691e6244c647fb89cc9e21a7 (patch)
tree080263f1d499004efab73a43174499bc6c3de851
parent14a483745f104bf8bd75344e755adca3637198e1 (diff)
parent4b529c8bceea98aaf69dceec3a4d1a239036d5d7 (diff)
downloadceph-8b1b74598bae0e13691e6244c647fb89cc9e21a7.tar.gz
Merge remote-tracking branch 'gh/next'
-rwxr-xr-xsrc/ceph-disk1
-rw-r--r--src/mon/PGMonitor.cc1
-rw-r--r--src/mon/Paxos.cc11
-rw-r--r--src/os/BtrfsFileStoreBackend.cc5
-rw-r--r--src/os/FileStore.cc5
-rw-r--r--src/os/FlatIndex.cc5
-rw-r--r--src/os/LFNIndex.cc4
-rwxr-xr-xsrc/pybind/ceph_rest_api.py13
-rw-r--r--src/rgw/rgw_bucket.cc7
9 files changed, 41 insertions, 11 deletions
diff --git a/src/ceph-disk b/src/ceph-disk
index ddaa605ebb8..3d09bdf7418 100755
--- a/src/ceph-disk
+++ b/src/ceph-disk
@@ -671,6 +671,7 @@ def mount(
subprocess.check_call(
args=[
'mount',
+ '-t', fstype,
'-o', options,
'--',
dev,
diff --git a/src/mon/PGMonitor.cc b/src/mon/PGMonitor.cc
index ff2d1fe4947..2a677be61d9 100644
--- a/src/mon/PGMonitor.cc
+++ b/src/mon/PGMonitor.cc
@@ -1428,7 +1428,6 @@ bool PGMonitor::preprocess_command(MMonCommand *m)
cmd_getval(g_ceph_context, cmdmap, "threshold", threshold,
int64_t(g_conf->mon_pg_stuck_threshold));
- boost::scoped_ptr<Formatter> f(new_formatter("json"));
r = dump_stuck_pg_stats(ds, f.get(), (int)threshold, stuckop_vec);
ss << "ok";
r = 0;
diff --git a/src/mon/Paxos.cc b/src/mon/Paxos.cc
index 016686aae06..495268ff9ee 100644
--- a/src/mon/Paxos.cc
+++ b/src/mon/Paxos.cc
@@ -328,6 +328,15 @@ bool Paxos::store_state(MMonPaxos *m)
// apply.
decode_append_transaction(t, it->second);
}
+
+ // discard obsolete uncommitted value?
+ if (uncommitted_v && uncommitted_v <= last_committed) {
+ dout(10) << " forgetting obsolete uncommitted value " << uncommitted_v
+ << " pn " << uncommitted_pn << dendl;
+ uncommitted_v = 0;
+ uncommitted_pn = 0;
+ uncommitted_value.clear();
+ }
}
if (!t.empty()) {
dout(30) << __func__ << " transaction dump:\n";
@@ -425,7 +434,7 @@ void Paxos::handle_last(MMonPaxos *last)
// did this person send back an accepted but uncommitted value?
if (last->uncommitted_pn) {
- if (last->uncommitted_pn > uncommitted_pn &&
+ if (last->uncommitted_pn >= uncommitted_pn &&
last->last_committed >= last_committed &&
last->last_committed + 1 >= uncommitted_v) {
uncommitted_v = last->last_committed+1;
diff --git a/src/os/BtrfsFileStoreBackend.cc b/src/os/BtrfsFileStoreBackend.cc
index 9fa96babab7..ac7d1014ac7 100644
--- a/src/os/BtrfsFileStoreBackend.cc
+++ b/src/os/BtrfsFileStoreBackend.cc
@@ -320,8 +320,9 @@ int BtrfsFileStoreBackend::list_checkpoints(list<string>& ls)
list<string> snaps;
char path[PATH_MAX];
- struct dirent buf, *de;
- while (::readdir_r(dir, &buf, &de) == 0) {
+ char buf[offsetof(struct dirent, d_name) + PATH_MAX + 1];
+ struct dirent *de;
+ while (::readdir_r(dir, (struct dirent *)&buf, &de) == 0) {
if (!de)
break;
diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc
index 80561056daa..81407373685 100644
--- a/src/os/FileStore.cc
+++ b/src/os/FileStore.cc
@@ -3787,8 +3787,9 @@ int FileStore::list_collections(vector<coll_t>& ls)
return r;
}
- struct dirent sde, *de;
- while ((r = ::readdir_r(dir, &sde, &de)) == 0) {
+ char buf[offsetof(struct dirent, d_name) + PATH_MAX + 1];
+ struct dirent *de;
+ while ((r = ::readdir_r(dir, (struct dirent *)&buf, &de)) == 0) {
if (!de)
break;
if (de->d_type == DT_UNKNOWN) {
diff --git a/src/os/FlatIndex.cc b/src/os/FlatIndex.cc
index f4a5ce3ab7d..db46750e411 100644
--- a/src/os/FlatIndex.cc
+++ b/src/os/FlatIndex.cc
@@ -387,7 +387,8 @@ int FlatIndex::collection_list_partial(const hobject_t &start,
}
int FlatIndex::collection_list(vector<hobject_t> *ls) {
- char dir_name[PATH_MAX], buf[PATH_MAX], new_name[PATH_MAX];
+ char buf[offsetof(struct dirent, d_name) + PATH_MAX + 1];
+ char dir_name[PATH_MAX], new_name[PATH_MAX];
strncpy(dir_name, base_path.c_str(), sizeof(dir_name));
dir_name[sizeof(dir_name)-1]='\0';
@@ -399,7 +400,7 @@ int FlatIndex::collection_list(vector<hobject_t> *ls) {
vector< pair<ino_t,hobject_t> > inolist;
struct dirent *de;
- while (::readdir_r(dir, (struct dirent*)buf, &de) == 0) {
+ while (::readdir_r(dir, (struct dirent *)buf, &de) == 0) {
if (!de)
break;
// parse
diff --git a/src/os/LFNIndex.cc b/src/os/LFNIndex.cc
index 09d0f02267f..029e8ad8197 100644
--- a/src/os/LFNIndex.cc
+++ b/src/os/LFNIndex.cc
@@ -378,7 +378,7 @@ int LFNIndex::list_objects(const vector<string> &to_list, int max_objs,
long *handle, map<string, hobject_t> *out) {
string to_list_path = get_full_path_subdir(to_list);
DIR *dir = ::opendir(to_list_path.c_str());
- char buf[PATH_MAX];
+ char buf[offsetof(struct dirent, d_name) + PATH_MAX + 1];
int r;
if (!dir) {
return -errno;
@@ -438,7 +438,7 @@ int LFNIndex::list_subdirs(const vector<string> &to_list,
set<string> *out) {
string to_list_path = get_full_path_subdir(to_list);
DIR *dir = ::opendir(to_list_path.c_str());
- char buf[PATH_MAX];
+ char buf[offsetof(struct dirent, d_name) + PATH_MAX + 1];
if (!dir)
return -errno;
diff --git a/src/pybind/ceph_rest_api.py b/src/pybind/ceph_rest_api.py
index 421cc59edcc..c53c3d77737 100755
--- a/src/pybind/ceph_rest_api.py
+++ b/src/pybind/ceph_rest_api.py
@@ -5,6 +5,7 @@ import errno
import json
import logging
import logging.handlers
+import os
import rados
import textwrap
import xml.etree.ElementTree
@@ -26,6 +27,7 @@ DEFAULT_ID = 'restapi'
DEFAULT_BASEURL = '/api/v0.1'
DEFAULT_LOG_LEVEL = 'warning'
+DEFAULT_LOGDIR = '/var/log/ceph'
# default client name will be 'client.<DEFAULT_ID>'
# 'app' must be global for decorators, etc.
@@ -117,7 +119,18 @@ def api_setup(app, conf, cluster, clientname, clientid, args):
loglevel = app.ceph_cluster.conf_get('restapi_log_level') \
or DEFAULT_LOG_LEVEL
+ # ceph has a default log file for daemons only; clients (like this)
+ # default to "". Override that for this particular client.
logfile = app.ceph_cluster.conf_get('log_file')
+ if not logfile:
+ logfile = os.path.join(
+ DEFAULT_LOGDIR,
+ '{cluster}-{clientname}.{pid}.log'.format(
+ cluster=cluster,
+ clientname=clientname,
+ pid=os.getpid()
+ )
+ )
app.logger.addHandler(logging.handlers.WatchedFileHandler(logfile))
app.logger.setLevel(LOGLEVELS[loglevel.lower()])
for h in app.logger.handlers:
diff --git a/src/rgw/rgw_bucket.cc b/src/rgw/rgw_bucket.cc
index 1e523f332cf..5356417f09a 100644
--- a/src/rgw/rgw_bucket.cc
+++ b/src/rgw/rgw_bucket.cc
@@ -1451,7 +1451,12 @@ public:
if (ret < 0)
return ret;
- ret = rgw_unlink_bucket(store, be.owner, entry);
+ /*
+ * We're unlinking the bucket but we don't want to update the entrypoint here — we're removing
+ * it immediately and don't want to invalidate our cached objv_version or the bucket obj removal
+ * will incorrectly fail.
+ */
+ ret = rgw_unlink_bucket(store, be.owner, entry, false);
if (ret < 0) {
lderr(store->ctx()) << "could not unlink bucket=" << entry << " owner=" << be.owner << dendl;
}