Commit Graph

129760 Commits

Author SHA1 Message Date
Radoslaw Zarzynski
0e212b2d7f crimson/osd: fix buffer overflow due to missed debug's param
The problem is:

```
DEBUG 2022-03-07 13:50:40,027 [shard 0] osd - calling method rbd.create, num_read=0, num_write=0
DEBUG 2022-03-07 13:50:40,027 [shard 0] objclass - <cls> ../src/cls/rbd/cls_rbd.cc:787: create object_prefix=parent_id size=2097152 order=0 features=1
DEBUG 2022-03-07 13:50:40,027 [shard 0] osd - handling op omap-get-vals-by-keys on object 1:144d5af5:::parent_id:head
=================================================================
==2109764==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7f6de5176e70 at pc 0x7f6dfd2a7157 bp 0x7f6de5176e30 sp 0x7f6de51765d8
WRITE of size 24 at 0x7f6de5176e70 thread T0
    #0 0x7f6dfd2a7156 in __interceptor_sigaltstack.part.0 (/lib64/libasan.so.6+0x54156)
    #1 0x7f6dfd30d5b3 in __asan::PlatformUnpoisonStacks() (/lib64/libasan.so.6+0xba5b3)
    #2 0x7f6dfd31314c in __asan_handle_no_return (/lib64/libasan.so.6+0xc014c)
Reactor stalled for 275 ms on shard 0. Backtrace: 0x45d9d 0xda72bd3 0xd801f73 0xd81f6f9 0xd81fb9c 0xd81fe2c 0xd8200f7 0x12b2f 0x7f6dfd3383c1 0x7f6dfd339b18 0x7f6dfd339bd4 0x7f6dfd339bd4 0x7f6dfd339bd4 0x7f6dfd339bd4 0x7f6dfd33b089 0x7f6dfd33bb36 0x7f6dfd32e0b5 0x7f6dfd32ff3a 0xd61d0 0x32412 0xbd8a7 0xbd134 0x54178 0xba5b3 0xc014c 0x1881f22 0x188344a 0xe8b439d 0xe8b58f2 0x2521d5a 0x2a2ee12 0x2c76349 0x2e04ce9 0x3c70c55 0x3cb8aa8 0x7f6de558de39
    #3 0x1881f22 in fmt::v6::internal::arg_map<fmt::v6::basic_format_context<seastar::internal::log_buf::inserter_iterator, char> >::~arg_map() /usr/include/fmt/core.h:1170
    #4 0x1881f22 in fmt::v6::basic_format_context<seastar::internal::log_buf::inserter_iterator, char>::~basic_format_context() /usr/include/fmt/core.h:1265
    #5 0x1881f22 in fmt::v6::format_handler<fmt::v6::arg_formatter<fmt::v6::internal::output_range<seastar::internal::log_buf::inserter_iterator, char> >, char, fmt::v6::basic_format_context<seastar::internal::log_buf::inserter_iterator, char> >::~format_handler() /usr/include/fmt/format.h:3143
    #6 0x1881f22 in fmt::v6::basic_format_context<seastar::internal::log_buf::inserter_iterator, char>::iterator fmt::v6::vformat_to<fmt::v6::arg_formatter<fmt::v6::internal::output_range<seastar::internal::log_buf::inserter_iterator, char> >, char, fmt::v6::basic_format_context<seastar::internal::log_buf::inserter_iterator, char> >(fmt::v6::arg_formatter<fmt::v6::internal::output_range<seastar::internal::log_buf::inserter_iterator, char> >::range, fmt::v6::basic_string_view<char>, fmt::v6::basic_format_args<fmt::v6::basic_format_context<seastar::internal::log_buf::inserter_iterator, char> >, fmt::v6::internal::locale_ref) /usr/include/fmt/format.h:3206
    #7 0x188344a in seastar::internal::log_buf::inserter_iterator fmt::v6::vformat_to<fmt::v6::basic_string_view<char>, seastar::internal::log_buf::inserter_iterator, , 0>(seastar::internal::log_buf::inserter_iterator, fmt::v6::basic_string_view<char> const&, fmt::v6::basic_format_args<fmt::v6::basic_format_context<fmt::v6::type_identity<seastar::internal::log_buf::inserter_iterator>::type, fmt::v6::internal::char_t_impl<fmt::v6::basic_string_view<char>, void>::type> >) /usr/include/fmt/format.h:3395
    #8 0x188344a in seastar::internal::log_buf::inserter_iterator fmt::v6::format_to<seastar::internal::log_buf::inserter_iterator, std::basic_string_view<char, std::char_traits<char> >, hobject_t const&, 0>(seastar::internal::log_buf::inserter_iterator, std::basic_string_view<char, std::char_traits<char> > const&, hobject_t const&) /usr/include/fmt/format.h:3418
    #9 0x188344a in seastar::logger::log<hobject_t const&>(seastar::log_level, seastar::logger::format_info, hobject_t const&)::{lambda(seastar::internal::log_buf::inserter_iterator)#1}::operator()(seastar::internal::log_buf::inserter_iterator) const ../src/seastar/include/seastar/util/log.hh:227
    #10 0x188344a in seastar::logger::lambda_log_writer<seastar::logger::log<hobject_t const&>(seastar::log_level, seastar::logger::format_info, hobject_t const&)::{lambda(seastar::internal::log_buf::inserter_iterator)#1}>::operator()(seastar::internal::log_buf::inserter_iterator) ../src/seastar/include/seastar/util/log.hh:106
    #11 0xe8b439d in operator() ../src/seastar/src/util/log.cc:268
    #12 0xe8b58f2 in seastar::logger::do_log(seastar::log_level, seastar::logger::log_writer&) ../src/seastar/src/util/log.cc:280
    #13 0x2521d5a in void seastar::logger::log<hobject_t const&>(seastar::log_level, seastar::logger::format_info, hobject_t const&) ../src/seastar/include/seastar/util/log.hh:230
    #14 0x2a2ee12 in void seastar::logger::debug<hobject_t const&>(seastar::logger::format_info, hobject_t const&) ../src/seastar/include/seastar/util/log.hh:373
    #15 0x2a2ee12 in PGBackend::omap_get_vals_by_keys(ObjectState const&, OSDOp&, object_stat_sum_t&) const ../src/crimson/osd/pg_backend.cc:1220
    #16 0x2c76349 in operator()<PGBackend, ObjectState> ../src/crimson/osd/ops_executer.cc:577
    #17 0x2c76349 in do_const_op<crimson::osd::OpsExecuter::execute_op(OSDOp&)::<lambda(auto:167&, const auto:168&)> > ../src/crimson/osd/ops_executer.cc:449
    #18 0x2e04ce9 in do_read_op<crimson::osd::OpsExecuter::execute_op(OSDOp&)::<lambda(auto:167&, const auto:168&)> > ../src/crimson/osd/ops_executer.h:216
    #19 0x2e04ce9 in crimson::osd::OpsExecuter::execute_op(OSDOp&) ../src/crimson/osd/ops_executer.cc:576
Reactor stalled for 762 ms on shard 0. Backtrace: 0x45d9d 0xda72bd3 0xd801f73 0xd81f6f9 0xd81fb9c 0xd81fe2c 0xd8200f7 0x12b2f 0x7f6dfd33ae85 0x7f6dfd33bb36 0x7f6dfd32e0b5 0x7f6dfd32ff3a 0xd61d0 0x32412 0xbd8a7 0xbd134 0x54178 0xba5b3 0xc014c 0x1881f22 0x188344a 0xe8b439d 0xe8b58f2 0x2521d5a 0x2a2ee12 0x2c76349 0x2e04ce9 0x3c70c55 0x3cb8aa8 0x7f6de558de39
    #20 0x3c70c55 in execute_osd_op ../src/crimson/osd/objclass.cc:35
    #21 0x3cb8aa8 in cls_cxx_map_get_val(void*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, ceph::buffer::v15_2_0::list*) ../src/crimson/osd/objclass.cc:372
    #22 0x7f6de558de39  (/home/rzarzynski/ceph1/build/lib/libcls_rbd.so.1.0.0+0x28e39)

0x7f6de5176e70 is located 249456 bytes inside of 262144-byte region [0x7f6de513a000,0x7f6de517a000)
allocated by thread T0 here:
    #0 0x7f6dfd3084a7 in aligned_alloc (/lib64/libasan.so.6+0xb54a7)
    #1 0xdd414fc in seastar::thread_context::make_stack(unsigned long) ../src/seastar/src/core/thread.cc:196
    #2 0x7fff3214bc4f  ([stack]+0xa5c4f)
```

Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
2022-03-07 14:26:07 +00:00
Adam King
922211851e
Merge pull request #44870 from phlogistonjohn/jjm-nfs-cleanups2
mgr/nfs: support managing exports without orchestration enabled 

