ID 717092: Resource leak (RESOURCE_LEAK)At (40): Handle variable "r" going out
of scope leaks the handle.
Signed-off-by: Samuel Just <sam.just@inktank.com>
CID 717088: Resource leak (RESOURCE_LEAK)At (11): Handle variable "tmpfd" going
out of scope leaks the handle.
Signed-off-by: Samuel Just <sam.just@inktank.com>
CID 716861: Other violation (CHECKED_RETURN)At (3): Calling function "lseek(fd,
off, 0)" without checking return value. This library function may fail and
return an error code.
CID 717090: Resource leak (RESOURCE_LEAK)At (10): Handle variable "fd" going
out of scope leaks the handle.
Signed-off-by: Samuel Just <sam.just@inktank.com>
CID 717091: Resource leak (RESOURCE_LEAK)At (39): Handle variable "fd" going
out of scope leaks the handle.
Signed-off-by: Samuel Just <sam.just@inktank.com>
CID 716863: Other violation (CHECKED_RETURN)At (20): Calling function
"fstat(basedir_fd, &basest)" without checking return value. This library
function may fail and return an error code.
Signed-off-by: Samuel Just <sam.just@inktank.com>
CID 717333: Uninitialized pointer field (UNINIT_CTOR)At (2): Non-static class
member "aio_ctx" is not initialized in this constructor nor in any functions
that it calls.
Signed-off-by: Samuel Just <sam.just@inktank.com>
CID 717332: Uninitialized pointer field (UNINIT_CTOR)At (12): Non-static class
member field "iocb.aio_fildes" is not initialized in this constructor nor in
any functions that it calls.
Signed-off-by: Samuel Just <sam.just@inktank.com>
CID 716859: Other violation (CHECKED_RETURN)At (1): Calling function
"lseek64(this->fd, pos, 0)" without checking return value. This library
function may fail and return an error code.
Signed-off-by: Samuel Just <sam.just@inktank.com>
CID 717016: Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)At (1):
Potentially overflowing expression "g_conf->osd_max_write_size << 20" with type
"int" (32 bits, signed) is evaluated using 32-bit arithmetic before being used
in a context which expects an expression of type "int64_t" (64 bits, signed).
To avoid overflow, cast the left operand to "int64_t" before performing the
left shift.
Signed-off-by: Samuel Just <sam.just@inktank.com>
CID 717087: Resource leak (RESOURCE_LEAK)At (16): Variable "buf" going out of
scope leaks the storage it points to.
Signed-off-by: Samuel Just <sam.just@inktank.com>
CID 716897: Logically dead code (DEADCODE)At (5): Execution cannot reach this
statement "return r;".
The outer r was shadowed. Instead, just return the error code from the
loop.
Signed-off-by: Samuel Just <sam.just@inktank.com>
CID 717346: Uninitialized scalar field (UNINIT_CTOR)At (2): Non-static class
member "epoch_sent" is not initialized in this constructor nor in any functions
that it calls.
Signed-off-by: Samuel Just <sam.just@inktank.com>
hoid.hash is uninitialized, and should not be used to
initialize hoid.hash.
CID 717200: Uninitialized scalar variable (UNINIT)At (9): Using uninitialized
value "hoid.hash" when calling "hobject_t::hobject_t(object_t, std::string
const &, snapid_t, uint64_t, int64_t)".
Signed-off-by: Samuel Just <sam.just@inktank.com>
CID 716943: Using invalid iterator (INVALIDATE_ITERATOR)At (27): Dereferencing
iterator "p" though it is already past the end of its container.
The assert ensures that p will not be dereferenced if invalid.
Signed-off-by: Samuel Just <sam.just@inktank.com>
CID 728001: Uninitialized scalar field (UNINIT_CTOR)At (2): Non-static class
member "epoch_start" is not initialized in this constructor nor in any
functions that it calls.
Signed-off-by: Samuel Just <sam.just@inktank.com>
CID 717052: Big parameter passed by value (PASS_BY_VALUE)At (1): Passing
parameter pi of type entity_inst_t (size 152 bytes) by value.
Signed-off-by: Samuel Just <sam.just@inktank.com>
CID 727987: Not restoring ostream format (STREAM_FORMAT_STATE)At (5): Changing
format state of stream "out" for category precision without later restoring it.
Signed-off-by: Samuel Just <sam.just@inktank.com>
CID 717050: Big parameter passed by value (PASS_BY_VALUE)At (1): Passing
parameter i of type entity_inst_t (size 152 bytes) by value.
Signed-off-by: Samuel Just <sam.just@inktank.com>
When starting a MDS that was stopped cleanly, we need manually
adjust mydir's auth. This is because MDS log is empty in this case,
mydir's auth can not be adjusted during log replay.
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
is_any_state() should return false when the by_state list is empty.
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Signed-off-by: Sage Weil <sage@inktank.com>
CID 717098: Resource leak (RESOURCE_LEAK)
At (6): Variable "device_dir" going out of scope leaks the storage it
points to.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
CID 717083: Resource leak (RESOURCE_LEAK)
At (3): Variable "str" going out of scope leaks the storage it points
to.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
CID 716911: Dereference after null check (FORWARD_NULL)
At (5): Passing null pointer "b" to function "strncat(char *, char
const *, size_t)", which dereferences it. (The dereference is assumed
on the basis of the 'nonnull' parameter attribute.)
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
CID 717219: Uninitialized pointer field (UNINIT_CTOR)
At (14): Non-static class member "objecter" is not initialized in this
constructor nor in any functions that it calls.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
CID 717444: Explicit null dereferenced (FORWARD_NULL)
At (48): Passing null pointer "devpath" to function
"do_kernel_rm(char const *)", which dereferences it.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
r was not being set in the loop.
CID 716936: Infinite loop (INFINITE_LOOP)
At (1): Top of the loop.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Order is never actually this high currently, but it be via librbd.
CID 716937: Overflowed return value (INTEGER_OVERFLOW)
At (3): Overflowed or truncated value (or a value computed from an
overflowed or truncated value) "offset" used as return value.
CID 717012: Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)
At (1): Potentially overflowing expression "1 << obj_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.
CID 717011: Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)
At (1): 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.
CID 717013: Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)
At (1): 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: Josh Durgin <josh.durgin@inktank.com>
CID 717226: Uninitialized scalar field (UNINIT_CTOR)
At (2): Non-static class member "cookie" is not initialized in this
constructor nor in any functions that it calls.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
CID 717225: Uninitialized pointer field (UNINIT_CTOR)
At (2): Non-static class member "m_req" is not initialized in this
constructor nor in any functions that it calls.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
CID 717224: Uninitialized scalar field (UNINIT_CTOR)
At (26): Non-static class member field "header.snaps" is not
initialized in this constructor nor in any functions that it calls.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
CID 717222: Uninitialized pointer field (UNINIT_CTOR)
At (16): Non-static class member "m_hide_enoent" is not initialized
in this constructor nor in any functions that it calls.
CID 717223: Uninitialized scalar field (UNINIT_CTOR)
At (4): Non-static class member "m_has_parent" is not initialized in
this constructor nor in any functions that it calls.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
CID 717220: Uninitialized pointer field (UNINIT_CTOR)
At (4): Non-static class member "aio_type" is not initialized in this
constructor nor in any functions that it calls.
CID 717221: Uninitialized pointer field (UNINIT_CTOR)
At (2): Non-static class member "m_req" is not initialized in this
constructor nor in any functions that it calls.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
The README provides a list of packages needed to successfully
configure ceph. uuid-dev and libatomic-ops-dev are missing from
the list.
Signed-off-by: Sam Lang <sam.lang@inktank.com>