* fix the test of ObjectStore/StoreTest.SimpleCloneTest, the expected
return value of getattr() should be 0. otherwise it otherwise it fails
on objectstore backends of "memstore" and "keyvaluestore".
* change FileStore::getattr() to return 0 on success
* tighten related tests in ceph_test_objectstore, to test the return value
of getattr() using ASSERT_EQ(r, 0) instead of ASSERT_GE(r, 0)
Signed-off-by: Kefu Chai <kchai@redhat.com>
GenericObjectMap will copyup parents keys when rm keys, but if
caller(KeyValueStore) already buffer "set keys", it shouldn't
copyup reset keys.
Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
rbd:If the image has any protected snaps,'rbd snap purge image' will return failure without removing any snaps.
Reviewed-by: Josh During <jdurgin@redhat.com>
Reviewed-by: Haomai Wang <haomaiwang@gmail.com>
`CEPH_GLOBAL` was removed in fa78739, but the linked libraries does not
offer all needed symbols for "rbd". so add them back.
Signed-off-by: Kefu Chai <kchai@redhat.com>
common/syncfs: fall back to sync(2) if syncfs(2) not available
Reviewed-by: Haomai Wang <haomaiwang@gmail.com>
Reviewed-by: Sage Weil <sage@redhat.com>
Reviewed-by: Loic Dachary <ldachary@redhat.com>
Currently the head object will be prefetched in each GET:
a) This is unnecessary if the Range GET falls to shadow objects.
b) The GET request would be quite slow if we have a big head object
This patch adds some check on the Range. If it's not in the head
object(>=rgw_max_chunk_size) then skip the prefetch.
Fixes: #12539
Signed-off-by: Yuan Zhou <yuan.zhou@intel.com>
librbd test cases attempt to enable lockdep coverage via the librados
API. Use a configuration observer to register/unregister lockdep
support.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Remove all depencencies on md_config_t and instead use librados API
methods to get/set configuration values.
Fixes: #12479
Backport: hammer
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Commit bd050240ce ("test_librbd_fsx: flush before discard in krbd
mode") added an fsync() before BLKDISCARD. Don't know what I was
thinking at the time, but I missed the invalidate part, for which we
need to use the BLKFLSBUF ioctl.
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Otherwise, _flush() might continue to write to m_fd after it's closed.
This might cause log data to go to a data object if the filestore then
reuses the fd during that time.
Fixes: #12465
Backport: firefly, hammer
Signed-off-by: Samuel Just <sjust@redhat.com>
(cherry picked from commit 8778ab3a1c)
the first op id was 16 by default, which is okay, but a non-zero
magic number could lead to questions. max_op was mixed up with
max_ops, and changed to 16 in 51e402e3 by mistake.
Signed-off-by: Kefu Chai <kchai@redhat.com>
The rbd CLI tool no longer attempts to initialize a CephContext
and pass said context to librados since it's possible that the
structure will not be ABI compatible between rbd and librados.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Switched to context-aware NSS init/shutdown functions to avoid conflicts
with parent application. Use a reference counter to properly shutdown the
NSS crypto library when the last CephContext is destroyed. This avoids
memory leaks with the NSS library from users of librados.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>