Reviewed-by: Ramana Raja <rraja@redhat.com>
2022-02-25 10:08:05 -05:00
Adam King
b39f36b121
Merge pull request #44845 from phlogistonjohn/jjm-nfs-cleanups
mgr/nfs: various minor cleanups

Reviewed-by: Adam King <adking@redhat.com>
Reviewed-by: Michael Fritch <mfritch@suse.com>
Reviewed-by: Ramana Raja <rraja@redhat.com>
2022-02-25 10:02:52 -05:00
Adam King
057089c90d
Merge pull request #45113 from adk3798/minimize-image
cephadm: still set container_image when --no-assimilate-config is provided in bootstrap

Reviewed-by: John Mulligan <jmulligan@redhat.com>
Reviewed-by: Michael Fritch <mfritch@suse.com>
2022-02-25 09:58:08 -05:00
Adam King
6818b7bb33
Merge pull request #45127 from rkachach/fix_issue_54026_part1
mgr/cephadm: Adding python natsort module

Reviewed-by: Adam King <adking@redhat.com>
2022-02-25 09:56:12 -05:00
Adam King
1211be6ff1
Merge pull request #45132 from melissa-kun-li/asyncssh_error_messages
mgr/cephadm: reduce log level for asyncssh error messages

Reviewed-by: Michael Fritch <mfritch@suse.com>
2022-02-25 09:54:15 -05:00
Samuel Just
8c54b697d9
Merge pull request #45041 from cyx1231st/wip-crimson-cleanup-epm-segment-writer
crimson/os/seastore: introduce SegmentAllocator for Journal and ExtentPlacementManager

