Yehuda Sadeh [Mon, 21 Oct 2013 21:17:12 +0000 (14:17 -0700)]
rgw: turn swift COPY into PUT
Fixes: #6606
The swift COPY operation is unique in a sense that it's a write
operation that has its destination not set by the URI target, but by a
different HTTP header. This is problematic as there are some hidden
assumptions in the code that the specified bucket/object in the URI is
the operation target. E.g., certain initialization functions, quota,
etc. Instead of creating a specialized code everywhere for this case
just turn it into a regular copy operation, that is, a PUT with
a specified copy source.
Greg Farnum [Fri, 18 Oct 2013 23:34:11 +0000 (16:34 -0700)]
ReplicatedPG: copy: conditionally requeue copy ops when cancelled
We may need to requeue copy ops which are cancelled as part of an acting
set change but don't change the primary. To support this, add a
"requeue" flag to cancel_copy_ops() and copy_ops(), as well as to
CopyResults. The CopyCallback is then responsible for requeuing (the
higher layers can't do so as they can't know which request actually
triggered the copy).
Sage Weil [Thu, 17 Oct 2013 19:06:26 +0000 (12:06 -0700)]
Makefile: fix /sbin vs /usr/sbin behavior
Instead of telling configure to put things in /sbin, explicitly put the
two important items (mkcephfs and mount.fuse.ceph) in /sbin via an
automake rule. This unbreaks FreeBSD 9.1 and probably others.
Based on patches originally from Alan Somers <asomers@gmail.com>, modified
for the current Makefile structure and applied to the specfile too.
Fixes: #6456 Signed-off-by: Sage Weil <sage@inktank.com> Tested-by: Alan Somers <asomers@gmail.com>
Gregory Farnum [Wed, 16 Oct 2013 18:13:35 +0000 (11:13 -0700)]
Merge pull request #709 from ceph/wip-filerecover
This patch prevents us from inadvertently reducing sparse file sizes during recovery.
We also reduce some code duplication by using eval() directly in do_file_recover()
instead of reproducing the parts we care about.
Sage Weil [Fri, 27 Sep 2013 22:29:13 +0000 (15:29 -0700)]
common/buffer: add crc caching performance test
On my old box:
- matching cached values is a big win (free), obviously
- the adjustment is the same speed as redoing the calculation. this
is probably because the data is already in L1/L2 cache; we still
save memory bandwidth.
Sage Weil [Wed, 16 Oct 2013 00:55:32 +0000 (17:55 -0700)]
cls_rbd: do not make noise in osd log on rbd removal
ubuntu@burnupi06:~$ tail -f /var/log/ceph/ceph-osd.1.log
2013-02-07 17:00:30.565749 7fdb09e6b700 0 <cls> cls/rbd/cls_rbd.cc:1615: error reading id for name 'sds': -2
2013-02-07 17:00:30.566301 7fdb0a66c700 0 <cls> cls/rbd/cls_rbd.cc:1521: error reading name to id mapping: -2
2013-02-07 17:03:54.085700 7fdb0a66c700 0 <cls> cls/rbd/cls_rbd.cc:1615: error reading id for name 'sdfsd': -2
2013-02-07 17:03:54.086143 7fdb09e6b700 0 <cls> cls/rbd/cls_rbd.cc:1521: error reading name to id mapping: -2
Fixes: #4047 Signed-off-by: Sage Weil <sage@inktank.com>
Sage Weil [Tue, 15 Oct 2013 22:50:16 +0000 (15:50 -0700)]
ceph_test_rados: fix snap remove vs rollback fix
In commit 55d279b98553ba4542219b126fc7159b20b18b1f we tried to fix a race
between rollback and snap removal, but got the logic wrong: we need to
prevent *snap removal* on in-use snaps, not prevent multiple rollbacks on
the same snap.
Fixes: #6254 (again) Signed-off-by: Sage Weil <sage@inktank.com> Reviewed-by: Samuel Just <sam.just@inktank.com>
Alan Somers [Tue, 15 Oct 2013 20:26:13 +0000 (13:26 -0700)]
os/FileStore: fix fiemap double-free(s)
If GenericFileStoreBackend::do_fiemap returns anything other than 0, then
fiemap will not be allocated. However,
GenericFileStoreBackend::detect_features will free fiemap regardless,
triggering an assertion in tcmalloc. The attached patch will fix the bug
by only freeing fiemap when necessary.
In my case, do_fiemap returns -ENOSYS because fiemap is not implemented
on FreeBSD. However, this bug could also happen on Linux when do_fiemap
returns -ENOMEM.
Fixes: #6504 Signed-off-by: Alan Somers <asomers@gmail.com> Reviewed-by: Sage Weil <sage@inktank.com>
Alan Somers [Tue, 15 Oct 2013 20:06:06 +0000 (13:06 -0700)]
ceph-dencoder: select_generated() should properly validate its input
If m_list.size() == 0, then calling select_generated(0) will result in
uninitialized data being assigned to m_object, which will cause a segfault
down the road. This patch fixes that.
To Reproduce:
$ ceph-dencoder type MWatchNotify select_test 0 encode decode
Segmentation fault (core dumped)
After the patch:
$ ./ceph-dencoder type MWatchNotify select_test 0 encode decode
error: invalid id for generated object
$ echo $?
1
Fixes: #6510 Signed-off-by: Alan Somers <asomers@gmail.com>
Sage Weil [Tue, 15 Oct 2013 18:22:16 +0000 (11:22 -0700)]
mon/PGMonitor: set floor below which we do not warn about objects/pg
If a cluster has very few objects, do not generate warnings when the
objects/pg for a pool diverges from the cluster average. This avoids
spurious errors when you have a relatively empty cluster and a lone pool
with a modest number of objects is too far off the (mostly meaningless)
cluster-wide average.
Also include a per-pool min so we ignore mostly-empty pools.
Fixes: #6521 Signed-off-by: Sage Weil <sage@inktank.com>
Yehuda Sadeh [Tue, 15 Oct 2013 17:20:48 +0000 (10:20 -0700)]
rgw: fix authenticated users acl group check
Fixes: #6553
Backport: bobtail, cuttlefish, dumpling
Authenticated users group acl bit was not working correctly. Check to
test whether user is anonymous was wrong.
Alan Somers [Tue, 8 Oct 2013 22:24:00 +0000 (15:24 -0700)]
SignalHandler: fix infinite loop on BSD systems
SignalHandler::entry shouldn't poll for POLLOUT, because it never actually
writes to the pipes in question. Polling for POLLOUT causes poll(2) to
immediately return, so the function spins the CPU and never blocks. Remove
the POLLOUT flag, unnecessarily introduced in commit 8e4a78f169eda716c7d6811cb6db5c757dc67207 when switching from select() to poll().
This fixes the problem on FreeBSD and doesn't break anything (AFAICT) on
Linux. Tested on FreeBSD 9.1 amd64 and Ubuntu Server 13.04 amd64.
Fixes: #6492 Signed-off-by: Alan Somers <asomers@gmail.com> Reviewed-by: Greg Farnum <greg@inktank.com>