This looks more like the real cause for #1986. Op ctor gets a vector of
ops but out_* aren't initialized to match.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
Clean this code up to explicitly whitelist what is ok so that the flow is
less annoying to follow/maintain, and so that we dump the transaction
contents on whitelisted errors.
Signed-off-by: Sage Weil <sage@newdream.net>
Reviewed-by: Josh Durgin <josh.durgin@dreamhost.com>
The osd shouldn't do this (even though we should tolerate it).
Signed-off-by: Sage Weil <sage@newdream.net>
Reviewed-by: Greg Farnum <gregory.farnum@dreamhost.com>
We can't assume that the size of out_ops (from the reply) matches the
op->out_* vectors from our request state. In particular, the out_ops might
be shorter than what we sent the OSD if the OSD was sloppy. Check them.
We can assume that op->ops and op->out_* all match; assert as much in
op_submit().
Fixes: #1986
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
Reviewed-by: Greg Farnum <gregory.farnum@dreamhost.com>
Just to be paranoid. Nothing we haven't set *should* affect the ABI,
but...
Always do this immediately after declaration so that we catch everything.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
This is redundant--we can just use num_bytes. If we're worried about the
per-object overhead or rounding, we can factor in some overhead based on
num_objects.
And, the kb accounting has a bug (#1988).
Avoid changing the encoding at all for now. Next time the encoding changes
we'll drop the old field.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
We need to keep an in-memory obc to track the state of the in-flight io
to disk. This is analogous to when an object is pushed + written, and we
can share the same completion function.
Signed-off-by: Sage Weil <sage@newdream.net>
I saw a case (#1973) where the clone had the oid set to the head. That is
clearly wrong. Not sure what damage this caused.
Signed-off-by: Sage Weil <sage@newdream.net>
Some post-install rpmbuild defaults byte-compile all packaged python
files, so don't bother removing the .pyc files, and package .py* to
get both .pyo and .pyc. It wastes a tiny little bit of space, but it
makes the spec file portable across a wider range of rpm and python
configurations.
Signed-off-by: Alexandre Oliva <oliva@lsd.ic.unicam.br>
Signed-off-by: Sage Weil <sage@newdream.net>
Since snapshots are currently stored at the end of the header, having
many snapshots made the header larger than the read size, resulting in
an infinite loop when the offset was not changed.
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
Reviewed-by: Samuel Just <samuel.just@dreamhost.com>
Accumulate all output, and write it at the end. This way we can avoid
writing it if any of the commands fail.
Fixes: #1954
Signed-off-by: Sage Weil <sage@newdream.net>
We should ignore logs, infos, and notifies while we are waiting for the
map to change. Peering has reached a dead-end (we need acting to change)
and we will redo our work when that happens. That includes the replicas
resending notifies.
Fixes: #1958
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
Reviewed-by: Samuel Just <samuel.just@dreamhost.com>
This is unnecessary and counterproductive, since the log is used to detect
dup ops. It's an artifact of an earlier backfill iteration that didn't
preserve the log on the backfill target.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
The problem with the original fix is that it wasn't atomic. Going back
to the original inefficient (though atomic) method. We should limit
the number of buckets per user anyway, and shouldn't get into a point
where this code is actually execised.
Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net>
having mount.ceph use KEY_SPEC_USER_KEYRING to pass keys to the kernel has
several disadvantages:
1) It leaves the key setting in the uid_keyring, which is reachable from the
session keyring via a link (see keyctl list <root session keyring ref>). This
means its accessible to other processes in the same session that don't need
access to it, even after the kernel is done with it.
2) The user keyring has some very counter-intuitive semantics as far as keyring
permissions goes. The user keyring is access via a link from the session
keyring, which a process may not have permission to access in some situations.
For instance if mount.ceph is executed via su without having started a new
session, mount.ceph will not have access to the uid keyring unless the calling
proces (in this case su) has granted access permission. The result is a -EPERM
error when executing mount.ceph to a cephx enabled server. If the same command
is attempted in a new root session (e.g. su - or su -l), the mount command will
work fine
Switching the mount.ceph command to use the KEY_SPEC_PROCESS_KEYRING solves both
of these problems. By using this keyring, accessibility is guaranteed because
its added and accessed in the same process context both in user space and the
kernel, assuring aceesability, despite the session specifics. It also ensures
that the key will get cleaned up after the mount.ceph process exits
automatically, since there is no longer a need for it (the kernel clones the key
during the mount process and releases it on unmount).
I've tested this here on my local ceph cluster, and it works properly under both
su and su -l .
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Josh Durgin <josh.durgin@dreamhost.com>
Intent log processing was completely broken. First, it wasn't
parsing the date correctly (due to failure to initalize strptime).
Second, it was trying to load the entire log to memory in one
piece (and in a racy way). This fixed bug #1948.
Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net>
Divvy up the result bl first, then gift the whole shebang to outbl. If
we gift it first, there's nothing to demux (since we move intead of copy
the bufferlist ptrs).
Signed-off-by: Sage Weil <sage@newdream.net>