mon: make 'osd crush unlink ..' idempotent

Signed-off-by: Sage Weil <sage@inktank.com>
mds: verify mds tell 'dumpcache <filename>' target does not exist

Open target with O_CREAT|O_EXCL to ensure we don't overwrite some other
important file (like, say, /etc/passwd).  This is irritating because there
is not c++ ofstream equivalent for O_EXCL; kludge around it using
ostringstream instead.

Fixes: #3266
Signed-off-by: Sage Weil <sage@inktank.com>
Merge pull request #197 from ceph/wip-3266

mds: verify mds tell 'dumpcache <filename>' target does not exist

Reviewed-by: Greg Farnum <greg@inktank.com>
mon: fix crush unit tests for idempotency

Signed-off-by: Sage Weil <sage@inktank.com>
Merge pull request #196 from ceph/wip-mon-crush2

Wip mon crush2

Reviewed-by: Dan Mick <dan.mick@inktank.com>
Merge git://github.com/ceph/ceph