Commit Graph

21068 Commits

Author SHA1 Message Date
Dan Mick
e920a61521 Clarify CodingStyle with respect to tab compression of space runs
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Greg Farnum <gregory.farnum@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2012-08-31 15:47:12 -07:00
Dan Mick
fb379174bf Fix rados put from '-' (stdin)
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Mike Ryan <mike.ryan@inktank.com>
Reviewed-by: Greg Farnum <gregory.farnum@inktank.com>
Fixes: #3068
2012-08-31 15:45:24 -07:00
Sage Weil
49375a0e7c osd: pause/unpause recovery based on NORECOVER osdmap flag
Signed-off-by: Sage Weil <sage@inktank.com>
2012-08-31 15:12:38 -07:00
Sage Weil
07ad925130 osdmap: add NORECOVER flag
This will stop recovery via log catch-up and via backfill both.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-08-31 15:12:38 -07:00
Sage Weil
0a28d795bc osdmap: add NOBACKFILL flag
This will tell the OSDs to please not initiate any backfill operations.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-08-31 15:12:38 -07:00
Samuel Just
b273c376ca PG: do not update stats in ReplicaActive from info
Bug #2954

Consider the following case:

1) Primary calls share_pg_info()
2) Primary processes client op and sends off sub_op to replica
3) Replica process sub_op
4) Replica process info reverting stat to before 2)

Similarly:

1) Primary processes client op
2) Primary calls share_pg_info()
3) Replica processes info
[4) Replica processes sub_op]

If 4) is interrupted by a map change, we can end up in a case there
the replica's info has a stat which reflects a log entry which
is not there.  If that logs ends up authoratative, the most recent
op will be replayed and end up double counted in the log.

There should actually be no cases where the stats change after the
replica goes active except for as part of a sub_op_modify.  Thus,
ReplicaActive::MInfoRec should not update the stats.

Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-08-31 14:43:48 -07:00
caleb miles
5ac52de003 crushtool: Miscellaneous cleanup.
Clean up the output messages; add some function documentation and some
unit tests.

Signed-off-by: caleb miles <caleb.miles@inktank.com>
2012-08-31 13:20:30 -07:00
Samuel Just
fd4d567bf9 osd/osd_types.h: fix pg_history_t::merge copy paste error
CID 716882: Copy-paste error (COPY_PASTE_ERROR)At (2): "last_epoch_started" in
"other.last_epoch_started" looks like a copy-paste error. Should it say
"last_epoch_split" instead?

