#
b0494532 |
| 11-May-2015 |
Ilya Dryomov <idryomov@gmail.com> |
libceph: request a new osdmap if lingering request maps to no osd
This commit does two things. First, if there are any homeless lingering requests, we now request a new osdmap even if the osdmap th
libceph: request a new osdmap if lingering request maps to no osd
This commit does two things. First, if there are any homeless lingering requests, we now request a new osdmap even if the osdmap that is being processed brought no changes, i.e. if a given lingering request turned homeless in one of the previous epochs and remained homeless in the current epoch. Not doing so leaves us with a stale osdmap and as a result we may miss our window for reestablishing the watch and lose notifies.
MON=1 OSD=1:
# cat linger-needmap.sh #!/bin/bash rbd create --size 1 test DEV=$(rbd map test) ceph osd out 0 rbd map dne/dne # obtain a new osdmap as a side effect (!) sleep 1 ceph osd in 0 rbd resize --size 2 test # rbd info test | grep size -> 2M # blockdev --getsize $DEV -> 1M
N.B.: Not obtaining a new osdmap in between "osd out" and "osd in" above is enough to make it miss that resize notify, but that is a bug^Wlimitation of ceph watch/notify v1.
Second, homeless lingering requests are now kicked just like those lingering requests whose mapping has changed. This is mainly to recognize that a homeless lingering request makes no sense and to preserve the invariant that a registered lingering request is not sitting on any of r_req_lru_item lists. This spares us a WARN_ON, which commit ba9d114ec557 ("libceph: clear r_req_lru_item in __unregister_linger_request()") tried to fix the _wrong_ way.
Cc: stable@vger.kernel.org # 3.10+ Signed-off-by: Ilya Dryomov <idryomov@gmail.com> Reviewed-by: Sage Weil <sage@redhat.com>
show more ...
|
Revision tags: v4.1-rc1, v4.0, v4.0-rc7, v4.0-rc6, v4.0-rc5, v4.0-rc4, v4.0-rc3, v4.0-rc2, v4.0-rc1 |
|
#
b28ec2f3 |
| 16-Feb-2015 |
Ilya Dryomov <idryomov@gmail.com> |
libceph: kfree() in put_osd() shouldn't depend on authorizer
a255651d4cad ("ceph: ensure auth ops are defined before use") made kfree() in put_osd() conditional on the authorizer. A mechanical mist
libceph: kfree() in put_osd() shouldn't depend on authorizer
a255651d4cad ("ceph: ensure auth ops are defined before use") made kfree() in put_osd() conditional on the authorizer. A mechanical mistake most likely - fix it.
Cc: Alex Elder <elder@linaro.org> Signed-off-by: Ilya Dryomov <idryomov@gmail.com> Reviewed-by: Sage Weil <sage@redhat.com> Reviewed-by: Alex Elder <elder@linaro.org>
show more ...
|
#
7eb71e03 |
| 17-Feb-2015 |
Ilya Dryomov <idryomov@gmail.com> |
libceph: fix double __remove_osd() problem
It turns out it's possible to get __remove_osd() called twice on the same OSD. That doesn't sit well with rb_erase() - depending on the shape of the tree
libceph: fix double __remove_osd() problem
It turns out it's possible to get __remove_osd() called twice on the same OSD. That doesn't sit well with rb_erase() - depending on the shape of the tree we can get a NULL dereference, a soft lockup or a random crash at some point in the future as we end up touching freed memory. One scenario that I was able to reproduce is as follows:
<osd3 is idle, on the osd lru list> <con reset - osd3> con_fault_finish() osd_reset() <osdmap - osd3 down> ceph_osdc_handle_map() <takes map_sem> kick_requests() <takes request_mutex> reset_changed_osds() __reset_osd() __remove_osd() <releases request_mutex> <releases map_sem> <takes map_sem> <takes request_mutex> __kick_osd_requests() __reset_osd() __remove_osd() <-- !!!
A case can be made that osd refcounting is imperfect and reworking it would be a proper resolution, but for now Sage and I decided to fix this by adding a safe guard around __remove_osd().
Fixes: http://tracker.ceph.com/issues/8087
Cc: Sage Weil <sage@redhat.com> Cc: stable@vger.kernel.org # 3.9+: 7c6e6fc53e73: libceph: assert both regular and lingering lists in __remove_osd() Cc: stable@vger.kernel.org # 3.9+: cc9f1f518cec: libceph: change from BUG to WARN for __remove_osd() asserts Cc: stable@vger.kernel.org # 3.9+ Signed-off-by: Ilya Dryomov <idryomov@gmail.com> Reviewed-by: Sage Weil <sage@redhat.com> Reviewed-by: Alex Elder <elder@linaro.org>
show more ...
|
Revision tags: v3.19, v3.19-rc7, v3.19-rc6, v3.19-rc5, v3.19-rc4, v3.19-rc3, v3.19-rc2, v3.19-rc1, v3.18, v3.18-rc7, v3.18-rc6, v3.18-rc5 |
|
#
715e4cd4 |
| 13-Nov-2014 |
Yan, Zheng <zyan@redhat.com> |
libceph: specify position of extent operation
allow specifying position of extent operation in multi-operations osd request. This is required for cephfs to convert inline data to normal data (compar
libceph: specify position of extent operation
allow specifying position of extent operation in multi-operations osd request. This is required for cephfs to convert inline data to normal data (compare xattr, then write object).
Signed-off-by: Yan, Zheng <zyan@redhat.com> Reviewed-by: Ilya Dryomov <idryomov@redhat.com>
show more ...
|
#
864e9197 |
| 12-Nov-2014 |
Yan, Zheng <zyan@redhat.com> |
libceph: add CREATE osd operation support
Add CEPH_OSD_OP_CREATE support. Also change libceph to not treat CEPH_OSD_OP_DELETE as an extent op and add an assert to that end.
Signed-off-by: Yan, Zhe
libceph: add CREATE osd operation support
Add CEPH_OSD_OP_CREATE support. Also change libceph to not treat CEPH_OSD_OP_DELETE as an extent op and add an assert to that end.
Signed-off-by: Yan, Zheng <zyan@redhat.com> Reviewed-by: Ilya Dryomov <idryomov@redhat.com>
show more ...
|
#
d74b50be |
| 12-Nov-2014 |
Yan, Zheng <zyan@redhat.com> |
libceph: add SETXATTR/CMPXATTR osd operations support
Signed-off-by: Yan, Zheng <zyan@redhat.com> Reviewed-by: Ilya Dryomov <idryomov@redhat.com>
|
Revision tags: v3.18-rc4 |
|
#
33d07337 |
| 04-Nov-2014 |
Yan, Zheng <zyan@redhat.com> |
libceph: message signature support
Signed-off-by: Yan, Zheng <zyan@redhat.com>
|
#
cc9f1f51 |
| 05-Nov-2014 |
Ilya Dryomov <idryomov@redhat.com> |
libceph: change from BUG to WARN for __remove_osd() asserts
No reason to use BUG_ON for osd request list assertions.
Signed-off-by: Ilya Dryomov <idryomov@redhat.com> Reviewed-by: Alex Elder <elder
libceph: change from BUG to WARN for __remove_osd() asserts
No reason to use BUG_ON for osd request list assertions.
Signed-off-by: Ilya Dryomov <idryomov@redhat.com> Reviewed-by: Alex Elder <elder@linaro.org>
show more ...
|
#
ba9d114e |
| 05-Nov-2014 |
Ilya Dryomov <idryomov@redhat.com> |
libceph: clear r_req_lru_item in __unregister_linger_request()
kick_requests() can put linger requests on the notarget list. This means we need to clear the much-overloaded req->r_req_lru_item in _
libceph: clear r_req_lru_item in __unregister_linger_request()
kick_requests() can put linger requests on the notarget list. This means we need to clear the much-overloaded req->r_req_lru_item in __unregister_linger_request() as well, or we get an assertion failure in ceph_osdc_release_request() - !list_empty(&req->r_req_lru_item).
AFAICT the assumption was that registered linger requests cannot be on any of req->r_req_lru_item lists, but that's clearly not the case.
Signed-off-by: Ilya Dryomov <idryomov@redhat.com> Reviewed-by: Alex Elder <elder@linaro.org>
show more ...
|
#
a390de02 |
| 04-Nov-2014 |
Ilya Dryomov <idryomov@redhat.com> |
libceph: unlink from o_linger_requests when clearing r_osd
Requests have to be unlinked from both osd->o_requests (normal requests) and osd->o_linger_requests (linger requests) lists when clearing r
libceph: unlink from o_linger_requests when clearing r_osd
Requests have to be unlinked from both osd->o_requests (normal requests) and osd->o_linger_requests (linger requests) lists when clearing req->r_osd. Otherwise __unregister_linger_request() gets confused and we trip over a !list_empty(&osd->o_linger_requests) assert in __remove_osd().
MON=1 OSD=1:
# cat remove-osd.sh #!/bin/bash rbd create --size 1 test DEV=$(rbd map test) ceph osd out 0 sleep 3 rbd map dne/dne # obtain a new osdmap as a side effect rbd unmap $DEV & # will block sleep 3 ceph osd in 0
Signed-off-by: Ilya Dryomov <idryomov@redhat.com> Reviewed-by: Alex Elder <elder@linaro.org>
show more ...
|
Revision tags: v3.18-rc3, v3.18-rc2, v3.18-rc1, v3.17 |
|
#
70b5bfa3 |
| 02-Oct-2014 |
Ilya Dryomov <idryomov@redhat.com> |
libceph: sync osd op definitions in rados.h
Bring in missing osd ops and strings, use macros to eliminate multiple points of maintenance.
Signed-off-by: Ilya Dryomov <idryomov@redhat.com> Reviewed-
libceph: sync osd op definitions in rados.h
Bring in missing osd ops and strings, use macros to eliminate multiple points of maintenance.
Signed-off-by: Ilya Dryomov <idryomov@redhat.com> Reviewed-by: Sage Weil <sage@redhat.com>
show more ...
|
Revision tags: v3.17-rc7, v3.17-rc6, v3.17-rc5 |
|
#
91883cd2 |
| 11-Sep-2014 |
Ilya Dryomov <ilya.dryomov@inktank.com> |
libceph: don't try checking queue_work() return value
queue_work() doesn't "fail to queue", it returns false if work was already on a queue, which can't happen here since we allocate event_work righ
libceph: don't try checking queue_work() return value
queue_work() doesn't "fail to queue", it returns false if work was already on a queue, which can't happen here since we allocate event_work right before we queue it. So don't bother at all.
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com> Reviewed-by: Alex Elder <elder@linaro.org>
show more ...
|
#
b9a67899 |
| 09-Sep-2014 |
Joe Perches <joe@perches.com> |
libceph: Convert pr_warning to pr_warn
Use the more common pr_warn.
Other miscellanea:
o Coalesce formats o Realign arguments
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Ilya Dryo
libceph: Convert pr_warning to pr_warn
Use the more common pr_warn.
Other miscellanea:
o Coalesce formats o Realign arguments
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
show more ...
|
Revision tags: v3.17-rc4 |
|
#
2cc6128a |
| 03-Sep-2014 |
Ilya Dryomov <ilya.dryomov@inktank.com> |
libceph: resend lingering requests with a new tid
Both not yet registered (r_linger && list_empty(&r_linger_item)) and registered linger requests should use the new tid on resend to avoid the dup op
libceph: resend lingering requests with a new tid
Both not yet registered (r_linger && list_empty(&r_linger_item)) and registered linger requests should use the new tid on resend to avoid the dup op detection logic on the OSDs, yet we were doing this only for "registered" case. Factor out and simplify the "registered" logic and use the new helper for "not registered" case as well.
Fixes: http://tracker.ceph.com/issues/8806
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com> Reviewed-by: Alex Elder <elder@linaro.org>
show more ...
|
#
f671b581 |
| 02-Sep-2014 |
Ilya Dryomov <ilya.dryomov@inktank.com> |
libceph: abstract out ceph_osd_request enqueue logic
Introduce __enqueue_request() and switch to it.
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com> Reviewed-by: Alex Elder <elder@linaro.org>
|
Revision tags: v3.17-rc3, v3.17-rc2, v3.17-rc1, v3.16, v3.16-rc7, v3.16-rc6, v3.16-rc5, v3.16-rc4, v3.16-rc3 |
|
#
2d05f082 |
| 24-Jun-2014 |
Ilya Dryomov <ilya.dryomov@inktank.com> |
libceph: nuke ceph_osdc_unregister_linger_request()
Remove now unused ceph_osdc_unregister_linger_request().
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com> Reviewed-by: Alex Elder <elder@li
libceph: nuke ceph_osdc_unregister_linger_request()
Remove now unused ceph_osdc_unregister_linger_request().
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com> Reviewed-by: Alex Elder <elder@linaro.org>
show more ...
|
Revision tags: v3.16-rc2 |
|
#
c9f9b93d |
| 19-Jun-2014 |
Ilya Dryomov <ilya.dryomov@inktank.com> |
libceph: introduce ceph_osdc_cancel_request()
Introduce ceph_osdc_cancel_request() intended for canceling requests from the higher layers (rbd and cephfs). Because higher layers are in charge and a
libceph: introduce ceph_osdc_cancel_request()
Introduce ceph_osdc_cancel_request() intended for canceling requests from the higher layers (rbd and cephfs). Because higher layers are in charge and are supposed to know what and when they are canceling, the request is not completed, only unref'ed and removed from the libceph data structures.
__cancel_request() is no longer called before __unregister_request(), because __unregister_request() unconditionally revokes r_request and there is no point in trying to do it twice.
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com> Reviewed-by: Alex Elder <elder@linaro.org>
show more ...
|
#
4f23409e |
| 20-Jun-2014 |
Ilya Dryomov <ilya.dryomov@inktank.com> |
libceph: fix linger request check in __unregister_request()
We should check if request is on the linger request list of any of the OSDs, not whether request is registered or not.
Signed-off-by: Ily
libceph: fix linger request check in __unregister_request()
We should check if request is on the linger request list of any of the OSDs, not whether request is registered or not.
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com> Reviewed-by: Alex Elder <elder@linaro.org>
show more ...
|
#
af593064 |
| 20-Jun-2014 |
Ilya Dryomov <ilya.dryomov@inktank.com> |
libceph: unregister only registered linger requests
Linger requests that have not yet been registered should not be unregistered by __unregister_linger_request(). This messes up ref count and leads
libceph: unregister only registered linger requests
Linger requests that have not yet been registered should not be unregistered by __unregister_linger_request(). This messes up ref count and leads to use-after-free.
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com> Reviewed-by: Alex Elder <elder@linaro.org>
show more ...
|
#
7c6e6fc5 |
| 18-Jun-2014 |
Ilya Dryomov <ilya.dryomov@inktank.com> |
libceph: assert both regular and lingering lists in __remove_osd()
It is important that both regular and lingering requests lists are empty when the OSD is removed.
Signed-off-by: Ilya Dryomov <ily
libceph: assert both regular and lingering lists in __remove_osd()
It is important that both regular and lingering requests lists are empty when the OSD is removed.
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com> Reviewed-by: Alex Elder <elder@linaro.org>
show more ...
|
#
6562d661 |
| 20-Jun-2014 |
Ilya Dryomov <ilya.dryomov@inktank.com> |
libceph: harden ceph_osdc_request_release() a bit
Add some WARN_ONs to alert us when we try to destroy requests that are still registered.
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com> Rev
libceph: harden ceph_osdc_request_release() a bit
Add some WARN_ONs to alert us when we try to destroy requests that are still registered.
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com> Reviewed-by: Alex Elder <elder@linaro.org>
show more ...
|
#
9e94af20 |
| 20-Jun-2014 |
Ilya Dryomov <ilya.dryomov@inktank.com> |
libceph: move and add dout()s to ceph_osdc_request_{get,put}()
Add dout()s to ceph_osdc_request_{get,put}(). Also move them to .c and turn kref release callback into a static function.
Signed-off-
libceph: move and add dout()s to ceph_osdc_request_{get,put}()
Add dout()s to ceph_osdc_request_{get,put}(). Also move them to .c and turn kref release callback into a static function.
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com> Reviewed-by: Alex Elder <elder@linaro.org>
show more ...
|
#
bbf37ec3 |
| 20-Jun-2014 |
Ilya Dryomov <ilya.dryomov@inktank.com> |
libceph: add maybe_move_osd_to_lru() and switch to it
Abstract out __move_osd_to_lru() logic from __unregister_request() and __unregister_linger_request().
Signed-off-by: Ilya Dryomov <ilya.dryomov
libceph: add maybe_move_osd_to_lru() and switch to it
Abstract out __move_osd_to_lru() logic from __unregister_request() and __unregister_linger_request().
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com> Reviewed-by: Alex Elder <elder@linaro.org>
show more ...
|
#
1d0326b1 |
| 20-Jun-2014 |
Ilya Dryomov <ilya.dryomov@inktank.com> |
libceph: rename ceph_osd_request::r_linger_osd to r_linger_osd_item
So that:
req->r_osd_item --> osd->o_requests list req->r_linger_osd_item --> osd->o_linger_requests list
Signed-off-by: Ilya Dry
libceph: rename ceph_osd_request::r_linger_osd to r_linger_osd_item
So that:
req->r_osd_item --> osd->o_requests list req->r_linger_osd_item --> osd->o_linger_requests list
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com> Reviewed-by: Alex Elder <elder@linaro.org>
show more ...
|
Revision tags: v3.16-rc1 |
|
#
f6479449 |
| 10-Jun-2014 |
stephen hemminger <stephen@networkplumber.org> |
ceph: remove bogus extern
Sparse complained about this bogus extern on definition of a function.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: David S. Miller <davem@
ceph: remove bogus extern
Sparse complained about this bogus extern on definition of a function.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|