mon: Monitor: fix potential null-pointer dereference

CID 717443: Dereference after null check (FORWARD_NULL)
At (14): Passing null pointer "detailbl" to function
"ceph::buffer::list::append(std::string const &)", which dereferences it.


Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
mon: Monitor: unlock before returning

CID 716947 (#1 of 2): Missing unlock (LOCK)
CID 716947 (#2 of 2): Missing unlock (LOCK)
At (25): Returning without unlocking "this->lock._m".

There were a couple of cases in Monitor::init() that could lead us to
return without properly unlocking. Coverity gets mad props for uncovering
this.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
mon: LogMonitor: check return value when writing to file

CID 716851: Unchecked return value (CHECKED_RETURN)
At (51): Calling function "ceph::buffer::list::write_fd(int) const"
without checking return value.


Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
mon: AuthMonitor: check return values

CID 716850: Unchecked return value (CHECKED_RETURN)
At (14): Calling function "KeyServer::get_auth(EntityName const &,
EntityAuth &) const" without checking return value.

CID 716849: Unchecked return value (CHECKED_RETURN)
At (14): Calling function "EntityName::from_str(std::string const &)"
without checking return value.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
mon: MonitorStore: check return value for errors on 'open'

CID 728083: Argument cannot be negative (NEGATIVE_RETURNS)
At (22): "dirfd" is passed to a parameter that cannot be negative.
At (29): "dirfd" is passed to a parameter that cannot be negative.
CID 717445: Argument cannot be negative (NEGATIVE_RETURNS)
At (3): "dirfd" is passed to a parameter that cannot be negative.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
mon: MonitorStore: check mkdir return value for errors

CID 728081: Unchecked return value (CHECKED_RETURN)
At (5): Calling function "mkdir(dfn, 493U)" without checking return value.
CID 716853: Unchecked return value (CHECKED_RETURN)
At (2): Calling function "mkdir(fn, 493U)" without checking return value.
CID 716855: Unchecked return value (CHECKED_RETURN)
At (2): Calling function "mkdir(fn, 493U)" without checking return value.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
mon: MonitorStore: check return value of 'rename' for errors

CID 716854: Unchecked return value (CHECKED_RETURN)
At (10): Calling function "rename(tfn, fn)" without checking return value.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
Merge remote-tracking branch 'gh/mon-coverity-fixes'

Reviewed-by: Sage Weil <sage@inktank.com>
client: Support for fchmod

Signed-off-by: Sam Lang <sam.lang@inktank.com>
client: Implement stat and correct lstat

lstat is meant to not follow symbolic links in
the given path, whereas stat does.  This adds a
stat function to Client and libcephfs and changes
the behavior of lstat to not follow symlinks.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
test:  Add libcephfs tests for stat, lstat, chmod

Signed-off-by: Sam Lang <sam.lang@inktank.com>
client: Implement lchown in Client and libcephfs

Signed-off-by: Sam Lang <sam.lang@inktank.com>
doc: Fix wrong wording for symlink xattrs calls

Signed-off-by: Sam Lang <sam.lang@inktank.com>
client: Fix stat of relative symlinks

Stat of symlinks that are relative to their location
would return -ENOENT because the symlink target is
being appended to the path rather than replacing it.
This fix replaces the symlink component with the path
of the symlink target (in the case that its a relative
symlink), and avoids updating the inode to point the
symlink (keeps at the parent).

Signed-off-by: Sam Lang <sam.lang@inktank.com>
test:  Add libcephfs tests for stat, lstat, chmod

Signed-off-by: Sam Lang <sam.lang@inktank.com>
test/libcephfs: Fix telldir/seekdir test

Signed-off-by: Sam Lang <sam.lang@inktank.com>
client: initialize tid in MetaRequest ctor

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

Signed-off-by: Sage Weil <sage@inktank.com>
leveldb: revert accidental rewind

In 51858b78640061cecb82ac7bab4ef99da5a92169.

Signed-off-by: Sage Weil <sage@inktank.com>
Merge git://github.com/ceph/ceph