From what I can tell, this really should be checking other.last_epoch_split
rather than other.last_epoch_started.

Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-08-31 13:11:36 -07:00
Samuel Just
84216d595e osd/Watch.h: uninit var in ctor Watch
CID 717345: Uninitialized pointer field (UNINIT_CTOR)At (8): Non-static class
member "obc" is not initialized in this constructor nor in any functions that
it calls.
At (2): Non-static class member "id" is not initialized in this constructor nor
in any functions that it calls.
At (4): Non-static class member "reply" is not
initialized in this constructor nor in any functions that it calls.
At (6): Non-static class member "timeout" is not initialized in this
constructor nor in any functions that it calls.

Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-08-31 13:11:36 -07:00
Samuel Just
75acb7bd6c osd/ReplicatedPG.h: uninit var in ctor RepModify
CID 717344: Uninitialized scalar field (UNINIT_CTOR)At (2): Non-static class
member "epoch_started" is not initialized in this constructor nor in any
functions that it calls.

Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-08-31 13:11:36 -07:00
Samuel Just
0e2efbc8d9 osd/ReplicatedPG.h: uninit var in ctor OpContext
CID 717343: Uninitialized pointer field (UNINIT_CTOR)At (3): Non-static class
member "snapset" is not initialized in this constructor nor in any functions
that it calls.

Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-08-31 13:11:36 -07:00
Samuel Just
f30facab99 osd/ReplicatedPG: pass PGPool to ReplicatedPG ctor by ref
CID 717057: Big parameter passed by value (PASS_BY_VALUE)At (1): Passing
parameter _pool of type PGPool (size 336 bytes) by value.

Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-08-31 13:11:36 -07:00
Samuel Just
6fbf9e6fd2 osd/PG.h: uninit var in ctor NamedState
CID 717340: Uninitialized pointer field (UNINIT_CTOR)At (2): Non-static class
member "state_name" is not initialized in this constructor nor in any functions
that it calls.

Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-08-31 13:11:36 -07:00
Samuel Just
471787f1ea osd/PG.h: uninit var in ctor OndiskLog
CID 717342: Uninitialized scalar field (UNINIT_CTOR)At (2): Non-static class
member "has_checksums" is not initialized in this constructor nor in any
functions that it calls.

Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-08-31 13:11:36 -07:00
Samuel Just
f84e776442 osd/PG.h: uninit var in ctor IndexedLog
CID 717339: Uninitialized scalar field (UNINIT_CTOR)At (2): Non-static class
member "last_requested" is not initialized in this constructor nor in any
functions that it calls.

Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-08-31 13:11:36 -07:00
Samuel Just
106367356e osd/PG.cc: PG constructor pass PGPool by reference
CID 717053: Big parameter passed by value (PASS_BY_VALUE)At (1): Passing
parameter _pool of type PGPool (size 336 bytes) by value.

Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-08-31 13:11:36 -07:00
Samuel Just
9a93eb3295 osd/OpRequest.h: uninit vars in ctor OpRequest
At (2): Non-static class member "hit_flag_points" is not initialized in this
constructor nor in any functions that it calls.  CID 717338: Uninitialized
scalar field (UNINIT_CTOR)At (4): Non-static class
member "latest_flag_point" is not initialized in this constructor nor in any
functions that it calls.

Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-08-31 13:11:36 -07:00
Samuel Just
d41c253bea osd/OSDMap.cc: uninit vars in ctor struct qi
CID 717337: Uninitialized scalar field (UNINIT_CTOR)At (6): Non-static class
member "weight" is not initialized in this constructor nor in any functions
that it calls.

Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-08-31 13:11:36 -07:00
Samuel Just
d2356261a2 osd/OSD.h: big parameter passed by value, publish_superblock
CID 717051: Big parameter passed by value (PASS_BY_VALUE)At (1): Passing
parameter block of type OSDSuperblock (size 232 bytes) by value.

Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-08-31 13:11:36 -07:00
Samuel Just
db9e1209c9 osd/OSD.cc: OSD::shutdown() leaks lock
CID 716952: Missing unlock (LOCK)At (48): Returning without unlocking
"this->osd_lock._m".

Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-08-31 13:11:36 -07:00
Samuel Just
b041260799 osd/ClassHandler.cc: uninit var in ctor
CID 717336: Uninitialized pointer field (UNINIT_CTOR)At (2): Non-static class
member "handler" is not initialized in this constructor nor in any functions
that it calls.

Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-08-31 13:11:35 -07:00
Samuel Just
e0b8cb7c15 osd/ClassHandler: uninit var in ctor
CID 717335: Uninitialized scalar field (UNINIT_CTOR)At (2): Non-static class
member "flags" is not initialized in this constructor nor in any functions that
it calls.

Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-08-31 13:11:35 -07:00
Sage Weil
50ed1fcad5 monclient: uninit var in ctor
CID 717328: Uninitialized scalar field (UNINIT_CTOR) [select defect]
At (2): Non-static class member "newest" is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-08-31 13:11:35 -07:00
Sage Weil
0b4ddc2727 mon/MonitorStore: uninit var in ctor
CID 717329: Uninitialized scalar field (UNINIT_CTOR)
At (2): Non-static class member "lock_fd" is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-08-31 13:11:35 -07:00
Sage Weil
89add0f770 paxos: init vars in ctr
At (2): Non-static class member "latest_stashed" is not initialized in this constructor nor in any functions that it calls.
At (4): Non-static class member "num_last" is not initialized in this constructor nor in any functions that it calls.
At (6): Non-static class member "uncommitted_v" is not initialized in this constructor nor in any functions that it calls.
CID 717330: Uninitialized scalar field (UNINIT_CTOR)
At (8): Non-static class member "uncommitted_pn" is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-08-31 13:11:35 -07:00
Sage Weil
ea078e1872 msg/DispatchQueue: simplify shutdown()
lcok isn't held during dispatch, so we can take it unconditionally.  THis
also makes coverity happier:

CID 716966: Data race condition (MISSING_LOCK)
At (4): Accessing "this->stop" ("DispatchQueue.stop") requires the "Mutex._m" lock.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-08-31 13:11:35 -07:00
Sage Weil
b7af8d8bb0 msg/Message: fix possible null deref
cct may be null

CID 716930: Dereference after null check (FORWARD_NULL)
At (11): Dereferencing null pointer "cct".

Signed-off-by: Sage Weil <sage@inktank.com>
2012-08-31 13:11:35 -07:00
Sage Weil
650ec35b08 msg: pass by reference
CID 717048: Big parameter passed by value (PASS_BY_VALUE)
At (1): Passing parameter a of type entity_addr_t (size 136 bytes) by value.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-08-31 13:11:35 -07:00
Sage Weil
a3bf558ab8 fix accepter bind fix 2012-08-31 13:11:35 -07:00
Sage Weil
4eb31463e9 msg/Accepter: move nonce init to ctor
This was suggested by Greg too but I was too lazy.

CID 717331: Uninitialized scalar field (UNINIT_CTOR)
At (2): Non-static class member "nonce" is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-08-31 13:11:35 -07:00
Sage Weil
46c08d6c28 log: protect m_stop with lock
CID 716965: Data race condition (MISSING_LOCK)
At (2): Accessing "this->m_stop" ("_ZN4ceph3log3LogE.m_stop") requires the "_ZN4ceph3log3LogE.m_queue_mutex" lock.

