Commit Graph

14801 Commits

Author SHA1 Message Date
Sage Weil
6069fa6a55 mon: weaken pool creation caps check
Allow a pool creation if we specify an auid but are allowed to create
buckets as anybody.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-06-08 14:55:00 -07:00
Yehuda Sadeh
80c039cd04 rgw_admin: user info dumps auid 2011-06-08 14:54:14 -07:00
Sage Weil
825cec3c70 moncaps: whitespace
Signed-off-by: Sage Weil <sage@newdream.net>
2011-06-08 14:53:22 -07:00
Yehuda Sadeh
402624717c rgw_admin: can reset auid 2011-06-08 14:13:37 -07:00
Sage Weil
8cd949f675 Merge remote branch 'origin/mds_rename' 2011-06-08 14:00:10 -07:00
Greg Farnum
4e58308d06 mds: rename: remove illicit assert.
We actually do want witnesses who aren't auth for anything
to do journaling in some cases, so kill the assert.
That also negates the need for the not_journaling check.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
2011-06-08 14:50:27 -07:00
Sage Weil
5b43419c72 mds: try_trim_non_auth_subtree if we rename a dir away from a non-auth subtree
It's possible we have non-auth metadata only because we have a subtree
nested beneath. If we rename a directory out of a non-auth subtree, we
should try to trim any non-auth content from that subtree that may now
be possible due to the child subtrees being linked elsewhere.

Fixes: #1146
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-06-08 13:29:21 -07:00
Sage Weil
072e80ed1c mds: use CDIR_AUTH_UNDEF where possible
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-06-08 13:27:41 -07:00
Sage Weil
811dcae71a mds: remove unlinked metadata from cache on replay
If we replay a metablob that unlinks something, throw it out immediately.
Recursively.  This comes up when:
 - we rename a file from one mds to another, and we replay the event on
   the source mds.  the inode gets thrown out.
 - we rename a directory from one mds to another, and when journaled, the
   source mds had no nested metadata.  same thing: we throw it out.  we
   may have something in our cache nested beneath that, though, that was
   since committed and such, but the fact that we didn't journal it being
   reattached elsewhere implies that it was clean and gone when our event
   was journaled, and we can throw it all out.  recursively.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-06-08 13:18:07 -07:00
Colin Patrick McCabe
f3688b712b Fix build errors in unit tests
libcommon uses symbols from the crypto libraries, so they must appear on
the link line whenever libcommon appears.  Later, we may want to revisit
this dependency; however, right now, having unit tests that build
consistently is pretty important.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-08 12:30:21 -07:00
Colin Patrick McCabe
2470130899 monitorstore: return error codes for consistency
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-08 12:05:15 -07:00
Sam Lang
cfbcfd7c9e Fix typo in usage output for --num-osds
This patch fixes the typo in the usage description to match the actual argument string.

Signed-off-by: Sam Lang <samlang@gmail.com>
Signed-off-by: Sage Weil <sage@newdream.net>
2011-06-08 11:27:33 -07:00
Sam Lang
5d56dfb7f8 Fix segfault caused by invalid argument string.
This patchset includes minor fixes to the crushtool utility.  If an invalid bucket type is speicifed on the command line, the code was iterating through bucket_types for the length of the static array, but the last entry in that array has null (0) values, which was causing a segfault.  This patch just checks that bucket_types[i].name is non-null instead.  Also, if the wrong bucket type or algorithm is specified, prints the usage string on exit.

Signed-off-by: Sam Lang <samlang@gmail.com>
Signed-off-by: Sage Weil <sage@newdream.net>
2011-06-08 11:25:13 -07:00
Sage Weil
a1a71471c2 qa: test witness subtree adjustment
This exercises the mds at least; we don't have a way to verify mds
behavior currently.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-06-08 11:22:26 -07:00
Sage Weil
e2c808aea9 qa: test_sync_io
Currently only tests the read path for O_DIRECT and sync (if the ioctl is
in place).  Also currently crashes the kclient with

 read_direct buf_align 0 offset 4190720 len 4096

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-06-07 22:09:24 -07:00
Sage Weil
21795aaf5d qa: add dir rename tests
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-06-07 20:49:45 -07:00
Sage Weil
00ec86a204 mds: open renamed import child frags during journal replay
Open up any child frags of the imported renamed inode that are noted in
the journal event.  (Note we blindly open up that list here; it's up to the
journaler to only populate it when appropriate.)  If the listed frags are
not already open, open them up and set the dir_auth to unknown; presumably
they belong to the rename source/exporter.  If we already had them open,
then the adjust_subtree_after_rename call above will have caught them and
already done the necessary subtree adjustment.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-06-07 20:48:52 -07:00
Sage Weil
44d19304a9 mds: journal open srci frags on srci import (master)
If we are importing the renamed inode, and it is a directory, journal a
list of all open dirfrags (currently, this is actually all frags) so that
we can open them up during journal replay.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-06-07 20:46:42 -07:00
Sage Weil
a7c083ecbf mds: journal renames on witnesses if we have nested subtrees
If a rename witness has any subtrees that are nested beneath the renamed
directory, we need to journal the rename event so that our cache is
properly updated on journal replay.

