src/client/Client.cc: In member function ‘void Client::trim_caps(MetaSession*, int)’:
src/client/Client.cc:4121:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (s->caps.size() > max)
~~~~~~~~~~~~~~~^~~~~
Jeff Layton [Thu, 14 Sep 2017 13:28:34 +0000 (09:28 -0400)]
lockdep: fix races with concurrent lockdep teardown
If the cct is unregistered while other threads are flogging mutexes,
then we can hit all sorts of bugs. Ensure that we handle that
situation sanely, by checking that g_lockdep is still set after
we take the lockdep_mutex.
Also, remove an assertion from lockdep_unregister, and just turn it into
an immediate return. It's possible to have a call to
lockdep_unregister_ceph_context, and then a call to
lockdep_register_ceph_context while a mutex is being held by another
task.
In that case, it's possible the lock does not exist in the map
when we go to unregister it. That's not a bug though, just a natural
consequence of that series of actions.
Tracker: http://tracker.ceph.com/issues/20988 Signed-off-by: Jeff Layton <jlayton@redhat.com>
(cherry picked from commit 75f41a95782a7ee83a243d91963e8d591402f8a6)
John Spray [Thu, 21 Dec 2017 13:27:45 +0000 (08:27 -0500)]
qa: configure zabbix properly before selftest
Even though the selftest routine doesn't care about
the settings, we should set them to avoid emitting
nasty log/health messages when enabling the module.
Fixes: http://tracker.ceph.com/issues/22514 Signed-off-by: John Spray <john.spray@redhat.com>
(cherry picked from commit c64c9ff00d2df2177135bcd2735bd7aeac625643)
John Gibson [Sun, 24 Dec 2017 20:49:50 +0000 (15:49 -0500)]
rgw: Bucket IP address policy evaluation now uses rgw_remote_addr_param.
Previously bucket policy ip address restrictions were only being evaluated
against the REMOTE_ADDR environment variable and ignoring the header
specified by the rgw_remote_addr_param configuration option. This rendered
ip-based bucket policies worthless when running behind a reverse proxy.
John Gibson [Sun, 24 Dec 2017 20:48:00 +0000 (15:48 -0500)]
rgw: Fixed several bugs in policies related to IPv6 addresses.
The IPv6 conversion was not properly converting the address to host byte
order.
The text conversion of IPv6 addresses was using raw byte values instead of
the converted number. The portions of the addresses were grouped by bytes
instead of 16-bit words. The prefix length was erroneously being rendered
in hex.
John Gibson [Sun, 24 Dec 2017 20:44:54 +0000 (15:44 -0500)]
rgw: Fixed several bugs in policies related to IP Addresses.
Comparisons of two individual IP addresses caused an assertion error.
The text conversion of IPv4 addresses was using raw byte values instead of
the converted number.
NotIpAddress condition now works with multiple values.
Have convinced me that the behavior that was requested is more correct
than what we were doing before.
Fixes: http://tracker.ceph.com/issues/21901 Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
(cherry picked from commit 343a25aa2134b6fdddeca6c9dfbaefde2dc9c66a)
Adam C. Emerson [Sat, 28 Oct 2017 00:17:52 +0000 (20:17 -0400)]
rgw: Refactor checking of some ops
Since some operations check the user against the bucket owner in the
absence of a policy, rather than open-coding that everywhere, act like
a proper computer scientist and abstract it.
Fixes: http://tracker.ceph.com/issues/21896 Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
(cherry picked from commit 8818a0cb5e699135976e057061fb8e9d99850cd3)
Adam C. Emerson [Wed, 20 Dec 2017 22:06:32 +0000 (17:06 -0500)]
rgw: Plumb refresh logic into object cache
Now when we force a refetch of bucket info it will actually go to the
OSD rather than simply using the objects in the object cache.
Fixes: http://tracker.ceph.com/issues/22517 Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
(cherry picked from commit d997f657750faf920170843e62deacab70008d8b)
Adam C. Emerson [Tue, 19 Dec 2017 21:47:09 +0000 (16:47 -0500)]
rgw: Add expiration in the object cache
We had it in the chained caches, but it doesn't do much good if
they just fetch objects out of the object cache.
Fixes: http://tracker.ceph.com/issues/22517 Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
(cherry picked from commit 82a7e6ca31b416a7f0e41b5fda4c403d1d6be947)
Adam C. Emerson [Tue, 19 Dec 2017 17:53:05 +0000 (12:53 -0500)]
rgw: retry CORS put/delete operations on ECANCELLED
Fixes: http://tracker.ceph.com/issues/22517 Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
(cherry picked from commit bff7e61ca5a66b301ec49c1cf9054d1b74535832)
Adam C. Emerson [Fri, 17 Nov 2017 22:15:26 +0000 (17:15 -0500)]
rgw: Expire entries in bucket info cache
To bound the degree to which an RGW instance can go out to lunch if
the watch/notify breaks down, force refresh of any cache entry over a
certain age.
Fifteen minutes by default, and expiration can be turned off entirely.
This is separate from the LRU. The LRU removes entries based on the
last time of access. This expiration patch forces refresh based on the
last time they were updated.
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
(cherry picked from commit 4489cb58a15647a31ac0546d70400af5668404cb) Fixes: http://tracker.ceph.com/issues/22517
Adam C. Emerson [Fri, 17 Nov 2017 21:16:38 +0000 (16:16 -0500)]
rgw: Handle stale bucket info in RGWDeleteBucketPolicy
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
(cherry picked from commit e397b7e6d0c49d625fb2b2363311e6486f2045fe) Fixes: http://tracker.ceph.com/issues/22517
Adam C. Emerson [Fri, 17 Nov 2017 21:15:04 +0000 (16:15 -0500)]
rgw: Handle stale bucket info in RGWPutBucketPolicy
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
(cherry picked from commit 1738b4f6b726b462abb436f78026c1577b55f05e) Fixes: http://tracker.ceph.com/issues/22517
Adam C. Emerson [Fri, 17 Nov 2017 21:05:06 +0000 (16:05 -0500)]
rgw: Handle stale bucket info in RGWDeleteBucketWebsite
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
(cherry picked from commit f4d274248e43cb38ff2b27782c010b2c35b12b2b) Fixes: http://tracker.ceph.com/issues/22517
Adam C. Emerson [Fri, 17 Nov 2017 21:03:13 +0000 (16:03 -0500)]
rgw: Handle stale bucket info in RGWSetBucketWebsite
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
(cherry picked from commit b2b7385f194def1025a8947bab876c9856b06400) Fixes: http://tracker.ceph.com/issues/22517
Adam C. Emerson [Fri, 17 Nov 2017 20:59:44 +0000 (15:59 -0500)]
rgw: Handle stale bucket info in RGWSetBucketVersioning
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
(cherry picked from commit a0a1e7c2ef992b8758bcfb20d893730c1b202475) Fixes: http://tracker.ceph.com/issues/22517
Adam C. Emerson [Fri, 17 Nov 2017 20:53:05 +0000 (15:53 -0500)]
rgw: Handle stale bucket info in RGWPutMetadataBucket
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
(cherry picked from commit ebb86301b20098e15824f469001f6153b27965f5) Fixes: http://tracker.ceph.com/issues/22517
Adam C. Emerson [Fri, 17 Nov 2017 20:51:42 +0000 (15:51 -0500)]
rgw: Add retry_raced_bucket_write
If the OSD informs us that our bucket info is out of date when we need
to write, we should have a way to update it.
This template function allows us to wrap relevant sections of code so
they'll be retried against new bucket info on -ECANCELED.
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
(cherry picked from commit 1a3fcc70c0747791aa423cd0aa7d2596eaf3d73c) Fixes: http://tracker.ceph.com/issues/22517
Enming Zhang [Tue, 31 Oct 2017 07:21:21 +0000 (15:21 +0800)]
rgw: fix rewrite a versioning object create a new object bug
Fixes: http://tracker.ceph.com/issues/21984 Signed-off-by: Enming Zhang <enming.zhang@umcloud.com>
(cherry picked from commit 700a0292362128cb29586a64ef8215a07d96736b) Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Adam C. Emerson [Thu, 16 Nov 2017 19:42:58 +0000 (14:42 -0500)]
rgw: Add try_refresh_bucket_info function
Sometimes operations fail with -ECANCELED. This means we got raced. If
this happens we should update our bucket info from cache and try again.
Some user reports suggest that our cache may be getting and staying
out of sync. This is a bug and should be fixed, but it would also be
nice if we were robust enough to notice the problem and refresh.
So in that case, we invalidate the cache and fetch direct from the
OSD, putting a warning in the log.
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
(cherry picked from commit 9114e5e50995f0c7d2be5c24aa4712d89cd89f48) Fixes: http://tracker.ceph.com/issues/22517
Kefu Chai [Fri, 24 Nov 2017 05:56:02 +0000 (13:56 +0800)]
make-dist: exclude unused bits in boost
the docs, examples and tests are not used. so drop them. we could go
further by removing unused components in boost. but that'd be an issue
if somebody added a component in CMakeLists but forgets to update this
script. also, we need to remove boost/$component and lib/$component to
achieve this goal. this also introduces extra complicity. so leave it
for another change.