Reviewed-by: Samuel Just <sjust@redhat.com>
2022-02-24 14:23:12 -08:00
Casey Bodley
c209b50ec5
Merge pull request #45109 from cbodley/wip-rgw-dbstore-strings
rgw/dbstore: use string_view for string constants

Reviewed-by: Soumya Koduri <skoduri@redhat.com>
2022-02-24 13:57:31 -05:00
Guillaume Abrioux
4804a74619
Merge pull request #45126 from guits/fix-bug-cv-bz2056719
ceph-volume: abort when passed devices have partitions
2022-02-24 17:25:25 +01:00
Yingxin Cheng
5327997032 crimson/os/seastore/epm: integrate SegmentAllocator with Writer
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
2022-02-24 20:55:45 +08:00
Yingxin Cheng
b0db4be190 crimson/os/seastore: introduce SegmentAllocator and integrate with Journal
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
2022-02-24 20:55:37 +08:00
Yingxin Cheng
a1e5490758 crimson/os/seastore/journal: cleanup, move commit_to to RecordSubmitter
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
2022-02-24 20:43:15 +08:00
Yingxin Cheng
d2e3bb6f7a crimson/os/seastore/epm: replace condition_variable by a shared_promise
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
2022-02-24 20:39:39 +08:00
Yingxin Cheng
7ebf3590de crimson/os/seastore/epm: simplify gating writes for Writer
Dropped open_segment_wrapper_t.

Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
2022-02-24 20:24:26 +08:00
Yingxin Cheng
65a294058f crimson/os/seastore/segment_cleaner: drop unnecessary future from get_segment()
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
2022-02-24 20:24:26 +08:00
Sridhar Seshasayee
0853e6b2c9
Merge pull request #45121 from yaarith/fix-wear-level-empty-page
mgr/devicehealth: skip null pages when extracting wear level

Reviewed-by: Laura  Flores <lflores@redhat.com>
2022-02-24 13:24:08 +05:30
Sridhar Seshasayee
db045e005f
Merge pull request #45118 from sseshasa/wip-fix-osd-bench-fill-non-zeros
osd: Write non-zero data as part of osd benchmark test.

Reviewed-by: Laura  Flores <lflores@redhat.com>
Reviewed-by: Neha Ojha <nojha@redhat.com>
2022-02-24 13:23:40 +05:30
Samuel Just
38843c630f
Merge pull request #45010 from cyx1231st/wip-seastore-types-cleanup
crimson/os/seastore/seastore_types: cleanups

Reviewed-by: Samuel Just <sjust@redhat.com>
2022-02-23 20:28:24 -08:00
John Mulligan
b5b3e0bcb5 doc/mgr/nfs: document that nfs exports related mgr call requirements
A recent change in the mgr/nfs module should enable the functioning
of export management commands/API calls as long as the rados namespaces
and objects have been already established. Document this fact, noting
that now only the `ceph nfs cluster ...` calls *require* an
orchestration module.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2022-02-23 16:33:48 -05:00
John Mulligan
8c711afc4a mgr/nfs: support managing exports without orchestration enabled
This change allows the `ceph nfs export ...` commands to function
without the entire mgr/nfs subsystem requiring orchestration to be
enabled.  When there's no orchestration available, the code falls back
to examining the namespaces in the ".nfs" rados pool to determine what
cluster_id values are valid.