Further, if we are exporting srci, we also need to journal the dest
(even if we aren't auth for destdn) if we have any open dirfrags because
those will turn into nested subtrees shortly.

We still need to ensure that the cache is properly trimmed during replay.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-06-07 20:43:29 -07:00
Sage Weil
5c870c60ec mds: CDir::contains() should use projected hierarchy
The only current callers are in resolve stage, when nothing is projected.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-06-07 20:40:39 -07:00
Colin Patrick McCabe
1b0fdcae59 re-fix ignore return value change
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-07 16:14:26 -07:00
Sage Weil
3a2ce92b2c mds: fix check for no-op rename of two links to the same inode
touch a
ln a b
mv a b

is a no-op, according to posix.  Move the check earlier.


Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-06-07 15:13:04 -07:00
Colin Patrick McCabe
a7012f289e cfuse: really ignore write() return value
Hopefully this will make gcc stop complaining. The void cast no longer
seems to silence unchecked return code errors, on gitbuilder at least.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-07 14:27:20 -07:00
Josh Durgin
dfa4aeb8ae Merge remote branch 'origin/wip_gcov' 2011-06-07 13:57:28 -07:00
Sage Weil
2969161b9e qa: add rename dir checks
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-06-07 13:34:57 -07:00
Josh Durgin
b32f00ebe3 coverage: add ceph-coverage to run something with the right GCOV_PREFIX_STRIP
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
2011-06-07 13:29:21 -07:00
Josh Durgin
0eda719502 Makefile.am: add check-coverage to get coverage of 'make check'
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
2011-06-07 13:29:21 -07:00
Josh Durgin
1f2740a020 Makefile.am: install gcno files
This is needed so that coverage data can be generated from the
gitbuilder tarballs.

Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
2011-06-07 13:29:21 -07:00
Josh Durgin
e4f0541592 Makefile.am: clean gcno and gcda files in "make clean"
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
2011-06-07 13:28:44 -07:00
Sage Weil
2cb0c110b5 qa: rename tests
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-06-07 13:27:31 -07:00
Sage Weil
3e0352d37c mds: rename: add missing pop_and_dirty_projected_inode calls
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-06-07 13:24:38 -07:00
Sage Weil
569baab64b mds: rename: use temp *in in _rename_apply
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-06-07 13:24:35 -07:00
Sage Weil
bdfcc0df34 mds: rename: move unlink out of every possible branch
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-06-07 13:24:11 -07:00
Colin Patrick McCabe
12bb308135 test/bufferlist: add copy_all test
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-07 12:05:50 -07:00
Josh Durgin
eb09764903 coverage: add helper script to get coverage for a local test
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
2011-06-07 12:04:29 -07:00
Josh Durgin
69092735c4 mon: add all_exit and exit commands
all_exit makes each daemon exit(0), for gcov data collection.
exit causes cmon to do this.

Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
2011-06-07 12:04:29 -07:00
Josh Durgin
c01961ff4b mds: allow mds to 'exit immediately'
This is temporary until shutting down cleans up well.

Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
2011-06-07 12:04:29 -07:00
Josh Durgin
347dba4e04 mon: ceph tell mds * is a valid command
Previously this fell through and returned -EINVAL to the user.

Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
2011-06-07 12:04:29 -07:00
Josh Durgin
1cc78b6a86 osd: add command to exit cleanly
This is required for gcov to work on daemons since the coverage data
is written atexit, and the function that writes the data is not
exported.

Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
2011-06-07 12:04:29 -07:00
Josh Durgin
24195b9c87 configure: add option for building with gcov coverage support
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
2011-06-07 12:02:40 -07:00
Colin Patrick McCabe
7b9fa3c3d1 test/bufferlist.cc: retab for consistency
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-07 11:58:06 -07:00
Colin Patrick McCabe
d9d3c78eb0 cfuse.cc: fix warning
We genuinely don't care about the return code we get back from this call
to write(2). So cast the result to void to tell gcc that we don't care.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-07 11:56:05 -07:00
Colin Patrick McCabe
ea9c4fc296 bufferlist::iterator: add copy_all, use in KeyRing
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-07 11:40:48 -07:00
Sage Weil
6b2bf234b8 mds: rename: fix oldin pop
- make the pop match position with the project in prepare
- don't pop on linkmerge, since we don't project in that case

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-06-07 11:25:39 -07:00
Sage Weil
bf7d7fa938 mds: rename: some cleanup
- add oldin temp
- make if conditions match between _prepare and _apply

no functional changes.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-06-07 11:24:50 -07:00
Sage Weil
b794aeb394 client: fix rename request target selection
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-06-07 11:23:54 -07:00
Sage Weil
084a1c747d client: fix mds selection for unlink
It was broken when a remote link target was on another mds.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-06-07 11:11:07 -07:00
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