Sage Weil [Wed, 22 May 2013 15:44:52 +0000 (08:44 -0700)]
osd: ping both front and back interfaces
Send ping requests to both the front and back hb addrs for peer osds. If
the front hb addr is not present, do not send it and interpret a reply
as coming from both. This handles the transition from old to new OSDs
seamlessly.
Note both the front and back rx times. Both need to be up to date in order
for the peer to be healthy.
Sage Weil [Wed, 22 May 2013 21:29:37 +0000 (14:29 -0700)]
messages/MOSDMarkMeDown: fix uninit field
Fixes valgrind warning:
==14803== Use of uninitialised value of size 8
==14803== at 0x12E7614: sctp_crc32c_sb8_64_bit (sctp_crc32.c:567)
==14803== by 0x12E76F8: update_crc32 (sctp_crc32.c:609)
==14803== by 0x12E7720: ceph_crc32c_le (sctp_crc32.c:733)
==14803== by 0x105085F: ceph::buffer::list::crc32c(unsigned int) (buffer.h:427)
==14803== by 0x115D7B2: Message::calc_front_crc() (Message.h:441)
==14803== by 0x1159BB0: Message::encode(unsigned long, bool) (Message.cc:170)
==14803== by 0x1323934: Pipe::writer() (Pipe.cc:1524)
==14803== by 0x13293D9: Pipe::Writer::entry() (Pipe.h:59)
==14803== by 0x120A398: Thread::_entry_func(void*) (Thread.cc:41)
==14803== by 0x503BE99: start_thread (pthread_create.c:308)
==14803== by 0x6C6E4BC: clone (clone.S:112)
Backport: cuttlefish Signed-off-by: Sage Weil <sage@inktank.com>
Samuel Just [Tue, 21 May 2013 22:22:56 +0000 (15:22 -0700)]
OSDMonitor: skip new pools in update_pools_status() and get_pools_health()
New pools won't be full. mon->pgmon()->pg_map.pg_pool_sum[poolid] will
implicitly create an entry for poolid causing register_new_pgs() to assume that
the newly created pgs in the new pool are in fact a result of a split
preventing MOSDPGCreate messages from being sent out.
Fixes: #4813
Backport: cuttlefish Signed-off-by: Samuel Just <sam.just@inktank.com> Reviewed-by: Sage Weil <sage@inktank.com>
Danny Al-Gaaf [Wed, 22 May 2013 15:28:06 +0000 (17:28 +0200)]
mds/Migrator.cc: fix possible dereference NULL return value
CID 716997 (#1 of 1): Dereference null return value (NULL_RETURNS)
dereference: Dereferencing a pointer that might be null "in" when
calling "MDSCacheObject::is_auth() const".
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Danny Al-Gaaf [Wed, 22 May 2013 15:25:16 +0000 (17:25 +0200)]
mds/Migrator.cc: fix possible dereference NULL return value
ID 716998 (#1 of 2): Dereference null return value (NULL_RETURNS)
dereference: Dereferencing a pointer that might be null "in" when
calling "operator <<(std::ostream &, CInode &)".
CID 716998 (#2 of 2): Dereference null return value (NULL_RETURNS)
dereference: Dereferencing a pointer that might be null "in" when
calling "MDCache::add_replica_dir(ceph::buffer::list::iterator &,
CInode *, int, std::list<Context *, std::allocator<Context *> > &)".
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Danny Al-Gaaf [Wed, 22 May 2013 15:21:59 +0000 (17:21 +0200)]
mds/Migrator.cc: fix possible dereference NULL return value
CID 716999 (#1 of 1): Dereference null return value (NULL_RETURNS)
dereference: Dereferencing a pointer that might be null "in" when
calling "CInode::put_stickydirs()".
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Danny Al-Gaaf [Wed, 22 May 2013 15:17:01 +0000 (17:17 +0200)]
mds/Migrator.cc: fix dereference NULL return value
CID 717000 (#1 of 2): Dereference null return value (NULL_RETURNS)
dereference: Dereferencing a pointer that might be null "dir" when
calling "operator <<(std::ostream &, CDir &)".
CID 717000 (#2 of 2): Dereference null return value (NULL_RETURNS)
dereference: Dereferencing a pointer that might be null "dir" when
calling "Migrator::import_reverse_unfreeze(CDir *)".
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Danny Al-Gaaf [Wed, 22 May 2013 15:06:40 +0000 (17:06 +0200)]
mds/Migrator.cc: fix possible NULL pointer dereference
Move dout() calls behind the related asserts to prevent possible NULL
pointer dereference.
CID 717001 (#1 of 1): Dereference null return value (NULL_RETURNS)
dereference: Dereferencing a pointer that might be null "diri" when calling
"operator <<(std::ostream &, CInode
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Danny Al-Gaaf [Fri, 17 May 2013 12:38:24 +0000 (14:38 +0200)]
mds/Server.cc: fix possible NULL pointer dereference
Add asserts to solve these CID issues:
CID 717002 (#1 of 2): Dereference null return value (NULL_RETURNS)
dereference: Dereferencing a pointer that might be null "dir"
when calling "CDir::lookup(std::string const &, snapid_t)".
CID 717002 (#2 of 2): Dereference null return value (NULL_RETURNS)
dereference: Dereferencing a pointer that might be null "dir"
when calling "CDir::lookup(std::string const &, snapid_t)".
CID 717003 (#1 of 2): Dereference null return value (NULL_RETURNS)
dereference: Dereferencing a pointer that might be null "dn" when
calling "operator <<(std::ostream &, CDentry &)"
CID 717003 (#2 of 2): Dereference null return value (NULL_RETURNS)
dereference: Dereferencing a pointer that might be null "straydn"
when calling "CDentry::push_projected_linkage()".
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Danny Al-Gaaf [Fri, 17 May 2013 12:15:23 +0000 (14:15 +0200)]
src/rbd.cc: silence CID COPY_PASTE_ERROR warning
CID 1021212 (#1 of 1): Copy-paste error (COPY_PASTE_ERROR)
copy_paste_error: "r" in "r = -*__errno_location()" looks like
a copy-paste error. Should it say "fd" instead?
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Danny Al-Gaaf [Wed, 22 May 2013 13:42:52 +0000 (15:42 +0200)]
mds/MDS.cc: fix dereference null return value
Fix for:
returned_null: Function "SessionMap::get_session(entity_name_t)" returns
null (checked 12 out of 14 times)
CID 739601 (#1 of 1): Dereference null return value (NULL_RETURNS)
dereference: Dereferencing a pointer that might be null
"this->sessionmap.get_session(entity_name_t::CLIENT(client.v))" when
calling "MDS::send_message_client_counted(Message *, Session *)"
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Danny Al-Gaaf [Wed, 15 May 2013 16:14:06 +0000 (18:14 +0200)]
mds/MDCache.cc: fix possible NULL pointer dereference
Assert if 'cur' is NULL.
CID 966616 (#1 of 1): Dereference null return value (NULL_RETURNS)
dereference: Dereferencing a pointer that might be null "cur" when
calling "CInode::is_dir()".
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Alex Elder [Tue, 21 May 2013 17:25:53 +0000 (12:25 -0500)]
rbd image_read.sh: test different clone object orders
An rbd clone image can be created with an object order that differs
from that of its parent. This patch adds testing for that in
qa/workunits/rbd/image_read.sh. By default, clone images will be
created with an object size twice as big as that of its parent.
For simplicity, when a clone's object order differs from its parent
the order will be either one more than or one less than that of its
parent image, meaning its object size is either double or half of
the size of objects used in the parent.
Alex Elder [Tue, 21 May 2013 15:05:03 +0000 (10:05 -0500)]
rbd image_read.sh: a few cleanups
The function boolean_toggle() in qa/workunits/rbd/image_read.sh is
defined but never used. My intentions were good though. Fix it and
use it for argument parsing.
Change the minimum supported object order so it matches what the
command line interface enforces.
Assign the initial value of TEST_CLONES from the environment if it's
available.
Change defaults to use format 2 and test clones.
Output details about the parameters of the run even if not being
verbose.
Make the order of assignment of argument variables consistent.
James Page [Tue, 21 May 2013 08:20:53 +0000 (09:20 +0100)]
Use invoke-rc.d in maintainer scripts
Upstart configurations and sysv init scripts should be started and stopped
using invoke-rc.d in maintainer scripts.
This ensures the correct behaviour across both Debian (sysv) and Ubuntu (upstart)
and in restricted environments such as schroot where start/stop of services from
maintainer scripts is normally disabled.