cls_rgw_client.cc: fix potential null pointer deref

Fix for:

CID 1054853 (#1 of 1): Dereference before null check (REVERSE_INULL)
 check_after_deref: Null-checking is_truncated suggests that it may
 be null, but it has already been dereferenced on all paths leading
 to the check.

Add vim line to file.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
arch/neon.c: check result of fread()

Fix for:

CID 1128384 (#1 of 1): Ignoring number of bytes read (CHECKED_RETURN)
 check_return: fread(void * restrict, size_t, size_t, FILE * restrict)
 returns the number of bytes read, but it is ignored.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
rgw/rgw_formats.cc: fix realloc memory leak

Fix handling of realloc. If realloc() fails it returns NULL, assigning
the return value of realloc() directly to the pointer without checking
for the result will lead to a memory leak in error case.

Use a temporary pointer to hold the result of realloc(). In error case
print error and exit, otherwise assign it to the pointer we want to realloc.

Fix also error checks for malloc to fail as soon as malloc fails and
don't try to run realloc again after failed malloc.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
msg/async/Event.cc: use static_cast instead of c-style cast

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

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

Fix memory leak caused by using std::string to hold result
of strdup call returned from getObjName().

Fix for Coverity issues:

CID 1221525 (#1 of 1): Resource leak (RESOURCE_LEAK)
 leaked_storage: Failing to save or free storage allocated by
 this->getObjName(soid, 0UL) leaks it.

CID 1221526 (1-3 of 3): Resource leak (RESOURCE_LEAK)
 leaked_storage: Failing to save or free storage allocated by
 this->getObjName(soid, *) leaks it.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
test/librbd/fsx.c: fix indentation (NESTING_INDENT_MISMATCH)

Fix indentation to the same as the original fsx.c .

Fix for Coverity issue:

CID 1219473 (#1-2 of 2): Nesting level does not match indentation
(NESTING_INDENT_MISMATCH)
 uncle: This statement is indented to column 25, as if it were
 nested within the preceding parent statement, but it is not.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Merge branch 'wip-da-SCA-20141025'

Reviewed-by: Sage Weil <sage@redhat.com>
rgw_rest_client.cc: remove self assignment of new_info.effective_uri

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Reviewed-by: Yehuda Sadeh <yehuda@redhat.com>
Merge pull request #2630 from ceph/wip-9545

os/FileStore: do not loop in sync_entry on shutdown

Reviewed-by: Samuel Just <sam.just@inktank.com>
doc/release-notes: giant notes

Signed-off-by: Sage Weil <sage@redhat.com>
Merge remote-tracking branch 'gh/giant'

Conflicts:
	src/test/common/test_shared_cache.cc
unittest_shared_cache: fix build line

Signed-off-by: Sage Weil <sage@redhat.com>
Merge pull request #2802 from dachary/wip-mailmap

mailmap: Federico Gimenez affiliation

Reviewed-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
init-ceph: make ./init-ceph behave from src dir on systemd

Signed-off-by: Sage Weil <sage@redhat.com>
client: fix I_COMPLETE_ORDERED checking

Current code marks a directory inode as complete and ordered when readdir
finishes, but it does not check if the directory was modified in the middle
of readdir. This is wrong, directory inode should not be marked as ordered
if it was modified during readddir

The fix is introduce a new counter to the inode data struct, we increase
the counter each time the directory is modified. When readdir finishes, we
check the counter to decide if the directory should be marked as ordered.

Fixes: #9894
Signed-off-by: Yan, Zheng <zyan@redhat.com>
client: cast m->get_client_tid() to compare to 16-bit Inode::flushing_cap_tid

m->get_client_tid() is 64 bits (as it should be), but Inode::flushing_cap_tid
is only 16 bits. 16 bits should be plenty to let the cap flush updates
pipeline appropriately, but we need to cast in the proper direction when
comparing these differently-sized versions. So downcast the 64-bit one
to 16 bits.

Fixes: #9869
Backport: giant, firefly, dumpling

Signed-off-by: Greg Farnum <greg@inktank.com>
remove ceph_dupstore

This is broken and useless.

Signed-off-by: Sage Weil <sage@redhat.com>
osd, filestore: move convertfs into FileStore

There is no reason for this level of detail to be exposed to the OSD.

There is one significant change here: we are not touching the SnapMapper
in the FileStore collection removal.  This is, most likely, fixing a bug.

Signed-off-by: Sage Weil <sage@redhat.com>
osd, filestore: mount in upgrade() caller

Signed-off-by: Sage Weil <sage@redhat.com>