radosgw-admin: fix subuser modify

Shouldn't check for empty access key when modifying swift user, also
set correct fields when updating swift keys.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rgw: subuser creation can be idempotent

No real reason to check for existing subuser before (re)creating it.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
radosgw-admin: don't always generate access key for subusers

Only generate key for subuser if one was not specified for it, and only
when creating a subuser.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
librados: Fix typo for read functions documentation

Signed-off-by: David Zafman <david.zafman@inktank.com>
librados: Allow rados_pool_list() to get NULL buffer if len == 0

Coverity wants a NULL check for buf, but caller should be able to
pass a NULL buf and 0 len in order to get byte count of pool list.

Signed-off-by: David Zafman <david.zafman@inktank.com>
rbd: Prevent Seg fault by checking read result in snap_read_header()

Signed-off-by: David Zafman <david.zafman@inktank.com>
tools: Improve ceph_scratchtoolpp

Minor output improvements
Remove clone_range code that was asserting

Signed-off-by: David Zafman <david.zafman@inktank.com>
test: Fix Seg fault in ceph_test_rados

Fixes: #8049

Signed-off-by: David Zafman <david.zafman@inktank.com>
osd: Fix appending write to return any error back to caller

Also, correct double bumping of num_writes

Signed-off-by: David Zafman <david.zafman@inktank.com>
mds: remove wrong assertion for remote frozen authpin

For across authority rename, the MDS first freezes the source inode's
authpin. It happens while the source dentry isn't locked. So when the
inode's authpin become frozen, the source dentry may have changed and
be linked to a different inode.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
mds: include truncate_seq/truncate_size in filelock's state

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

Wip multimds

Reviewed-by: Sage Weil <sage@inktank.com>
mds: guarantee message ordering when importing non-auth caps

Current code allow importing non-auth caps when inode is being exported.
This can breaks message ordering because the corresponding cap import
messages are sent after the flush session messages. So they can arrive
at clients after clients have already received cap import messages from
new auth MDS of the inode.

The quick fix is ignore MExportCaps when inode is frozen.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
mon: Monitor: suicide on start if mon has been removed from monmap

If the monitor has been marked as having been part of an existing quorum
and is no longer in the monmap, then it is safe to assume the monitor
was removed from the monmap.  In that event, do not allow the monitor
to start, as it will try to find its way into the quorum again (and
someone clearly stated they don't really want them there), unless
'mon force quorum join' is specified.

Fixes: 6789
Backport: dumpling, emperor

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
osd/ReplicatedPG: adjust obc + snapset_obc locking strategy

Prevoiusly we assumed that if we had snapset_obc set, !exists on the head
and if we got the snapdir lock we were good to take the head lock too.
This is no the case when:

 - delete queued
   - takes wr lock on both head and snapdir
 - delete commits (but not yet applied)
 - stat
   - tries to take wr lock on head
     - blocks, toggles w=1 state on *head only*
 - copy-from
   - tries to take wr lock on snapdir, succeeds
   - tries to take wr lock on head, fails because w=1
     - fails the assert(got)

The problem is that the read and write paths are taking different locks
and we are expecting them to operate in synchrony.

Fix this by using the same ordering for reads as well as write: if the
snapset_obc is defined, take the read lock on that too, just as we do with
a write.

Fixes: #8046
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
Merge pull request #1624 from ceph/wip-6789

mon: Monitor: suicide on start if mon has been removed from monmap

Reviewed-by: Sage Weil <sage@inktank.com>
mon/OSDMonitor: ignore boot message from before last up_from

It is possible we will have a dup OSDBoot message queued up in the mon
and will process it again after that osd was marked up and then down.  If
that happens, we should ignore this message, not mark the osd back in with
the same address.

Fixes: #8062
Signed-off-by: Sage Weil <sage@inktank.com>
librados, test: Have write, append and write_full return 0 on success

Fix consistency of write, append, write_full, all return 0 on success
Include C (rados_*) variants, C++ ctx variants
and aio get_return_value() and rados_aio_get_return_value()

Signed-off-by: David Zafman <david.zafman@inktank.com>
pybind: Check that "key" is a string

Signed-off-by: David Zafman <david.zafman@inktank.com>
pybind, test: Add python binding for append and add to test

Signed-off-by: David Zafman <david.zafman@inktank.com>