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>
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 #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>
osd: inline require_osd_up_peer

There is only one caller.

Signed-off-by: Sage Weil <sage@redhat.com>
osd: fix require_same_peer_instance from fast_dispatch

The mark-down of old peers needs to take the session_dispatch_lock in order
to safely clear the Session ref cycle.  However, for fast dispatch callers,
that lock is already held.  Pass a flag down from the callers indicating
whether we need to take the additional lock.

Fixes: #9096
Signed-off-by: Sage Weil <sage@redhat.com>
osd: fix some line wrapping

Signed-off-by: Sage Weil <sage@redhat.com>
osd/ReplicatedPG: only do agent mode calculations for positive values

After a split we can get negative values here.  Only do the arithmetic if
we have a valid (positive) value that won't through the floating point
unit for a loop.

Fixes: #9082
Tested-by: Karan Singh <karan.singh@csc.fi>
Signed-off-by: Sage Weil <sage@redhat.com>