This isn't strictly needed since we assume only one thread will call this
method and start a thead, but it makes coverity happy.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-08-31 13:11:35 -07:00
Sage Weil
f51f568551 common/LogEntry: pass by value for contains()
CID 717031: Big parameter passed by value (PASS_BY_VALUE)
At (1): Passing parameter k of type LogEntryKey (size 168 bytes) by value.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-08-31 13:11:35 -07:00
Sage Weil
929892fe56 LogEntry: pass by reference
CID 717030: Big parameter passed by value (PASS_BY_VALUE)
At (1): Passing parameter w of type entity_inst_t (size 152 bytes) by value.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-08-31 13:11:35 -07:00
Sage Weil
ec5133b09c msg/Pipe: make banner buffer slightly bigger
CID 717023: Out-of-bounds access (OVERRUN_DYNAMIC)
At (4): Allocating insufficient memory for the terminating null of the string.

This appears to be a false positive (we don't interpret the buffer as a
string, ever), but it will make coverity happier.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-08-31 13:11:35 -07:00
Sage Weil
b960c6238c librbd: fix delete[]
CID 716902: Non-array delete for scalars (DELETE_ARRAY)
At (15): Deleting array variable "buf" with non-array delete in "delete buf".

Signed-off-by: Sage Weil <sage@inktank.com>
2012-08-31 13:11:35 -07:00
Sage Weil
08a29f9387 ceph-dencoder: don't leak object
Signed-off-by: Sage Weil <sage@inktank.com>
2012-08-31 13:11:35 -07:00
Sage Weil
7cb3d2e455 auth: fix uninit vars
Signed-off-by: Sage Weil <sage@inktank.com>
2012-08-31 13:11:34 -07:00
Sage Weil
3fd13f57ed crypto: fix fd leak from get_random_bytes()
Signed-off-by: Sage Weil <sage@inktank.com>
2012-08-31 13:11:34 -07:00
Sage Weil
1b1a0bf60a msg/Accepter: check setsockopt return value
CCID 716856: Other violation (CHECKED_RETURN)
At (7): Calling function "setsockopt(this->listen_sd, 1, 2, &on, 4U)" without checking return value. This library function may fail and return an error code.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-08-31 13:11:34 -07:00
Sage Weil
484fd0c0ec mds: fix broken EMetablob inode_t* return value
We pass this back to the caller, but it points to a member that is never
looked at, because the inode has already been encoded.  In effect this
wasn't journaling anything useful, and the only user questioned whether it
was needed, so let's rip it out.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-08-31 13:11:34 -07:00
Sage Weil
139ba9f321 client: unconditional teardown
CID 717125: Dereference before null check (REVERSE_INULL)
At (2): Null-checking "this->objectcacher" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-08-31 13:11:34 -07:00
Sage Weil
532d1b10d6 rgw: init RGWRados::cct in ctor
Coverity cid 717382
Signed-off-by: Sage Weil <sage@inktank.com>
2012-08-31 13:11:34 -07:00
Sage Weil
c67eda26e5 rgw: init RGWGetObj::sent_header in ctor
Coverity cid 717383
Signed-off-by: Sage Weil <sage@inktank.com>
2012-08-31 13:11:05 -07:00
Sage Weil
757457ad21 rgw: init ptr
Coverity cid 717384
Signed-off-by: Sage Weil <sage@inktank.com>
2012-08-31 13:11:05 -07:00
Sage Weil
ca4e0607ef rgw: add missing ctor, init parent
Coverity cid 717385
Signed-off-by: Sage Weil <sage@inktank.com>
2012-08-31 13:11:04 -07:00
Sage Weil
2214e83851 omap_bench: fix uninit var
Coverity cid 717386
Signed-off-by: Sage Weil <sage@inktank.com>
2012-08-31 13:11:04 -07:00
Sage Weil
20372126d9 test/osd/RadosModel: uninit value
Coverity cid 717388 717387
Signed-off-by: Sage Weil <sage@inktank.com>
2012-08-31 13:11:04 -07:00
Sage Weil
26a822bc7d test/osd/RadosModel: fix uninit value
Coverity cid 717389
Signed-off-by: Sage Weil <sage@inktank.com>
2012-08-31 13:11:04 -07:00
Sage Weil
7c10bdc3a5 test/osd/RadosModel: fix uninit values
Coverity cid 717390
Signed-off-by: Sage Weil <sage@inktank.com>
2012-08-31 13:11:04 -07:00
Sage Weil
8d9d4f6154 test/osd/RadosModel: fix uninit ptr
Coverity cid 717391
Signed-off-by: Sage Weil <sage@inktank.com>
2012-08-31 13:11:04 -07:00