Commit Graph

13664 Commits

Author SHA1 Message Date
Colin Patrick McCabe
0258166489 rgw: fix buffer overflow
Remove unecessary code that was causing a buffer overflow.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-03-31 13:22:31 -07:00
Sage Weil
96067588b4 rgw: recover from partial bucket creates
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-03-31 11:39:35 -07:00
Sage Weil
f895e20f5e rgw: use tmap key (excl) create when creating a bucket
This way we fail with EEXIST if the bucket already exists in the user
object.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-03-31 11:33:48 -07:00
Colin Patrick McCabe
7a2b65317a config: remove kill_after
It's unused.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-03-31 09:47:31 -07:00
Josh Durgin
d5f10bcb05 testlibrbd: fix warnings
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
2011-03-30 17:55:04 -07:00
Josh Durgin
3fe957a597 Merge branch 'next' 2011-03-30 17:35:08 -07:00
Josh Durgin
5141e90bdf testlibrbd: clean up and add tests for snapshots
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
2011-03-30 17:26:59 -07:00
Josh Durgin
e424171cbc librbd: fix snapshot handling
To ensure consistency, always set the snap context when the header is
updated. If snapid is set, we update librados' snapid when refreshing
the header as well. Also use CEPH_NOSNAP instead of 0 as the default
snapid to prevent confusion. These changes fix snapshot creation
and removal, and prevent writing to a snapshot.

Rollback is fixed by using selfmanaged_snapshot_rollback.

Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
2011-03-30 17:26:59 -07:00
Josh Durgin
7b28d5af67 librados, librbd: add some debugging messages
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
2011-03-30 17:26:59 -07:00
Josh Durgin
ab6c036543 librados: add selfmanaged_snap_rollback
This was removed in 2cb86f713d, but is
required for selfmanaged snaps because their snapids aren't in the
pool's snap list, which is how regular rollback finds them.

Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
2011-03-30 17:26:59 -07:00
Josh Durgin
3946779b06 librados: return -EROFS when trying to write to a snapshot
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
2011-03-30 17:26:59 -07:00
Sage Weil
2b7cc15399 Merge branch 'next'
Conflicts:
	src/cmon.cc
	src/osdc/Journaler.cc
2011-03-30 16:55:38 -07:00
Samuel Just
69f174c082 mkcephfs: minor fix
line 400: && $type == "osd" is not always valid.

Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
2011-03-30 16:49:37 -07:00
Samuel Just
cf3bb44d47 mkcephfs: copy to daemon nodes for each daemon
The tmp directory is removed after each daemon.  Previously, this would
break if two daemons were on the same node.  Now, the files will be
copied for each daemon.

Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
2011-03-30 16:49:21 -07:00
Sage Weil
5a1ccdcea8 journaler: don't block when we adjust back write_pos
is_readable() may need to adjust the write_pos backward, but will return
false.  If we are at the end we still need to wake up any waiters so they
know about it.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-03-30 16:46:04 -07:00
Colin Patrick McCabe
887a01f62c config: parse_argv fix
md_config_t::parse_argv: fold md_config_t::parse_argv_part2 into
parse_argv. Fix brokenness introduced by the std::string switchover.

OPTION macro: move single-character options out of the OPTION macro and
into config.cc

Fix ceph_argparse_witharg / ceph_argparse_flag uses to include a
trailing (char*)NULL, to ensure that we terminate with a pointer rather
than a 32-bit int.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-03-30 16:36:20 -07:00
Sage Weil
c6f1cced64 rados: print error message on exit
Signed-off-by: Sage Weil <sage@newdream.net>
2011-03-30 16:32:26 -07:00
Sage Weil
ab8871aef0 rados: add 'tmap {set,create} obj key value'
Signed-off-by: Sage Weil <sage@newdream.net>
2011-03-30 16:32:15 -07:00
Sage Weil
58fc0cf475 osd: add tmap key (exclusive) create
Return EEXIST if a key already exists.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-03-30 16:31:59 -07:00
Colin Patrick McCabe
5837a255ad config: fix use of uint64_t* as uint32_t*
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-03-30 15:44:46 -07:00
Colin Patrick McCabe
59923a8e51 config: tighten up uint32_t use
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-03-30 15:39:17 -07:00
Samuel Just
6f27492e92 mkcephfs: copy to daemon nodes for each daemon
The tmp directory is removed after each daemon.  Previously, this would
break if two daemons were on the same node.  Now, the files will be
copied for each daemon.

Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
2011-03-30 15:41:25 -07:00
Sage Weil
c3746dad52 common_init: fix keyring loading
Can't pass a NULL char* to std::string constructor.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-03-30 15:04:14 -07:00
Colin Patrick McCabe
a68ef601c9 common: Add strict_strtof, strict_strtod, unittest
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-03-30 14:57:45 -07:00
Greg Farnum
493e2d952a OSD: ReplicatedPG: commits should be high priority, like acks.
This was consistently breaking stuff for some people, as the acks were
high priority but the commits weren't. They should match.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
2011-03-30 13:30:43 -07:00
Colin Patrick McCabe
9cde1f44a5 config: use std::string in md_config_t
Use std::string to represent md_config_t strings. This makes memory
management a lot easier and should fix some leaks. "No value" is now
represented by an empty string, whereas before some places were using
empty strings and some were using NULL.

config.cc: Fix a minor decode bug.

In pid_file.cc, copy the pid_file using snprintf, since strncpy
does not always NULL-terminate.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-03-30 12:07:58 -07:00
sam
3c94cc20b6 test/bufferlist.cc: Added append tests
Tests appending many randomly sized chunks many of which are size zero.

Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
2011-03-30 10:08:54 -07:00
Colin Patrick McCabe
172835ff59 ConfUtils: move parsing into config.cc
Move parsing into config.cc, since there was already parsing code there.
Move metavariable escaping out of ConfUtils; having this in ConfUtils
makes it impossible to de-globalize g_conf.

