CID 1019559 (#1 of 1): Dereference after null check (FORWARD_NULL)
var_deref_model: Passing null pointer "usr" to function
"RGWUser::get_store()", which dereferences it.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Assert if straydn is NULL.
CID 1019554 (#2 of 2): Dereference after null check (FORWARD_NULL)
var_deref_model: Passing null pointer "straydn" to function
"MDSCacheObject::is_auth() const", which dereferences it.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Assert of straydn is NULL here.
CID 1019558 (#1 of 1): Dereference after null check (FORWARD_NULL)
var_deref_model: Passing null pointer "straydn" to function
"CDentry::get_dir() const", which dereferences it.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Assert if destdn == NULL.
CID 1019557 (#1 of 1): Dereference after null check (FORWARD_NULL)
var_deref_model: Passing null pointer "destdn" to function
"CDentry::get_dir() const", which dereferences it.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Add missing Lock around code changing AioCompletionImpl::rval/ack and safe
in C_AioCompleteAndSafe::finish().
CID 1019565 (#1 of 1): Data race condition (MISSING_LOCK)
missing_lock: Accessing "this->c->rval" ("_ZN8librados17AioCompletionImplE.rval")
requires the "Mutex._m" lock.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CID 1019545 (#1 of 1): Unchecked return value (CHECKED_RETURN)
check_return: Calling function "ObjectStore::list_collections
(std::vector<coll_t, std::allocator<coll_t> > &)" without
checking return value (as is done elsewhere 5 out of 6 times).
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CID 1019555 (#1 of 1): Dereference after null check (FORWARD_NULL)
var_deref_model: Passing null pointer "in" to function
"Server::_need_force_journal(CInode *, bool)", which dereferences it.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CID 1019568 (#1 of 1): Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)
overflow_before_widen: Potentially overflowing expression "1 << *order" with
type "int" (32 bits, signed) is evaluated using 32-bit arithmetic before being
used in a context which expects an expression of type "uint64_t" (64 bits,
unsigned). To avoid overflow, cast the left operand to "uint64_t" before
performing the left shift.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CID 1019623 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
uninit_member: Non-static class member "timecheck_acks" is not
initialized in this constructor nor in any functions that it calls.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CID 1019624 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
uninit_member: Non-static class member "crc" is not initialized
in this constructor nor in any functions that it calls.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CID 1019626 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
uninit_member: Non-static class member "flags" is not initialized
in this constructor nor in any functions that it calls.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CID 1019635 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)
uninit_member: Non-static class member "kt" is not initialized in
this constructor nor in any functions that it calls.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CID 717123 (#1-2 of 2): Resource leak (RESOURCE_LEAK)
leaked_storage: Variable "buf" going out of scope leaks the storage
it points to.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CID 717122 (#1 of 1): Resource leak (RESOURCE_LEAK)
leaked_handle: Handle variable "fd" going out of scope leaks
the handle.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CID 717121 (#1 of 1): Resource leak (RESOURCE_LEAK)
leaked_handle: Handle variable "fd" going out of scope leaks the handle.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CID 716885 (#1 of 1): Resource leak in object (CTOR_DTOR_LEAK)
alloc_new: Allocating memory by calling "new C_SafeCond(&this->lock,
&this->cond, &this->done, NULL)".
ctor_dtor_leak: The constructor allocates field "c" of "C_Sync" but
the destructor and whatever functions it calls do not free it.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CID 719581 (#7 of 7): Resource leak (RESOURCE_LEAK)
CID 719581 (#6 of 7): Resource leak (RESOURCE_LEAK)
leaked_storage: Variable "pools" going out of scope leaks the
storage it points to.
CID 719582 (#6-7 of 7): Resource leak (RESOURCE_LEAK)
leaked_storage: Variable "children" going out of scope leaks
the storage it points to.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Make sure rados_shutdown() get called also in error case.
CID 717106 (#1 of 1): Resource leak (RESOURCE_LEAK)
leaked_storage: Variable "cl" going out of scope leaks the
storage it points to.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CID 727984 (#5 of 5): Resource leak (RESOURCE_LEAK)
leaked_storage: Variable "cb_args" going out of scope leaks the storage
it points to.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CID 717107 (#1 of 1): Resource leak (RESOURCE_LEAK)
leaked_storage: Variable "store" going out of scope leaks the
storage it points to.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CID 1019589 (#1 of 1): Resource leak (RESOURCE_LEAK)
leaked_storage: Variable "t" going out of scope leaks the
storage it points to.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CID 1019590 (#1 of 1): Resource leak (RESOURCE_LEAK):
leaked_storage: Variable "rmt" going out of scope leaks the
storage it points to.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
The condition was reversed. Rewrite it so it's clear that we're
ignoring -ENOENT only when m_ignore_enoent is set.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
It is often useful to prepare but not activate a device, for example when
preparing a bunch of spare disks. This marks a device as 'do not
activate' so that it can be prepared without activating.
Fixes: #3255
Signed-off-by: Sage Weil <sage@inktank.com>
Since snapshots never change, it's safe to read from replicas for them.
A common use for this would be reading from a parent snapshot shared by
many clones.
Convert LibrbdWriteback and AioRead to use the ObjectOperation api
so we can set flags. Fortunately the external wrapper holds no data,
so its lifecycle doesn't need to be managed.
Include a simple workunit that sets the flags in various combinations
and looks for their presence in the logs from 'rbd export'.
Fixes: #3064
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
These need to apply to the entire ObjectOperation, not just a subop,
so use a new enum and a new aio_operate() call that takes them.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
This will allow it to be used with general aio_operate() so we don't have
to add new versions of each operation when we want to add new per-op
arguments, like flags, namespaces, or explicit snapshot contexts/ids.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
This will be used when exposing an ObjectOperation version of sparse_read()
to the librados user, and there's no reason to duplicate code for creating
and handling it. Add a wrapper Context for handling the lifecycle of the
::ObjectOperation.
This cleans up the synchronous version of sparse_read quite a bit by
using the general operate_read() instead of duplicating decoding and
a bunch of sync boilerplate.
Move handling the decoding of a sparse_read into the Objecter, with
the rest of the decoding of rados operations. librados shouldn't be
the only user of the Objecter that can understand sparse_reads.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
r is just a local variable, changing it has no effect.
Set the per-operation return value if provided when a decoding
error occurs.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Some plana have non-world-readable crap in /usr/local/samba. Avoid
/usr/local entirely for that and any similar landmines.
Signed-off-by: Sage Weil <sage@inktank.com>
Fix try_stop_deletion(): The comment above the while loop says "If we are
in DELETING_DIR or DELETED_DIR", but the while loop checks for DELETING_DIR
twice. Change one check to DELETED_DIR otherwise on state get missed.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>