Commit Graph

15236 Commits

Author SHA1 Message Date
Sage Weil
24faa3d198 CodingStyle 2011-07-11 09:57:22 -07:00
Sage Weil
6a793f2b4e mds: journal renamed dirino on rmdir
This makes replay work on the auth by updating the subtrees accordingly
(since rmdir is really just renaming into the stray dir).

Note that this doesn't completely fix things for the dirfrag auth; see
#1295.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-07-10 14:10:18 -07:00
Sage Weil
d2cdbe75e5 mds: defer lock eval if freezing or frozen
We were only deferring if frozen.  But if freezing we need to too, because
of the way cap messages are deferred.  We defer cap messages if

 - inode is frozen
 - inode is freezing and locks are stable (to avoid starvation)

So if we are in a stable freezing state and start deferring caps, we can't
twiddle locks further or else we can

 - potentially starve (okay, in rare cases)
 - get stuck because we already started deferring cap messages

We would also screw up the cap message ordering if we became unstable again
and were allowed to start processing cap messages while others were still
deferred.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-07-10 14:05:10 -07:00
Sage Weil
44ca5b3f55 Merge remote branch 'origin/stable' 2011-07-09 14:37:31 -07:00
Sage Weil
dc41c8d86f client: remove unused variable
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-07-08 16:30:07 -07:00
Yehuda Sadeh
4f73121962 rgw: fix put of zero sized objects 2011-07-08 15:34:23 -07:00
Sage Weil
9019c6ce64 v0.31 2011-07-08 14:17:40 -07:00
Sage Weil
bae40eaa96 filejournal: parse kernel version 3.0+
Signed-off-by: Sage Weil <sage@newdream.net>
2011-07-08 14:16:19 -07:00
Yehuda Sadeh
3f708ee554 rgw: fix copy operation (clean up acls) 2011-07-08 11:09:50 -07:00
Yehuda Sadeh
44e76fb825 rgw: when listing objects, set locator key only when needed 2011-07-08 11:09:33 -07:00
Greg Farnum
3eb1ba8652 qa: make dir tests run by default in rename all.sh
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
2011-07-08 11:09:32 -07:00
Sage Weil
73d98a057b Merge branch 'mds_wrlock' 2011-07-08 10:33:16 -07:00
Sage Weil
f200f0dd40 mds: fix warning
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-07-08 10:24:39 -07:00
Sage Weil
2dd514ab38 osd: use shared helper for WRITE, CLONERANGE stats updates
Signed-off-by: Sage Weil <sage@newdream.net>
2011-07-08 10:23:15 -07:00
Sage Weil
da89ef05cb osd: clean up a few things in do_osd_ops
don't set head_exists
remove dup touch on setxattr
set maybe_created for clonerange

Signed-off-by: Sage Weil <sage@newdream.net>
2011-07-08 10:23:09 -07:00
Sage Weil
054fbc4691 mds: refactor drop_*_locks() to use helpers
This slightly changes the unlock order for drop_locks() (rdlocks now
last instead of after xlocks, before [remote_]wrlocks).

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-07-08 09:48:00 -07:00
Sage Weil
d72bdab7d7 mds: take a remote_wrlock on srcdir for cross-mds rename
This ensures that we hold a wrlock on the srcdn auth when the slave
makes it's changes to the src directory, and prevents us from corrupting
the scatterlock state.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-07-08 09:48:00 -07:00
Sage Weil
025748a695 mds: implement remote_wrlock
For the rename code to behave, we need to hold a wrlock on the slave node
to ensure that any racing gather (mix->lock) is not sent prior to the
_rename_prepare() running; otherwise we violate the locking rules and
corrupt rstats.

Implement a remote_wrlock that will be used by rename.  The wrlock is held
on a remote node instead of the local node, and is set up similarly to
remote_xlocks.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-07-08 09:48:00 -07:00
Sage Weil
4d5b05380e client: clean up debug output
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-07-08 09:32:19 -07:00
Sage Weil
c3a40829d7 mds: add mix->lock(2) state
There is a problem with the wrlocks and cross-mds renames:

 - master (dest auth, srci auth, srcdir replica) takes wrlock on srcdiri
 - something triggers a srcdiri lock, putting inest/ifile lock in mix->lock
   state
 - slave (srcdir auth) sends LOCKACK
 - master sends prepare_rename
 - slave (srcdir auth) does rename prepare, which modifies srcdir

Even though the master holds a wrlock on the srcdiri, the gather starts
immediately and the slave sends the LOCKACK before the master's wrlock is
released.

To fix this, we add a new mix->lock(2) state, and we do not start the
mix->lock gather from replicas until the local gather completes, _after_
the auth's wrlock is released.  This makes the master's wrlock sufficient
to ensure the prepare_rename on the slave is save.

This also works when the slave is the srci auth, since the gather won't
complete until the master releases its wrlock.  BUT, it does NOT work if a
third MDS is the srcdiri auth, since it can still gather from the slave
prior to the master releasing its wrlock.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-07-08 09:32:19 -07:00
Sage Weil
d6f35b5d62 rados: fix usage()
Exit after dumping usage to stderr on error.

Print to stdout for -h.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-07-07 16:05:34 -07:00
Greg Farnum
84f75c58ae Merge branch 'next' 2011-07-07 15:28:37 -07:00
Greg Farnum
fbdb0a3a0f mds: check that dnl exists before dereferencing it.
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
2011-07-07 15:28:21 -07:00
Sage Weil
12a5bb82c6 mon: fix pool vs unmanaged snaps check
Signed-off-by: Sage Weil <sage@newdream.net>
2011-07-07 14:21:03 -07:00
Sage Weil
4f87d84376 mon: don't use pending_inc in poolop preprocess_*
Signed-off-by: Sage Weil <sage@newdream.net>
2011-07-07 14:21:03 -07:00
Sage Weil
af93d81193 mon: fix up pending_inc pool op mess
You can't look at pending_inc in preprocess methods.  Or return an error
based on pending_inc before it commits.  Fix up the snap-related error
checking.

