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>
C_aio_sparse_read_Ack's members are filled in by the only caller
immediately after construction, so make them arguments to the
constructor.
CID 717218: Uninitialized pointer field (UNINIT_CTOR)
At (4): Non-static class member "m" is not initialized in this
constructor nor in any functions that it calls.
WatchContext: these variables are unused, so remove them.
CID 717217: Uninitialized scalar field (UNINIT_CTOR)
At (4): Non-static class member "ver" is not initialized in this
constructor nor in any functions that it calls.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
PG_STATE_BACKFILL->PG_STATE_BACKFILL_WAIT
and
PG_STATE_BACKFILLING->PG_STATE_BACKFILL
backfill -> wait_backfill
backfill+backfilling -> backfill
Signed-off-by: Samuel Just <sam.just@inktank.com>
Also adds backwards compatibility by just post_event-ing
the RemoteBackfillReserved() rather than sending the
message to an older replica.
Signed-off-by: Samuel Just <sam.just@inktank.com>
PG_STATE_BACKFILLING is set when the pg enters the Backfilling state.
That is, +backfilling indicates that the pg has obtained its
reservations and is now actively backfilling.
Signed-off-by: Samuel Just <sam.just@inktank.com>
Previously, a new osd would be bombarded by backfills from many osds
simultaneously, resulting in excessively high load. Instead, we
want to limit the number of backfills coming into and going out
from a single osd.
To that end, each OSDService now has two AsyncReserver instances: one
for backfills going from the osd (local_reserver) and one for backfills
going to the osd (remote_reserver). For a primary to initiate a
backfill, it must first obtain a reservation from its own
local_reserver. Then, it must obtain a reservation from the backfill
target's remote_reserver via a MBackfillReserve message. This process is
managed by substates of Active and ReplicaActive (see the changes in
PG.h). The reservations are dropped either on the Backfilled event,
which is sent on the primary before calling recovery_complete and on the
replica on receipt of the BackfillComplete progress message), or upon
leaving Active or ReplicaActive.
It's important that we always grab the local reservation before the
remote reservation in order to prevent a circular dependency.
Signed-off-by: Samuel Just <sam.just@inktank.com>
Fortunately we never used the -m option.
CID 716962: Missing break in switch (MISSING_BREAK)
At (1): This case (value 109) is not terminated by a 'break'
statement. # (use "git add <file>..." to update what will be
committed)
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
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.
Signed-off-by: Josh Durgin <josh.durgin@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>