This change does not add support for creating the rados objects and
namespace needed to manage a nfs cluster. As discussed with the
orchestration group on 2022-01-22, rook does not need the mgr module to
establish the namespace. So, for now, we'll defer the work needed to
create the namespace/objects when orchestration is disabled.

Fixes: https://tracker.ceph.com/issues/54043

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2022-02-23 16:33:48 -05:00
John Mulligan
56323a2625 mgr/nfs: fix typo in error message
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2022-02-23 16:27:24 -05:00
John Mulligan
ffa95fbc79 mgr/nfs: add unit test for normalize_path
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2022-02-23 16:27:24 -05:00
John Mulligan
f91dd1bf7b mgr/nfs: change method format_path to function normalize_path
This function was not using self and thus has no need to be a method.
While we're at it, rename it to normalize_path because that's what
it is doing.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2022-02-23 16:27:24 -05:00
John Mulligan
8826614442 mgr/nfs: clean up rados object naming code
The naming of rados objects used to store the nfs config was spread
all over the code, including inline f-strings, not-static methods,
etc.
This change unifies the naming by putting constant string prefixes
and name generating functions into the utils.py file.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2022-02-23 16:27:24 -05:00
John Mulligan
c51a6755b5 mgr/nfs: make _check_rados_notify a function
This was previously a staticmethod. This static method was only used by
NFSRados object. Staticmethods are nearly always better implemented as
functions, which is done so here.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2022-02-23 16:27:23 -05:00
John Mulligan
d94b63830d mgr/nfs: limit dependency of NFSRados object
Previously, the NFSRados object accepted the "Module" as the
first argument but only used the rados attribute (type rados.Rados).
It's better to limit the scope of types when reasonably possible
so we can see what the true dependencies are. So we restrict
NFSRados to accepting a rados.Rados as the argument.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2022-02-23 16:27:23 -05:00
Adam King
59d004cb90 cephadm: still set container_image when --no-assimilate-config is provided
Fixes: https://tracker.ceph.com/issues/54141

Signed-off-by: Adam King <adking@redhat.com>
2022-02-23 16:16:44 -05:00
Yuri Weinstein
b0d6bed71a
Merge pull request #44911 from Matan-B/wip-matanb-pool-name
mon/OSDMonitor: Restrict pool names beggining with a dot

Reviewed-by: Ronen Friedman <rfriedma@redhat.com>
Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
2022-02-23 10:22:49 -08:00
Yuri Weinstein
69e3bca571
Merge pull request #44321 from Alexponomarev7/fix-static-librados-build
cmake: add ceph-common DENABLE_SHARED=OFF support

Reviewed-by: Kefu Chai <kchai@redhat.com>
2022-02-23 10:22:17 -08:00
Melissa Li
95d5db0f42 mgr/cephadm: reduce log level for asyncssh error messages
Fixes: https://tracker.ceph.com/issues/54132
Signed-off-by: Melissa Li <melissali@redhat.com>
2022-02-23 11:57:45 -05:00
Adam King
774c1a67bb
Merge pull request #45023 from rkachach/fix_issue_54198
mgr/cephadm: Show an error when invalid format

Reviewed-by: Adam King <adking@redhat.com>
2022-02-23 09:05:38 -05:00
Adam King
5e8c4dc186
Merge pull request #44928 from rkachach/fix_issue_54184
mgr/cephadm: validating service_id for MDS

Reviewed-by: Adam King <adking@redhat.com>
2022-02-23 09:02:16 -05:00
Adam King
9b6fe23f69
Merge pull request #44896 from rkachach/fix_issue_53540
mgr/cephadm: Adding AGE field to device ls cmd

Reviewed-by: Adam King <adking@redhat.com>
2022-02-23 08:58:58 -05:00
Ernesto Puerta
02285666d5
Merge pull request #45119 from rhcs-dashboard/fix-dashboard_frontend_vulnerabilities-master
mgr/dashboard: fix front-end vulnerabilities

Reviewed-by: Avan Thakkar <athakkar@redhat.com>
Reviewed-by: Ernesto Puerta <epuertat@redhat.com>
Reviewed-by: Nizamudeen A <nia@redhat.com>
2022-02-23 13:40:24 +01:00
Guillaume Abrioux
75c91a8c6f ceph-volume: abort when passed devices have partitions
ceph-volume doesn't prevent from using db and/or wal devices
with existing partitions on them.
This can lead to a data loss situation.

