Commit Graph

14638 Commits

Author SHA1 Message Date
Sage Weil
a2288574aa client: make debug prints for choose_target_mds more helpful
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-06-07 11:08:02 -07:00
Sage Weil
5e679d3ae6 client: allow caps to be dropped on another inode for requests
We need the ability to drop caps on another inode that isn't req->inode
or req->old_inode in the request struct.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-06-07 11:07:44 -07:00
Sage Weil
0fb7973745 mds: fix unlink new snaprealm check
The bool was flipped.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-06-07 10:59:09 -07:00
Sage Weil
dbe41a30f2 client: fix rename debug print
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-06-07 10:50:50 -07:00
Sage Weil
e36a4b261b mds: rename: fix handling of target that is remote dentry
If the target is a remote dentry, we need to consider that the destdn
and desti may have different auths.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-06-07 10:04:09 -07:00
Sage Weil
a5662293a2 client: fix mds routing for link requests
We want to send link requests to the auth for the new name, not the
target inode.  We also want to drop FILE_SHARED caps on new name's
directory.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-06-07 09:58:29 -07:00
Sage Weil
7770e1c626 mds: rename: only add target to stray if destdn is a primary
Only add target into the stray dir if we are renaming over a primary
dentry.  (Otherwise we aren't moving the target.)

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-06-07 09:49:04 -07:00
Sage Weil
df7f8954c3 mds: fix/clean up xlock import/export
- create xlock import/export helpers
- fix/simplify checks: we want to export/import only xlocks on the inode
that is being migrated, unless they are locallock.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-06-07 09:41:56 -07:00
Sage Weil
b5011e2116 mds: adjust subtree roots on rename
If we replay a dir rename operation, we need to adjust the subtree map
accordingly.

This covers the case where the metablob contains both the src and dest
dentries.  Remaining cases will follow.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-06-06 13:30:25 -07:00
Sage Weil
10750f803f common: add module_type to CephContext; use to initialize rotating keys
This fixes rotating keys.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-06-06 13:06:41 -07:00
Sage Weil
73257a0d4b Merge remote branch 'origin/wip_librbd_locking' 2011-06-06 10:58:32 -07:00
Sage Weil
e2e60147ec monclient: use default mon port if not specified in conf
Signed-off-by: Sage Weil <sage@newdream.net>
2011-06-06 09:25:12 -07:00
Sage Weil
ea56a558ce monmaptool: use default mon port if not specified
Signed-off-by: Sage Weil <sage@newdream.net>
2011-06-06 09:25:00 -07:00
Colin Patrick McCabe
69f9087432 dumpjnl: call msgr->register_entity before start
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-03 18:45:22 -07:00
Colin Patrick McCabe
4abdf6fda4 simple_spin: use file-scope global not function
function-scoped globals are protected by a mutex, and taking a mutex
inside a spin lock implementation kind of defeats the point...

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-03 18:15:11 -07:00
Sage Weil
ec18be530a simple_spin: fix linker error
For some stupid reason the linker is pulling this in twice, resulting in

/bin/sh ../libtool --tag=CXX   --mode=link g++  -Wall -D__CEPH__ -D_FILE_OFFSET_BITS=64 -D_REENTRANT -D_THREAD_SAFE -rdynamic -Wtype-limits -Wignored-qualifiers -Winit-self -Wpointer-arith -fno-strict-aliasing -Wnon-virtual-dtor -Wno-invalid-offsetof -Wstrict-null-sentinel  -g -Wextra -Wno-missing-field-initializers -Wno-missing-declarations -Wno-unused-parameter -Wl,--as-needed -latomic_ops  -o radosgw_admin radosgw_admin-rgw_fs.o radosgw_admin-rgw_rados.o radosgw_admin-rgw_user.o radosgw_admin-rgw_access.o radosgw_admin-rgw_op.o radosgw_admin-rgw_rest.o radosgw_admin-rgw_rest_os.o radosgw_admin-rgw_rest_s3.o radosgw_admin-rgw_common.o radosgw_admin-rgw_cache.o radosgw_admin-rgw_os.o radosgw_admin-rgw_os_auth.o radosgw_admin-rgw_formats.o radosgw_admin-rgw_log.o rgw_escape.o radosgw_admin-rgw_admin.o librgw.a librados.a -lfcgi -lcurl -lexpat -lpthread -lm -lcrypto++
libcommon.a(libcommon_a-simple_spin.o):(.data+0x8): multiple definition of `foo'
test_trans.o:/home/sage/ceph/src/./common/debug.h:51: first defined here

...which points to some larger linking issue.  However, this fixes it for
now.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-06-03 16:36:13 -07:00
Greg Farnum
53adde037c fix the MonClient problems for --with-debug programs.
Still doesn't compile, though.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
2011-06-03 17:13:47 -07:00
Colin Patrick McCabe
740eea1ee8 Refactor MonClient, KeyRing
MonClient should contain a KeyRing and a RotatingKeyRing. All the
MonClient users, except possibly csyn, don't want to manage those
objects themselves.

Don't chdir until after we have opened the KeyRing. If the KeyRing is at
a relative path, a chdir may make it inaccessible. Separate the chdir
function from the daemonize function.

Refactor the cmds argument parsing a little bit. Separate the special
actions from the normal operations of the daemon.

This should allow librados and libceph to support CephX finally! yay!

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-03 14:57:43 -07:00
Colin Patrick McCabe
ed41f29ac9 remove g_keyring
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-03 14:47:31 -07:00
Colin Patrick McCabe
90b53543ea dout:remove stream from dout_emerg_streams earlier
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-03 14:47:31 -07:00
Colin Patrick McCabe
98226c2226 DoutStreambuf: de-globalize dout lock
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-03 14:47:29 -07:00
Colin Patrick McCabe
5b7049c8a4 DoutStreambuf: de-globalize emergency logging
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-03 14:47:00 -07:00
Colin Patrick McCabe
6ed9a58331 Add simple_spin
Add simple spinlock implementation that is safe to use from anywhere.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-03 14:47:00 -07:00
Greg Farnum
70d77095b8 Revert "cfuse.cc: use safe_write"
This reverts commit e8ac5aa2a4.

This commit is just erroneous. It adds checks on a pipe write
for the result and an abort if the write failed. But that's broken
in the desired case where we succeed, block on ceph_fuse_ll_main(),
and the parent process is long-gone by the time we get to this code!

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
2011-06-03 14:29:35 -07:00
Greg Farnum
b4eb5efaf8 rados_bencher: re-add written objects constraint to read benchmark.
Somehow, in the last major change, the constraints that kept the
bencher from trying to read non-existent objects got removed. Put
a check back in the main bench loop to fix that.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
2011-06-03 11:53:10 -07:00
Greg Farnum
d1d3e26c7d mds: remove now-erroneous comment
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
2011-06-03 10:49:44 -07:00
Greg Farnum
4ef743088c Merge branch 'next'
Conflicts:
	src/mds/Server.cc

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
2011-06-03 10:12:10 -07:00
Greg Farnum
19949f6d60 mds: Clean up _rename_prepare journaling
This has been broken for a while in terms of journaling
things the MDS isn't auth for. This patch should fix that, and
adds a few asserts to that effect.

Also adds a new not_journaling flag to _rename_prepare
for those cases which call the function and then discard
the bufferlist results.
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
2011-06-03 09:53:20 -07:00
Greg Farnum
4689073c99 mds: _rename_prepaer should only journal dest if auth for it
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
2011-06-03 09:48:58 -07:00
Greg Farnum
cd5049dc8b uclient: reset flushing_caps on (mds) cap import.
Previously, we could get stuck thinking that we'd flushed caps
(that went to the original MDS, waited on freeze for export,
and then were dropped) without ever telling the auth MDS that we
wanted to do so. This caused hung shutdowns:
1) during shutdown we drop all our caps
2) we get stuck and notice that we have a flushing cap
3) we send cap flush
4) MDS ignores it (I think because actual data already got updated?
and now we don't have the proper caps either)

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
2011-06-02 18:35:45 -07:00
Greg Farnum
c28b749bce uclient: don't use racy check for uncommitted data.
Previously we used a check for if there were CEPH_CAP_FILE_BUFFER refs,
but that was racy if we had other threads (they could hold caps for
sync writes or something). Instead, see if we have any in-flight
writes or uncommitted objects.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
2011-06-02 18:35:45 -07:00
Greg Farnum
2c6b560093 uclient: call the right function pointer on truncate
fixes 67533e1443 to do what it meant to.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
2011-06-02 18:35:44 -07:00
Greg Farnum
39d50c1362 mds: fail out of path_traverse if we have a null dentry.
Previously if we had a null dentry which we were not auth for,
we would go into a loop of discover lookups on that dentry.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
2011-06-02 18:35:44 -07:00
Colin Patrick McCabe
637dfc3ed3 rados_sync: add test for temp file deletion, fix
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-02 16:59:51 -07:00
Colin Patrick McCabe
0f3224e172 rados_sync: in export, download, then rename
Download files to a 'temporary' name and then rename them when they are
complete. If the download gets aborted halfway through, this prevents
rados sync from getting confused next time when it sees the downloaded
file. This is similar to how rsync operates.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-02 16:48:08 -07:00
Laszlo Boszormenyi
6fd694c394 Remove unneeded libcrush1 files 2011-06-02 15:14:54 -07:00
Sage Weil
d6bbf3e5fb mds: journal parents of srci when srcdn is remote
If srcdn is a remote dentry, we will be journaling the src inode to update
the mtime, but we need to ensure the parent dirs are in the metablob.

Fixes: #1132
Signed-off-by: Sage Weil <sage@newdream.net>
2011-06-02 15:13:42 -07:00
Sage Weil
806646b05e journaler: also initialize safe_pos
on reread_head.  Keep consistent across the two methods.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-06-02 14:51:20 -07:00
Sage Weil
a13b664365 journaler: fix trim crash after standby-replay -> active
The reread_head method needs to initialize trimming_pos (like read_head
does) or else we get confused later.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-06-02 14:50:45 -07:00
Sage Weil
7ca240bf6d mds: cleanup rename_prepare a bit
Use *srci tmp.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-06-02 14:14:15 -07:00
Sage Weil
0bcd9ac73c vstart.sh: turn down debug ms
Signed-off-by: Sage Weil <sage@newdream.net>
2011-06-02 13:57:55 -07:00
Sage Weil
4cf342a13a mds: pin inode while one renamed_files list
Make sure the inode is pinned while it is on the LogSegment::renamed_files
list.  Avoids a crash when an inode on that list is wrongly trimmed.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-06-02 13:16:31 -07:00
Sage Weil
7e2e4779e4 mon: make sure osd paxos is writeable before doing timeouts
The osd paxos machine has to be writeable before we can update it.

Fixes: #1130
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-06-01 21:20:58 -07:00
Matthew Wodrich
780322db76 boto_tool: add get_bucket_acl
Signed-off-by: "Colin McCabe" <colin.mcccabe@dreamhost.com>
2011-06-01 16:34:37 -07:00
Sage Weil
e11958b2fc Merge branch 'stable' into next 2011-06-01 16:28:17 -07:00
Sage Weil
59501e1d3f Merge branch 'stable' 2011-06-01 16:23:17 -07:00
Colin Patrick McCabe
e340bfe13d dout: use recursive mutex for dout
Using a recursive mutex for dout is desirable because it allows us to
survive situations like this:

> foo() { dout << "foo" << dendl; }
> dout(0) << foo() << dendl;

These cases should be fixed because they produce garbled output.
However, with this change, at least they will not cause deadlock.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-01 11:42:49 -07:00
Colin Patrick McCabe
44770df843 lockdep: fix shadowed global, add printout
Fix a bug that was keeping lockdep from starting. Add a printout that
lets the user know that lockdep is enabled.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-01 11:18:01 -07:00
Tommi Virtanen
9b37f4fa5f Allow embedded '\0' in bufferlists when copying to std::string.
Signed-off-by: Tommi Virtanen <tommi.virtanen@dreamhost.com>
2011-06-01 09:44:55 -07:00
Colin Patrick McCabe
7c6c6a9ecc rados_sync: don't hash paths with periods
A period is not such a bad character.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-05-31 17:03:23 -07:00