test/objectstore/store_test.cc: prefer ++operators for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
MDCache.h: init 'umaster::safe' in constructor

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
MDCache.cc: init 'umaster::ls' with NULL in contructor

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
test/libradosstriper/striping.cc: fix potential memory leak

Fix for:
[src/test/libradosstriper/striping.cc:138]: (error) Allocation with
 getObjName, stat doesn't release it

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
rgw/rgw_rados.h: use static_cast instead of c-style cast

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
RadosStriperImpl.cc: catch exception by reference

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
libcephfs/test.cc: fix use after free

Don't call ceph_shutdown() after ceph_release().

CID 1219651 (#1 of 1): Use after free (USE_AFTER_FREE)
  17. deref_arg: Calling ceph_shutdown dereferences freed
  pointer cmount.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
scratchtool.c: fix resource leak

CID 1219612 (#1 - 3): Resource leak (RESOURCE_LEAK)
 leaked_storage: Variable iter going out of scope leaks the
 storage it points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
scratchtool.c: fix resource leak and error handling

Check the result of rados_ioctx_create()before using io_ctx.
Free io_ctx where needed. Fix messages at the end of testrados().

CID 1219613 (#1 of 1): Resource leak (RESOURCE_LEAK)
 leaked_storage: Variable io_ctx going out of scope leaks the
 storage it points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
mount.ceph.c: fix strdup related memory leak

CID 1219611 (#1 - 5): Resource leak (RESOURCE_LEAK)
 leaked_storage: Variable saw_name going out of scope
 leaks the storage it points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
common/fd.cc: fix possible out-of-bounds write

Read max 'sizeof(target) - 1' to not write out of bound
later on the 'target[r] = 0;' call in case we read the
full PATH_MAX.

CID 1128416 (#1 of 1): Out-of-bounds write (OVERRUN)
 overrun-local: Overrunning array target of 4096 bytes
 at byte offset 4096 using index r (which evaluates to 4096).

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
mds: set xattr_version to 0 if replay doesn't contain xattrs

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Merge pull request #2030 from ceph/wip-xattr-fix

mds: set xattr_version to 0 if replay doesn't contain xattrs

Reviewed-by: Sage Weil <sage@redhat.com>
Added a couple of ASSERTS for avoiding coverity to complain about the possibility of a division by 0

Signed-off-by: Sebastien Ponce <sebastien.ponce@cern.ch>
Fixed build on 32 bits platforms

Signed-off-by: Sebastien Ponce <sebastien.ponce@cern.ch>
Merge pull request #2032 from sponce/wip-fixstriperoni386

Wip fixstriperoni386

Reviewed-by: Sage Weil <sage@redhat.com>
osd: fix pg_interval_t int -> int32_t

Still 4 bytes on i386 and x86_64.

Signed-off-by: Sage Weil <sage@inktank.com>
osd: fix pg_shard_t int -> int32_t

Still 4 bytes on i386 and x86_64.

Signed-off-by: Sage Weil <sage@inktank.com>
osd: fix pg_stat_t int -> int32_t

Still 4 bytes on i386 and x86_64.

Signed-off-by: Sage Weil <sage@inktank.com>
scratchtool.c: cleanup do_rados_getxattrs()

Cleanup error path to reduce code duplication.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>