mds: Make min/max UID configurable for who is allowed to create a snapshot

This way administrators can configure which UIDs are allowed to create
snapshots on CephFS.

In certain situations it might be desirable that regular users are not allowed
to create snapshots. For example on shared hosting environments.

Fixes: #9029
mds: Also check min/max uid on snap removal

Not only check if the uid is correct when creating a snapshot, but also
verify if the UID is correct when trying to remove a snapshot.

Fixes: #9029
test_librbd_fsx: also flatten as part of randomize_parent_overlap

With randomize_parent_overlap fsx will randomly truncate base images
after they have been cloned from.  This throws flatten into the mix:
base image will be flattened with 2/16 chance (equal to the chance of
leaving the image intact).

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
os/chain_xattr: Remove all old xattr entry when overwrite the xattr.

Ceph use multiple xattrs to store the value of a single xattr which size
is larger than CHAIN_XATTR_MAX_BLOCK_LEN.
But when overwote the content of xattr in func
chain_setxattr/chain_fsetxattr, we don't know the size of previous
content of the xattr.
So we only try to remove until system return  -ENODATA.

Signed-off-by: Ma Jianpeng <jianpeng.ma@intel.com>
doc: Initial network docs.

Signed-Off-By: Kevin Cox <kevincox@kevincox.ca>
librados/TestCase: inheret cleanup_default_namespace

No need to duplicate this code.

Signed-off-by: Sage Weil <sage@redhat.com>
ceph_test_rados_api: fix cleanup of cache pool

We can't simply try to delete everything in there because some items may
be whiteouts.  Instead, flush+evict everything, then remove overlay, and
*then* delete what remains.

Fixes: #9055
Signed-off-by: Sage Weil <sage@redhat.com>
ceph_test_rados_api_tier: fix cache cleanup (ec too)

Signed-off-by: Sage Weil <sage@redhat.com>
mon/MonitorDBStore: add get_{keys,bytes}() accounting to Transaction

Signed-off-by: Sage Weil <sage@redhat.com>
librbd: fix error path cleanup for opening an image

If the image doesn't exist and caching is enabled, the ObjectCacher
was not being shutdown, and the ImageCtx was leaked. The IoCtx could
later be closed while the ObjectCacher was still running, resulting in
a segfault. Simply use the usual cleanup path in open_image(), which
works fine here.

Fixes: #8912
Backport: dumpling, firefly
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
utime: Because class Clock didn't exist,so remove the declaration in class utime_t.

Signed-off-by: Ma Jianpeng <jianpeng.ma@intel.com>
Merge pull request #2239 from ceph/wip-8912

librbd: fix error path cleanup for opening an image

Reviewed-by: Sage Weil <sage@redhat.com>
ReplicatedPG: do not pass cop into C_Copyfrom

We do not know when the objecter will finally let go of this Context.  Thus, we
cannot know whether it will happen before the flush, at which point the
object_context held by the cop must have been released.

Also, we simply don't need it, process_copy_chunk alrady works in terms of the
tid!

Fixes: #8894
Reviewed-by: Sage Weil <sage@redhat.com>
Signed-off-by: Samuel Just <sam.just@inktank.com>
Revert "ReplicatedPG: do not pass cop into C_Copyfrom"

The ref was introduced in 589b639af7c8834a1e6293d58d77a9c440107bc3
and is actually necessary to keep the buffers around.

This reverts commit 300b5e8ecbb7526b55e2cb5eeba81fd501a8b652.
Merge pull request #2242 from majianpeng/fix4

utime: Because class Clock didn't exist,so remove the declaration in class utime_t

Reviewed-by: Sage Weil <sage@redhat.com>
mon/Paxos: add perfcounters for most paxos operations

I'm focusing primarily on the ones that result in IO here.

Signed-off-by: Sage Weil <sage@redhat.com>
Merge pull request #2237 from ceph/wip-8560

mon: instrument paxos

Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
Merge pull request #2234 from kevincox/net-docs

doc: Initial network docs.

Reviewed-by: Sage Weil <sage@redhat.com>
Merge pull request #2230 from ceph/wip-fsx-flatten

test_librbd_fsx: also flatten as part of randomize_parent_overlap

Reviewed-by: Sage Weil <sage@redhat.com>
Merge pull request #2233 from majianpeng/fix1

os/chain_xattr: Remove all old xattr entry when overwrite the xattr.

Reviewed-by: Sage Weil <sage@redhat.com>