Fixes: https://tracker.ceph.com/issues/54376

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2022-02-23 12:02:09 +01:00
Ilya Dryomov
8488ea525e
Merge pull request #45062 from cbodley/wip-54303
librbd: avoid get_callback_adapter() for tcp_stream::async_connect()

Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
2022-02-23 11:47:20 +01:00
Ilya Dryomov
24b7bdc759
Merge pull request #45031 from cbodley/wip-54279
common: replace BitVector::NoInitAllocator with wrapper struct

Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
2022-02-23 11:45:56 +01:00
Ilya Dryomov
20c96256bb
Merge pull request #45086 from trociny/wip-54258
rbd-mirror: make mirror properly detect pool replayer needs restart

Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
2022-02-23 11:45:02 +01:00
Ilya Dryomov
b09cfa853a
Merge pull request #45106 from idryomov/wip-image-replayer-stop
rbd-mirror: synchronize with in-flight stop in ImageReplayer::stop()

Reviewed-by: Mykola Golub <mgolub@suse.com>
2022-02-23 11:42:59 +01:00
Redouane Kachach
7e646d9958
mgr/cephadm: Adding python natsort module
Needed by: https://tracker.ceph.com/issues/54026

Signed-off-by: Redouane Kachach <rkachach@redhat.com>
2022-02-23 11:39:40 +01:00
Ernesto Puerta
4fb3ee50b9
mgr/dashboard: fix front-end vulnerabilities
Fixes: https://tracker.ceph.com/issues/54367

Signed-off-by: Ernesto Puerta <epuertat@redhat.com>
2022-02-22 20:34:53 +01:00
Yaarit Hatuka
2864ac30d4 mgr/devicehealth: skip null pages when extracting wear level
Some devices have null pages in their ata_device_statistics struct; skip
those pages in order to avoid an AttributeError when extracting device's
wear level.

Fixes: https://tracker.ceph.com/issues/51554
Signed-off-by: Yaarit Hatuka <yaarit@redhat.com>
2022-02-22 19:22:09 +00:00
Ilya Dryomov
76ad859658
Merge pull request #45117 from idryomov/wip-rbd-trash-purge-error-typo
mgr/rbd_support: fix a typo in the error message

Reviewed-by: Sunny Kumar <sunkumar@redhat.com>
2022-02-22 20:10:05 +01:00
Yuri Weinstein
efc4a8fc9b
Merge pull request #45068 from ronen-fr/wip-rf-minimal-digestupd-fix
osd/scrub: stop sending bogus digest-update event messages

Reviewed-by: Neha Ojha <nojha@redhat.com>
2022-02-22 07:26:45 -08:00
Sridhar Seshasayee
09f94ace86 osd: Write non-zero data as part of osd benchmark test.
An optimization (see PR: https://github.com/ceph/ceph/pull/43337) was made
in BlueStore to avoid writing bufferlists made up of zeros. The osd
benchmark used zero filled bufferlists and this resulted in inflated osd
benchmark results.

This issue is fixed by using bufferlists filled with non-zero values.

Signed-off-by: Sridhar Seshasayee <sseshasa@redhat.com>
Fixes: https://tracker.ceph.com/issues/54364
2022-02-22 18:38:24 +05:30
Ilya Dryomov
5b3798626b mgr/rbd_support: fix a typo in the error message
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2022-02-22 13:16:14 +01:00
Redouane Kachach
1c5b3e86f9
mgr/cephadm: Adding AGE field to device ls cmd
Fixes: https://tracker.ceph.com/issues/53540

Signed-off-by: Redouane Kachach <rkachach@redhat.com>
2022-02-21 19:21:06 +01:00
Casey Bodley
146a92612b rgw/dbstore: DBOpPrepareInfo::query_str is a view
in `SQLiteDB::InitPrepareParams()`, `DBOpInfo::query_str` is assigned to
`DBOpPrepareInfo::query_str`:

  p_params.op.query_str = params->op.query_str;

by making `DBOpPrepareInfo::query_str` a view, we avoid allocating a
copy of the `std::string`

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2022-02-21 13:18:25 -05:00
Casey Bodley
673516826d rgw/dbstore: use const char* for sqlite3_bind_parameter_index()
all string constants passed to sqlite3_bind_parameter_index() are now
`static constexpr const char*` instead of `std::string`

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2022-02-21 13:18:25 -05:00
Casey Bodley
9730342d9e rgw/dbstore: Schema() functions are static
these functions only refer to static member variables, so can be static
themselves

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2022-02-21 13:18:24 -05:00