summaryrefslogtreecommitdiffstats
path: root/src/test/mds (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #57581 from adamemerson/wip-boost-1.85Casey Bodley2024-06-271-2/+1
|\ | | | | | | | | | | build: Bump boost version to 1.85 Reviewed-by: Casey Bodley <cbodley@redhat.com> Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
| * mds: Use Boost::url rather than `src.hpp`Adam Emerson2024-05-221-2/+1
| | | | | | | | | | | | As `src.hpp` is no longer supported. Signed-off-by: Adam Emerson <aemerson@redhat.com>
* | Merge pull request #57946 from ceph/wip-lusov-qdb-bootstrap-eventLeonid S. Usov2024-06-201-0/+66
|\ \ | | | | | | | | | | | | mds: QuiesceDbManager: mark next retry event during bootstrap Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
| * | mds: QuiesceDbManager: mark next retry event during bootstrapLeonid Usov2024-06-091-0/+66
| | | | | | | | | | | | | | | Fixes: https://tracker.ceph.com/issues/66406 Signed-off-by: Leonid Usov <leonid.usov@ibm.com>
* | | mds/quiesce-db: calculate_quiesce_map: aggregate quiesce roots' TTL as `max`Leonid Usov2024-06-121-1/+77
|/ / | | | | | | | | Signed-off-by: Leonid Usov <leonid.usov@ibm.com> Fixes: https://tracker.ceph.com/issues/66438
* | mds: QuiesceDbRequest: update the internal encoding of opsLeonid Usov2024-06-061-21/+21
| | | | | | | | | | | | | | | | | | Excluding the last root from a set will automatically mark it as QS_CANCELED. Hence, it makes more sense if `exclude` and `cancel` share the same op code, rather than `exclude` and `release`. Signed-off-by: Leonid Usov <leonid.usov@ibm.com> Fixes: https://tracker.ceph.com/issues/66383
* | mds/quiesce-agt: never send a synchronous ackLeonid Usov2024-05-261-20/+16
| | | | | | | | | | | | | | | | | | Defer to the agent thread to perform all acking. This avoids race conditions between the updating thread and the acking thread. Fixes: https://tracker.ceph.com/issues/66219 Signed-off-by: Leonid Usov <leonid.usov@ibm.com>
* | mds/quiesce-agt: add test for a rapid async ackLeonid Usov2024-05-261-36/+92
|/ | | | | | | | In this scenario, the agent thread is able to run and generate an ack before the db_update call returns to the caller. Fixes: https://tracker.ceph.com/issues/66219 Signed-off-by: Leonid Usov <leonid.usov@ibm.com>
* mds/queisce-db: collect acks while bootstrappingLeonid Usov2024-05-191-1/+1
| | | | | | | | | Keeping the acks that come in will allow processing them immediately after the bootstrap is over, avoiding unnecessary set state transitions. Fixes: https://tracker.ceph.com/issues/66119 Signed-off-by: Leonid Usov <leonid.usov@ibm.com>
* Merge PR #57454 into mainPatrick Donnelly2024-05-161-3/+45
|\ | | | | | | | | | | | | | | | | * refs/pull/57454/head: mds/quiesce-db: optimize peer updates mds/quiesce-db: track db epoch separately from the membership epoch mds/quiesce-db: test that a peer on a newer membership epoch can ack a root Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
| * mds/quiesce-db: test that a peer on a newer membership epoch can ack a rootLeonid Usov2024-05-141-3/+45
| | | | | | | | Signed-off-by: Leonid Usov <leonid.usov@ibm.com>
* | mds/quiesce: db: quiesce-await should EPERM if a set is past QS_QUIESCEDLeonid Usov2024-04-301-5/+4
|/ | | | | Fixes: https://tracker.ceph.com/issues/65669 Signed-off-by: Leonid Usov <leonid.usov@ibm.com>
* Merge pull request #56956 from ceph/wip-lusov-quiesce-agent-raceLeonid S. Usov2024-04-181-28/+82
|\ | | | | mds/quiesce: agent: avoid a race condition with rapid db updates
| * mds/quiesce: agent: avoid a race condition with rapid db updatesLeonid Usov2024-04-171-28/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When new roots begin processing but don't yet make it into the currently tracked set, there is a window for the next update with the same roots to treat them as new. We fix it by simplifying the agent model, getting rid of the intermediate `working` set. Since we never remove or add items into the current roots collection, it's safe to update the current set directly from the pending set. The race was due to the fact that `db_update()` relied on the `current` to deduce new roots into `pending`, while the same new root could have already been seen and posted into the `working` set. This would lead to submitting the same new root twice. Without the `working` set such race isn't possible. Fixes: https://tracker.ceph.com/issues/65545 Signed-off-by: Leonid Usov <leonid.usov@ibm.com>
* | test/TestQuiesceAgent: free quiesce_requests ContextRongqi Sun2024-04-111-1/+7
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When sanitizer is enabled, unittest_mds_quiesce_agent fails as following ``` [==========] Running 5 tests from 1 test suite. [----------] Global test environment set-up. [----------] 5 tests from QuiesceAgentTest [ RUN ] QuiesceAgentTest.ThreadManagement [ OK ] QuiesceAgentTest.ThreadManagement (3 ms) [ RUN ] QuiesceAgentTest.DbUpdates [ OK ] QuiesceAgentTest.DbUpdates (1 ms) [ RUN ] QuiesceAgentTest.QuiesceProtocol [ OK ] QuiesceAgentTest.QuiesceProtocol (3 ms) [ RUN ] QuiesceAgentTest.DuplicateQuiesceRequest [ OK ] QuiesceAgentTest.DuplicateQuiesceRequest (2 ms) [ RUN ] QuiesceAgentTest.TimeoutBeforeComplete [ OK ] QuiesceAgentTest.TimeoutBeforeComplete (2 ms) [----------] 5 tests from QuiesceAgentTest (11 ms total) [----------] Global test environment tear-down [==========] 5 tests from 1 test suite ran. (11 ms total) [ PASSED ] 5 tests. ================================================================= ==3975692==ERROR: LeakSanitizer: detected memory leaks Direct leak of 64 byte(s) in 1 object(s) allocated from: #0 0xaaaadd81c7c8 in operator new(unsigned long) (/root/ceph/build/bin/unittest_mds_quiesce_agent+0x1fc7c8) (BuildId: 7d45344ba1e43661d9de484f0a5d129377c4d4ae) #1 0xaaaadd8878d8 in QuiesceAgent::agent_thread_main() /root/ceph/src/mds/QuiesceAgent.cc:136:68 #2 0xaaaadd86de38 in QuiesceAgent::AgentThread::entry() /root/ceph/src/mds/QuiesceAgent.h:244:24 #3 0xffff83d6b554 in Thread::entry_wrapper() /root/ceph/src/common/Thread.cc:87:10 #4 0xffff83d6b314 in Thread::_entry_func(void*) /root/ceph/src/common/Thread.cc:74:29 #5 0xffff8154d5c4 in start_thread nptl/./nptl/pthread_create.c:442:8 #6 0xffff815b5ed8 misc/../sysdeps/unix/sysv/linux/aarch64/clone.S:79 Indirect leak of 120 byte(s) in 1 object(s) allocated from: #0 0xaaaadd81c7c8 in operator new(unsigned long) (/root/ceph/build/bin/unittest_mds_quiesce_agent+0x1fc7c8) (BuildId: 7d45344ba1e43661d9de484f0a5d129377c4d4ae) #1 0xaaaadd8af4f4 in __gnu_cxx::new_allocator<std::_Sp_counted_ptr_inplace<QuiesceAgent::TrackedRoot, std::allocator<QuiesceAgent::TrackedRoot>, (__gnu_cxx::_Lock_policy)2> >::allocate(unsigned long, void const*) /usr/bin/../lib/gcc/aarch64-linux-gnu/11/../../../../include/c++/11/ext/new_allocator.h:127:27 #2 0xaaaadd8af3d8 in std::allocator<std::_Sp_counted_ptr_inplace<QuiesceAgent::TrackedRoot, std::allocator<QuiesceAgent::TrackedRoot>, (__gnu_cxx::_Lock_policy)2> >::allocate(unsigned long) /usr/bin/../lib/gcc/aarch64-linux-gnu/11/../../../../include/c++/11/bits/allocator.h:185:32 #3 0xaaaadd8af3d8 in std::allocator_traits<std::allocator<std::_Sp_counted_ptr_inplace<QuiesceAgent::TrackedRoot, std::allocator<QuiesceAgent::TrackedRoot>, (__gnu_cxx::_Lock_policy)2> > >::allocate(std::allocator<std::_Sp_counted_ptr_inplace<QuiesceAgent::TrackedRoot, std::allocator<QuiesceAgent::TrackedRoot>, (__gnu_cxx::_Lock_policy)2> >&, unsigned long) /usr/bin/../lib/gcc/aarch64-linux-gnu/11/../../../../include/c++/11/bits/alloc_traits.h:464:20 #4 0xaaaadd8aef00 in std::__allocated_ptr<std::allocator<std::_Sp_counted_ptr_inplace<QuiesceAgent::TrackedRoot, std::allocator<QuiesceAgent::TrackedRoot>, (__gnu_cxx::_Lock_policy)2> > > std::__allocate_guarded<std::allocator<std::_Sp_counted_ptr_inplace<QuiesceAgent::TrackedRoot, std::allocator<QuiesceAgent::TrackedRoot>, (__gnu_cxx::_Lock_policy)2> > >(std::allocator<std::_Sp_counted_ptr_inplace<QuiesceAgent::TrackedRoot, std::allocator<QuiesceAgent::TrackedRoot>, (__gnu_cxx::_Lock_policy)2> >&) /usr/bin/../lib/gcc/aarch64-linux-gnu/11/../../../../include/c++/11/bits/allocated_ptr.h:98:21 #5 0xaaaadd8aec14 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<QuiesceAgent::TrackedRoot, std::allocator<QuiesceAgent::TrackedRoot>, QuiesceState&, std::chrono::duration<unsigned long, std::ratio<1l, 1000000000l> >&>(QuiesceAgent::TrackedRoot*&, std::_Sp_alloc_shared_tag<std::allocator<QuiesceAgent::TrackedRoot> >, QuiesceState&, std::chrono::duration<unsigned long, std::ratio<1l, 1000000000l> >&) /usr/bin/../lib/gcc/aarch64-linux-gnu/11/../../../../include/c++/11/bits/shared_ptr_base.h:648:19 #6 0xaaaadd8ae988 in std::__shared_ptr<QuiesceAgent::TrackedRoot, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<QuiesceAgent::TrackedRoot>, QuiesceState&, std::chrono::duration<unsigned long, std::ratio<1l, 1000000000l> >&>(std::_Sp_alloc_shared_tag<std::allocator<QuiesceAgent::TrackedRoot> >, QuiesceState&, std::chrono::duration<unsigned long, std::ratio<1l, 1000000000l> >&) /usr/bin/../lib/gcc/aarch64-linux-gnu/11/../../../../include/c++/11/bits/shared_ptr_base.h:1342:14 #7 0xaaaadd8ae70c in std::shared_ptr<QuiesceAgent::TrackedRoot>::shared_ptr<std::allocator<QuiesceAgent::TrackedRoot>, QuiesceState&, std::chrono::duration<unsigned long, std::ratio<1l, 1000000000l> >&>(std::_Sp_alloc_shared_tag<std::allocator<QuiesceAgent::TrackedRoot> >, QuiesceState&, std::chrono::duration<unsigned long, std::ratio<1l, 1000000000l> >&) /usr/bin/../lib/gcc/aarch64-linux-gnu/11/../../../../include/c++/11/bits/shared_ptr.h:409:4 #8 0xaaaadd8ae484 in std::shared_ptr<QuiesceAgent::TrackedRoot> std::allocate_shared<QuiesceAgent::TrackedRoot, std::allocator<QuiesceAgent::TrackedRoot>, QuiesceState&, std::chrono::duration<unsigned long, std::ratio<1l, 1000000000l> >&>(std::allocator<QuiesceAgent::TrackedRoot> const&, QuiesceState&, std::chrono::duration<unsigned long, std::ratio<1l, 1000000000l> >&) /usr/bin/../lib/gcc/aarch64-linux-gnu/11/../../../../include/c++/11/bits/shared_ptr.h:862:14 #9 0xaaaadd88ff0c in std::shared_ptr<QuiesceAgent::TrackedRoot> std::make_shared<QuiesceAgent::TrackedRoot, QuiesceState&, std::chrono::duration<unsigned long, std::ratio<1l, 1000000000l> >&>(QuiesceState&, std::chrono::duration<unsigned long, std::ratio<1l, 1000000000l> >&) /usr/bin/../lib/gcc/aarch64-linux-gnu/11/../../../../include/c++/11/bits/shared_ptr.h:878:14 #10 0xaaaadd884a6c in QuiesceAgent::db_update(QuiesceMap&) /root/ceph/src/mds/QuiesceAgent.cc:60:26 #11 0xaaaadd84a840 in QuiesceAgentTest::update(QuiesceDbVersion, std::initializer_list<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, QuiesceMap::RootInfo> >) /root/ceph/src/test/mds/TestQuiesceAgent.cc:156:18 #12 0xaaaadd84985c in QuiesceAgentTest::update(unsigned long, std::initializer_list<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, QuiesceMap::RootInfo> >) /root/ceph/src/test/mds/TestQuiesceAgent.cc:165:14 #13 0xaaaadd8288a8 in QuiesceAgentTest_DbUpdates_Test::TestBody() /root/ceph/src/test/mds/TestQuiesceAgent.cc:213:16 #14 0xaaaadd977230 in void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /root/ceph/src/googletest/googletest/src/gtest.cc:2605:10 #15 0xaaaadd924590 in void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /root/ceph/src/googletest/googletest/src/gtest.cc:2641:14 #16 0xaaaadd8d4a40 in testing::Test::Run() /root/ceph/src/googletest/googletest/src/gtest.cc:2680:5 #17 0xaaaadd8d6984 in testing::TestInfo::Run() /root/ceph/src/googletest/googletest/src/gtest.cc:2858:11 #18 0xaaaadd8d7f84 in testing::TestSuite::Run() /root/ceph/src/googletest/googletest/src/gtest.cc:3012:28 #19 0xaaaadd8f3d48 in testing::internal::UnitTestImpl::RunAllTests() /root/ceph/src/googletest/googletest/src/gtest.cc:5723:44 #20 0xaaaadd981130 in bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /root/ceph/src/googletest/googletest/src/gtest.cc:2605:10 #21 0xaaaadd92bb64 in bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /root/ceph/src/googletest/googletest/src/gtest.cc:2641:14 #22 0xaaaadd8f31c0 in testing::UnitTest::Run() /root/ceph/src/googletest/googletest/src/gtest.cc:5306:10 #23 0xaaaadd820710 in RUN_ALL_TESTS() /root/ceph/src/googletest/googletest/include/gtest/gtest.h:2486:46 #24 0xaaaadd81ed3c in main /root/ceph/src/test/unit.cc:45:10 #25 0xffff814f73f8 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16 #26 0xffff814f74c8 in __libc_start_main csu/../csu/libc-start.c:392:3 #27 0xaaaadd76e6ac in _start (/root/ceph/build/bin/unittest_mds_quiesce_agent+0x14e6ac) (BuildId: 7d45344ba1e43661d9de484f0a5d129377c4d4ae) SUMMARY: AddressSanitizer: 184 byte(s) leaked in 2 allocation(s). ``` quiesce_requests Context should be freed. Signed-off-by: Rongqi Sun <sunrongqi@huawei.com>
* mds/quiesce-db: always clear the db if a membership is lostLeonid Usov2024-03-171-8/+2
| | | | | Fixes: https://tracker.ceph.com/issues/64912 Signed-off-by: Leonid Usov <leonid.usov@ibm.com>
* mds/quiesce-db: keep the db thread alive until shutdownLeonid Usov2024-03-061-8/+7
| | | | | | With the change we can now avoid having to join it during the membership update, preventing potential deadlocks Signed-off-by: Leonid Usov <leonid.usov@ibm.com>
* mds/quiesce-db: incorporate review commentsLeonid Usov2024-03-042-3/+18
| | | | Signed-off-by: Leonid Usov <leonid.usov@ibm.com>
* mds/quiesce: declare QuiesceDbPeerListing and QuiesceDbPeerAckLeonid Usov2024-03-041-2/+2
| | | | | | | With these dedicated structs we can fully defer to QuiesceDbEncoding when encoding/decoding quiesce db messages Signed-off-by: Leonid Usov <leonid.usov@ibm.com>
* mds/quiesce: resolve the quiesce cluster at the mds monitorLeonid Usov2024-03-041-1/+1
| | | | Signed-off-by: Leonid Usov <leonid.usov@ibm.com>
* mds/quiesce: QuiesceAgent implementation and unit testsLeonid Usov2024-03-042-0/+553
| | | | | | | | QuiesceAgent is the layer that converts updates from the QuiesceDb into calls to the QuiesceProtocol APIs, and then sends async acks back to the db manager following the quiesce protocol events. Signed-off-by: Leonid Usov <leonid.usov@ibm.com>
* mds/quiesce: QuiesceDb.h and QuiesceDbManager with testsLeonid Usov2024-03-042-0/+1623
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Quiesce DB is one of the components of the "Consistent Snapshots" epic. The solution is discussed in a slide deck available for viewing to @redhat users: https://docs.google.com/presentation/d/1wE3-e9AAme7Q3qmeshUSthJoQGw7-fKTrtS9PsdAIVo/edit?usp=sharing This commit is focusing on the replicated quiesce database maintained by the MDS rank cluster. One of the major goals was to design the component in a way that can be easily tested outside of the MDS infrastructure, which is why the communication layer has been asbtracted out by introducing just two communication callbacks that will need to be implemented by the infrastructure. The most of the component code is delivered in a single coherent commit, along with the uint tests. Other commits will be dedicated to integration with the MDS infrastructure and other changes that can't be attributed to the core quiesce db code or its tests. The quiesce db component is composed of the following major parts/actors: * QuiesceDbManager is the main actor, implementing both the leader and the replica roles. Normally, there will be an instance of the manager per MDS rank, although given the decoupling of the infrastructure and the manager, one can run any number of instances on a single node, which is how test are working. * The manager interfaces to the infrastructure via two main APIs with the infrastructure that provides communication and cluster configuration (actor 2) and the quiesce db client that is responsible for the quiescing of the roots (actor 3) ** ClusterMembership is how manager is configured to be part of a (virtual) cluster. This structure will deliver information about other peers, the leader and provide two communication APIs: send_listing_to for db replication from the leader to replicas and send_ack for reporting quiesce success from the agents. ** Client Interface consists of a QuisceMap notify callback and a dedicated manager method to submit asynchronous acks following the agent (rank) quiesce progress. The API of the quiesce db is described in the slide deck mentioned above. The full scope of capabilities are encapsulated in a single QuiesceDbRequest structure. This should simplify the implementation of other components that will have to propagate the functionality to the administrator user of the volumes plugin. Signed-off-by: Leonid Usov <leonid.usov@ibm.com>
* src/tests/mds: improve test coverage in TestMDSAuthCapsRishabh Dave2023-07-141-0/+26
| | | | | | | | | | Currently we check if the right caps parse successfully and the wrong caps fail to parse. Increase the test coverage by adding one more tests -- dump the right caps in to a string after the parsing is successfully and then re-parse the caps and check if re-parsed caps dumps to the exact same string. Signed-off-by: Rishabh Dave <ridave@redhat.com>
* src/tests/mds: add tests for all combinations of MDS capsRishabh Dave2023-07-141-13/+51
| | | | Signed-off-by: Rishabh Dave <ridave@redhat.com>
* mds: use variable g_ceph_context directly in MDSAuthCapsRishabh Dave2023-06-161-16/+16
| | | | | | | Variable g_ceph_context is global, therefore use it directly instead of passing it as a parameter to method. Signed-off-by: Rishabh Dave <ridave@redhat.com>
* test: : build without "using namespace std"Kefu Chai2021-08-131-2/+1
| | | | | | | | | | * add "std::" prefix in headers * add "using" declarations in .cc files. so we don't rely on "using namespace std" in one or more included headers. Signed-off-by: Kefu Chai <kchai@redhat.com>
* mds: add root_squash mode in MDS auth capsRamana Raja2020-09-251-0/+24
| | | | | | | | | | | | | | | | | | | | Implement a root_squash mode in MDS auth caps to deny operations for clients with uid=0 or gid=0 that need write access. It's mainly to prevent operations such as accidental `sudo rm -rf /path`. The root squash mode can be enforced in one of the following ways in the MDS caps, 'allow rw root_squash' (across file systems) or 'allow rw fsname=a root_squash' (on a file system) or 'allow rw fsname=a path=/vol/group/subvol00 root_squash' (on a file system path) Fixes: https://tracker.ceph.com/issues/42451 Signed-off-by: Ramana Raja <rraja@redhat.com>
* common/RefCountedObj: cleanup con/desPatrick Donnelly2019-09-161-18/+9
| | | | | | | | | | | | | | | | | | Also, don't allow children to set nref (to 0). This is the more significant change as it required fixing various code to not do this: <reftype> ptr = new RefCountedObjectFoo(..., 0); as a way to create a starting reference with nref==1. This is a pretty bad code smell so I've converted all the code doing this to use the new factory method which produces the reference safely: auto ptr = ceph::make_ref<RefCountedObjectFoo>(...); libradosstriper was particularly egregious in its abuse of setting the starting nref. :( Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
* mds/MDSAuthCaps: parse and enforce network restrictionSage Weil2018-08-131-0/+16
| | | | Signed-off-by: Sage Weil <sage@redhat.com>
* mds/MDSAuthCaps: pass addr to is_capableSage Weil2018-08-131-59/+63
| | | | Signed-off-by: Sage Weil <sage@redhat.com>
* mds/SessionMap: track socket_addr for each SessionSage Weil2018-08-131-9/+9
| | | | | | Make sure socket_addr is populated when connection is set. Signed-off-by: Sage Weil <sage@redhat.com>
* mds: make Server::prepare_force_open_sessions() update client metadataYan, Zheng2018-07-121-2/+5
| | | | | | | The function is used for opening sessions for importing caps. It didn't set client metadata for new sessions. Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
* mds: add MAY_SNAPSHOT in MDSAuthCapsYan, Zheng2018-06-191-1/+1
| | | | | | | | For controlling whether a client is allowed to create or delete snapshots Fixes: http://tracker.ceph.com/issues/24284 Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
* cephfs: Do not check auth gid when not specifiedDouglas Fuller2017-11-031-0/+13
| | | | | | | For auth caps that omit the gid, do not check for a gid match. Fixes: http://tracker.ceph.com/issues/22009 Signed-off-by: Douglas Fuller <dfuller@redhat.com>
* cmake: always use CMAKE_RUNTIME_OUTPUT_DIRECTORY as the unittests' pathKefu Chai2017-10-031-2/+2
| | | | Signed-off-by: Kefu Chai <kchai@redhat.com>
* cmake: move common/util.cc into ceph-commonKefu Chai2017-06-141-1/+0
| | | | Signed-off-by: Kefu Chai <kchai@redhat.com>
* cmake: turn libcommon into a shared libraryKefu Chai2017-01-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | prior to this change, libcommon is a convenient library which gets linked into librados, librbd and libcephfs and all ceph executables. this incurs some problems: - double dose of libcommon in memory space and HDD: waste of memory and disk space. - if an application links to two libraries including libcommon at the same time. take librados and libcephfs as an example, they could interfere with each other by changing the other guy's status. after this change, libcommon is tuned into a shared library and renamed to libceph-common. it will be installed into $prefix/lib/ceph, and packaged in librados2. ceph.spec.in,debian/librados2.install: package libceph-common in librados2. CMakeLists.txt: - do not link against libboost-* if not necessary. - s/common/ceph-common/g - install libceph-common into $prefix/lib/ceph - set rpath to $prefix/lib/ceph - link against ceph-common if an executable needs access to non public symbols in ceph. Signed-off-by: Kefu Chai <kchai@redhat.com>
* test,cmake: turn unit.h into unit.cc to speed up compilationKefu Chai2016-11-283-2/+2
| | | | Signed-off-by: Kefu Chai <kchai@redhat.com>
* common,test: g_ceph_context->put() upon returnKefu Chai2016-11-242-31/+2
| | | | | | | | | | | | | | | | | | | | | prior to this change, global_init() could create a new CephContext and assign it to g_ceph_context. it's our responsibilty to release the CephContext explicitly using cct->put() before the application quits. but sometimes, we fail to do so. in this change, global_init() will return an intrusive_ptr<CephContext>, which calls `g_ceph_context->put()` in its dtor. this ensures that the CephContext is always destroyed before main() returns. so the log is flushed before _log_exp_length is destroyed. there are two cases where global_pre_init() is called directly. - ceph_conf.cc: g_ceph_context->put() will be called by an intrusive_ptr<> deleter. - rgw_main.cc: global_init() is called later on on the success code path, so it will be taken care of. Fixes: http://tracker.ceph.com/issues/17762 Signed-off-by: Kefu Chai <kchai@redhat.com>
* mds: sort GID lists in MDSAuthCapsGreg Farnum2016-09-271-1/+1
| | | | | | Fixes: http://tracker.ceph.com/issues/17368 Signed-off-by: Greg Farnum <gfarnum@redhat.com>
* test: basic checks on gid list is_capableGreg Farnum2016-09-221-4/+17
| | | | Signed-off-by: Greg Farnum <gfarnum@redhat.com>
* mds: pass full gid list to MDSAuthCap checks, when presentGreg Farnum2016-09-221-50/+50
| | | | Signed-off-by: Greg Farnum <gfarnum@redhat.com>
* cmake: do not exclude tests from 'make all'Sage Weil2016-06-231-2/+2
| | | | | | | | This prevent us from doing 'make' and then 'ctest ...'. It is also super annoying in general to not verify the tests compile with a simple 'make'. Signed-off-by: Sage Weil <sage@redhat.com>
* Merge pull request #8546 from jcsp/wip-15465John Spray2016-05-041-0/+22
|\ | | | | | | | | mds: fix auth caps with hyphen in path (#15465) Reviewed-by: Yan, Zheng <zyan@redhat.com>
| * test/mds: add test for symbols in pathsJohn Spray2016-04-121-0/+21
| | | | | | | | | | | | Especially, hyphens. Signed-off-by: John Spray <john.spray@redhat.com>
| * mds: fix auth caps with hyphen in pathJohn Spray2016-04-121-0/+1
| | | | | | | | | | | | | | | | | | Quirk of the boost spirit char() fn, hyphens are treated as range delimiters unless they're the last character in the set. Fixes: #15465 Signed-off-by: John Spray <john.spray@redhat.com>
* | cmake: moved tests into test/mds dirAli Maredia2016-04-151-0/+15
|/ | | | | | Added a CMakeLists.txt into test/mds. Signed-off-by: Ali Maredia <amaredia@redhat.com>
* test: add TestSessionFilterJohn Spray2015-10-061-0/+162
| | | | | | | | Tests for SessionFilter, the class filters allows session listing and eviction in the new MDS tell commands. Signed-off-by: John Spray <john.spray@redhat.com>
* unittest_mds_authcap: improve user testsSage Weil2015-10-011-13/+50
| | | | Signed-off-by: Sage Weil <sage@redhat.com>
* mds: drop MAY_CREATESage Weil2015-10-011-2/+1
| | | | | | | | The check is a no-op. We already verify the uid/gid combo is valid and that the dir is writeable with MAY_WRITE. The new file is always set to the caller uid:gid. Signed-off-by: Sage Weil <sage@redhat.com>