Rename _pool_op() to _pool_op_reply().

Signed-off-by: Sage Weil <sage@newdream.net>
2011-07-07 14:21:03 -07:00
Sage Weil
5dc09dd6b8 mds: set old and new dentry lease bits
Recent kernels got the new CEPH_LOCK_DN definition but we were still
setting the old bit.  Set both so we work with both classes of clients. In
the meantime, update the kernel to ignore this field so that eventually we
can drop/reuse it.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-07-07 13:35:32 -07:00
Greg Farnum
acd256cc1b Merge branch 'next' 2011-07-07 13:12:32 -07:00
Sage Weil
616ff50264 mds: conclude ENOENT during travrse if we have a readable null dentry
Only if the lock is readable.  For example, replicas with dn lock state
of LOCK aren't readable.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-07-07 13:10:45 -07:00
Sage Weil
a91b1bfff4 Revert "mds: fail out of path_traverse if we have a null dentry."
This reverts commit 39d50c1362.
2011-07-07 13:10:45 -07:00
Yehuda Sadeh
4761317b75 rgw: fix copy operation (clean up acls) 2011-07-06 17:02:43 -07:00
Greg Farnum
03b6c40b17 qa: mds rename: account for not being in the ceph root dir
We need to know the Ceph absolute path. We can't actually
derive that for sure (if we aren't mounted into the root), but this
at least lets us deal with being in our own subdirectories.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
2011-07-06 15:02:42 -07:00
Greg Farnum
b5e4a31930 move mds rename tests to workunits directory
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
2011-07-06 14:20:35 -07:00
Greg Farnum
e483bb6b80 qa: mds rename: Rework so it will function in teuthology as a workunit:
work in current directory, not hardcoded mnt path
use CEPH_TOOL variable rather than hardcoded local executable
pass CEPH_ARGS to scripts so you don't need to export it into the environment.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
2011-07-06 14:20:35 -07:00
Sage Weil
088013b89f mds: cleanup: use enum for lock states
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-07-06 13:49:33 -07:00
Sage Weil
528b615112 Merge branch 'next' 2011-07-06 13:49:14 -07:00
Yehuda Sadeh
8f9eaf0de3 rgw: when listing objects, set locator key only when needed 2011-07-06 13:34:13 -07:00
Sage Weil
1d7fbed6fd rados: rename load-gen options
No abbreviations, update usage().

Signed-off-by: Sage Weil <sage@newdream.net>
2011-07-06 08:59:31 -07:00
Colin Patrick McCabe
1da8f8177a honor CINIT_FLAG_NO_DEFAULT_CONFIG_FILE
Don't use CEPH_CONF_FILE_DEFAULT when CINIT_FLAG_NO_DEFAULT_CONFIG_FILE
is set.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-07-05 14:56:59 -07:00
Tommi Virtanen
5b2de2b9d6 mkcephfs: Only create OSD journal dir if we have a journal.
Thanks to huang jun <hjwsm1989@gmail.com> for finding the bug.

Signed-off-by: Tommi Virtanen <tommi.virtanen@dreamhost.com>
2011-07-05 14:57:10 -07:00
Sage Weil
2aa146a7a2 mds: always clear_flushed() after finish_flush()
The scatter_writebehind_finish() is always followed up by an eval_gather(),
which does the clear_flushed().  For everyone else (replicas!), we need to
clear it immediately to avoid confusing things later.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-07-05 14:22:24 -07:00
Sage Weil
fb7696f3b3 client: fix num_flushing_caps accounting
This only affects debug output, fwiw.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-07-05 13:58:53 -07:00
Sage Weil
e9e3883d0d client: don't call flush_snaps when nothing to flush
Otherwise we fail an assert.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-07-05 13:43:27 -07:00
Sage Weil
933e34951b mds: kill stray break
This broke with the gatherbuilder addition.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-07-05 13:43:23 -07:00
Sage Weil
7e1f09ff4f context: implement complete()
finish() requires the caller to delete.  complete() does that for you by
calling finish() and then doing delete this.  Unless you overload it and
do something else.  This will allow us to make Contexts are are reusable,
for example, by overloading complete() instead of finish() and managing
the lifecycle in some other way.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2011-07-05 13:33:40 -07:00
Sage Weil
b11b5826ad Merge branch 'stable' 2011-07-05 10:07:11 -07:00
Tommi Virtanen
531f46c384 logrotate.conf: Mark stat/*.log as "missingok"; it's not always there.
Signed-off-by: Tommi Virtanen <tommi.virtanen@dreamhost.com>
2011-07-05 10:00:51 -07:00
Sage Weil
529df5dbd8 Merge branch 'stable' 2011-07-05 09:18:27 -07:00
Alexandre Oliva
b670f31dc9 Move stat/*.log to the end of logrotate.conf
Logrotate ignores entries after a rule that doesn't match any files.

Signed-off-by: Alexandre Oliva <oliva@lsd.ic.unicamp.br>
Signed-off-by: Sage Weil <sage@newdream.net>
2011-07-05 09:18:15 -07:00
Sage Weil
6feab3cbf4 mds: fix file_excl assert
If we are in XSYN state and want to move to anything else, we must go via
EXCL, but we may not be loner anymore.  Weaken the file_excl() assert so we
don't crash.

Reported-by: Fyodor Ustinov <ufm@ufm.su>
Signed-off-by: Sage Weil <sage@newdream.net>
2011-07-05 08:58:26 -07:00