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.
Sage Weil [Fri, 17 May 2013 03:37:05 +0000 (20:37 -0700)]
sysvinit: fix enumeration of local daemons when specifying type only
- prepend $local to the $allconf list at the top
- remove $local special case for all case
- fix the type prefix checks to explicitly check for prefixes
Fugly bash, but works!
Backport: cuttlefish, bobtail Signed-off-by: Sage Weil <sage@inktank.com> Reviewed-by: Dan Mick <dan.mick@inktank.com>
Sage Weil [Fri, 17 May 2013 01:40:29 +0000 (18:40 -0700)]
udev: install disk/by-partuuid rules
Wheezy's udev (175-7.2) has broken rules for the /dev/disk/by-partuuid/
symlinks that ceph-disk relies on. Install parallel rules that work. On
new udev, this is harmless; old older udev, this will make life better.
Fixes: #4865
Backport: cuttlefish Signed-off-by: Sage Weil <sage@inktank.com>
Sage Weil [Fri, 17 May 2013 00:58:48 +0000 (17:58 -0700)]
mon: clear pg delta after some period
If we have not pg_map updates, the delta doesn't update, and can get stuck
with the velocity right before activity stopped. This is confusing, and
can cause incorrect health warnings about in-progress recovery.
To fix this, zero the delta if there is no activity for
'mon delta reset interval' seconds.
Fixes: #5077 Signed-off-by: Sage Weil <sage@inktank.com>
Josh Durgin [Thu, 16 May 2013 22:28:40 +0000 (15:28 -0700)]
librbd: make image creation defaults configurable
Programs using older versions of the image creation functions can't
set newer parameters like image format and fancier striping.
Setting these options lets them use all the new functionality without
being patched and recompiled to use e.g. rbd_create3().
This is particularly useful for things like qemu-img, which does not
know how to create format 2 images yet.
Samuel Just [Tue, 14 May 2013 23:35:48 +0000 (16:35 -0700)]
FileJournal: adjust write_pos prior to unlocking write_lock
In committed_thru, we use write_pos to reset the header.start value in cases
where seq is past the end of our journalq. It is therefore important that the
journalq be updated atomically with write_pos (that is, under the write_lock).
The call to align_bl() is moved into do_write in order to ensure that write_pos
is adjusted correctly prior to write_bl().
Also, we adjust pos at the end of write_bl() such that pos \in [get_top(),
header.max_size) after write_bl().
Fixes: #5020 Signed-off-by: Samuel Just <sam.just@inktank.com> Reviewed-by: Sage Weil <sage@inktank.com>