Add a configurable to allow bucket perms to be checked before key perms
through rgw_defer_to_bucket_acls config option.  This configurable defaults
to an empty string.  Option values include:

  - recurse: If requesting perm PERM on a key, allow if user has
    PERM on the
    bucket to which the key belongs.

  - full_control: If requesting perm PERM on a key, allow if user
    has
    FULL_CONTROL on the bucket to which the key belongs.

This allows users to give someone full bucket perms and be able to
operate on the keys in the bucket without modifying the perms of every
key in the bucket.  This breaks S3 compatability, but that's why
it's a configurable!

Signed-off-by: Liam Monahan <liam@umiacs.umd.edu>
PGMap::dirty_all should be asserting about osd_epochs, not in.osd_epochs

Fixes: #6627
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
rbd.py: increase parent name size limit

64 characters isn't all that long. 4096 ought to be enough for anyone.

Fixes: #6072
Backport: dumpling, cuttlefish
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Merge pull request #764 from ceph/wip-rbd-parent-info

rbd.py: increase parent name size limit

Reviewed-by: Sage Weil <sage@inktank.com>
PGLog::read_log: don't add items past backfill line to missing

Fixes: #6574
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Reviewed-by: David Zafman <david.zafman@inktank.com>
os/ObjectStore: fix RMATTRS encoding

Apparently nobody uses this!

Signed-off-by: Sage Weil <sage@inktank.com>
os/FileStore: fix getattr return value when using omap

The return value should be the length of the value, even when it was
stored in omap.

Signed-off-by: Sage Weil <sage@inktank.com>
osd/osd_types: init SnapSet::seq in ctor

Signed-off-by: Sage Weil <sage@inktank.com>
Merge branch 'wip-osd-fixes' into next

Reviewed-by: Samuel Just <sam.just@inktank.com>
ObjectStore: add a bufferlist-based getattrs() function

Signed-off-by: Greg Farnum <greg@inktank.com>
ReplicatedPG: copy: do not let start_copy() return error codes

There's no failure it can actually run into, and handling error
codes in some of its callers is going to be a pain.
While we're here, document the parameters.

Signed-off-by: Greg Farnum <greg@inktank.com>
ReplicatedPG: copy: rename CopyOp::version -> user_version

This version is a user version, and since we're in the OSD we
should call it such. (In particular, we may want to keep track
of the internal version too when doing cache promotes.)

Signed-off-by: Greg Farnum <greg@inktank.com>
ReplicatedPG: add a Context *ondone to RepGathers

Make a few changes to make sure we trigger it when appropriate. We'll use
this shortly for object promotion, and perhaps for other things in future.

Signed-off-by: Greg Farnum <greg@inktank.com>
ReplicatedPG: copy: add a C_KickBlockedObject

As the name says, you give it an obc and it kicks the block list
when finish()ed.

Signed-off-by: Greg Farnum <greg@inktank.com>
ReplicatedPG: cache: don't handle cache if the obc is blocked

Right now the only way that can happen is if we're in the middle of a
promote!

Signed-off-by: Greg Farnum <greg@inktank.com>
osd: Add a new object_copy_data_t, and use it in the OSD/Objecter

Right now this is very primitive, but we're about to extend it to
deal with request versioning appropriately, and adding in some
extra fields.
Sadly we are doing a little extra copying in the Objecter as a result, but
too bad -- being able to do updates will be worth it.

Signed-off-by: Greg Farnum <greg@inktank.com>
ReplicatedPG: copy: move the COPY_GET implementation into its own function

It was getting long, isn't terribly dependent on access to do_osd_ops()
state, and will be easier to make generic as its own function.

Signed-off-by: Greg Farnum <greg@inktank.com>
OSD: rename CEPH_OSD_OP_COPY_GET -> CEPH_OSD_OP_COPY_GET_CLASSIC

In order to introduce versioning of copy-get, we need to make it a
different op that has the versioning infrastructure from the start.

Signed-off-by: Greg Farnum <greg@inktank.com>
OSD: add back CEPH_OSD_OP_COPY_GET, and use it in the Objecter

This one is encoded with version information. We are not doing anything
to control which op gets sent by the client, but after discussion with
Sam we think this op isn't accessible enough to clients (right now it's
only triggered by a client sending copy-from, which can only happen via
ceph-test-rados) to require compatibility versioning.

Signed-off-by: Greg Farnum <greg@inktank.com>
osd: add category to object_copy_data_t

We don't bump the encoding version -- and stick it in the middle --
since it's still brand-new. For simplicity, we encode it unconditionally
rather than trying to embed it alongside the attrs or with its own
"complete" flag in the cursor.

Signed-off-by: Greg Farnum <greg@inktank.com>