Create a nicer API for pulling stuff out of the configuration file.
Since the value we pull is determined by the config structure in effect
at the time, it should be an instance method of md_config_t.

Remove some deadcode. Add some comments.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-03-30 01:20:38 -07:00
Colin Patrick McCabe
1fb543cb91 ConfUtils: fix up read API a bit
Remove def_val. Return error codes for not found, parse error, etc.
Fix API users.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-03-29 17:04:23 -07:00
Colin Patrick McCabe
a854feb09e ConfUtils: decode to std::string
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-03-29 17:04:22 -07:00
Tommi Virtanen
44100001f2 mount.ceph: Use LDADD not LDFLAGS to bring in -lkeyutils.
Without this, flab (gcc 4.2.4) failed with:

libtool: link: gcc -Wall -D__CEPH__ -D_FILE_OFFSET_BITS=64 -D_REENTRANT -D_THREAD_SAFE -rdynamic -g -O2 -o mount.ceph mount.ceph.o armor.o  -lkeyutils /usr/lib/libcrypto++.so
/usr/lib/libcrypto++.so: undefined reference to `pthread_key_create'
/usr/lib/libcrypto++.so: undefined reference to `pthread_getspecific'
/usr/lib/libcrypto++.so: undefined reference to `pthread_key_delete'
/usr/lib/libcrypto++.so: undefined reference to `pthread_setspecific'
collect2: ld returned 1 exit status

Signed-off-by: Tommi Virtanen <tommi.virtanen@dreamhost.com>
2011-03-29 16:31:29 -07:00
Sage Weil
a2ec936a7c cosd: fix bind to specific address
Do not default to public_addr for cluster, heartbeat messengers.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-03-29 16:23:55 -07:00
Samuel Just
3a1a31854d mkcephfs: minor fix
line 400: && $type == "osd" is not always valid.

Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
2011-03-29 16:16:11 -07:00
Tommi Virtanen
92e0751ffb Add an RPM BuildRequires on keyutils-libs-devel.
See 9aab8c6b05.

Signed-off-by: Tommi Virtanen <tommi.virtanen@dreamhost.com>
2011-03-29 15:37:10 -07:00
Colin Patrick McCabe
4af786c2a8 config: temporary fix for monclient conf issue
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-03-29 14:53:34 -07:00
Sage Weil
138f360d00 cmon: fix typo
Signed-off-by: Sage Weil <sage@newdream.net>
2011-03-29 14:49:09 -07:00
Sage Weil
1601df6554 Merge branch 'stable' into next
Conflicts:
	configure.ac
	debian/changelog
	src/msg/SimpleMessenger.cc
2011-03-29 14:47:57 -07:00
Colin Patrick McCabe
0f9e318be0 mount.ceph: fix missing includes
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-03-29 14:11:43 -07:00
Tommi Virtanen
9aab8c6b05 Add a Debian Build-Dep on libkeyutils-dev.
This is needed by bee85518e2.

Signed-off-by: Tommi Virtanen <tommi.virtanen@dreamhost.com>
2011-03-29 13:34:58 -07:00
Tommi Virtanen
bee85518e2 mount.ceph: Use kernel key management API when possible.
Backwards compatible with older kenrnels, for now.

Fixes: #852
Signed-off-by: Tommi Virtanen <tommi.virtanen@dreamhost.com>
2011-03-29 12:55:17 -07:00
Tommi Virtanen
73671c84cc common: Make armor.h safe to use from C.
mount.ceph needs to base64-decode the secrets, so we can get rid of
the kernel-side base64 decode, but it doesn't need all of common lib.
And it is written in C.

Signed-off-by: Tommi Virtanen <tommi.virtanen@dreamhost.com>
2011-03-29 12:55:17 -07:00
Tommi Virtanen
69f246711f mount.ceph: Modprobe ceph before trying the mount.
This will be needed for the next few commits, where we try to load the
keys into the kernel; without ceph.ko loaded, the key type will not be
recognized.

Signed-off-by: Tommi Virtanen <tommi.virtanen@dreamhost.com>
2011-03-29 12:55:16 -07:00
Tommi Virtanen
9233889a7b mount.ceph: Silently pass through options "name" and "secret".
Fixes: #914
Signed-off-by: Tommi Virtanen <tommi.virtanen@dreamhost.com>
2011-03-29 12:55:16 -07:00
Tommi Virtanen
db3703ac5c mount.ceph: Fix strncmp length comparing "secretfile".
Signed-off-by: Tommi Virtanen <tommi.virtanen@dreamhost.com>
2011-03-29 12:55:16 -07:00
Sage Weil
ab03eda62a rgw: add bucket to user list prior to creating bucket
This avoids hitting the osd immediately following a bucket creation, which
will avoid any map update latency for most requests.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-03-29 12:39:46 -07:00
Sage Weil
50ad51a59e rgw: create bucket object and xattr in single operation
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-03-29 12:11:11 -07:00
Sage Weil
9d0697a36e librados: add create to ObjectOperation
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-03-29 12:11:11 -07:00
Sage Weil
e8ceadb8b3 objecter: add create to ObjectOperation, known strings
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-03-29 12:11:11 -07:00
Colin Patrick McCabe
12a82a5a11 SyntheticClient: const cleanup
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-03-29 12:08:14 -07:00
Colin Patrick McCabe
59e2ef1e2b FileStore: convert dev, jdev to std::string
Convert dev, jdev to std::string in preparation for adding std::string
to g_conf.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-03-29 12:05:04 -07:00