osd: Improve logging output including pg_shard_t as osd#(shard)

Signed-off-by: David Zafman <david.zafman@inktank.com>
osd: Add logging of missed l_osd_agent_skip cases

Signed-off-by: David Zafman <david.zafman@inktank.com>
osd: Error from start_flush() not checked in agent_maybe_flush()

This caused a very minor memory leak since ctx was allocated
Include logging of l_osd_agent_skip

Signed-off-by: David Zafman <david.zafman@inktank.com>
osd: start_flush() should check for missing clones and return if requested

Fixes: #7659

Signed-off-by: David Zafman <david.zafman@inktank.com>
ReplicatedPG::_verify_no_head_clones: missing implies that the clone exists

Fixes: #7659
Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG: do not create snapdir on head eviction

Head eviction implies that no clones are present.  Also, add
an exists flag to SnapSetContext in order prevent an ssc from
a recent eviction from preventing a snap read from activating
the promotion machinery.

Fixes: #7858
Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG::do_op: use get_object_context for list-snaps

find_object_context provides some niceties which we don't need since we know
the oid of the clones.  Problematically, it also return ENOENT if the snap
requested happens to have been removed.  Even in such a case, the clone may
well still exist for other snaps.  Rather than modify find_object_context to
avoid this situation for this caller, we'll simply do it inline in do_op.

Fixes: #7858
Signed-off-by: Samuel Just <sam.just@inktank.com>
client: implement RDCACHE reference tracking

make the code be able to track Fc caps used by aysnc buffer reads

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
client: hold Fcr caps during readahead

Fcr caps prevent the file from being truncated.

Fixes: #7958
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
client: assign implemented caps to caps field of MClientCaps

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
client: properly retain used caps

Pass properly 'retain' to Client::send_cap() because it is used to
adjust cap->issued.

Also make Client::encode_inode_release() not release used/dirty caps.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
client: drop Fr cap before gettattr CEPH_STAT_CAP_SIZE

When MDS receives the getattr request, corresponding inode's filelock
can be in unstable state which waits for client's Fr cap.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
client: cleanup Client::_invalidate_inode_cache()

drop parameter 'keep_caps'

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
ObjectCacher: assert no waiter when remove buffer head

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
client: fix null pointer dereference in Client::unlink

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
include/memory: add static_pointer_cast

Signed-off-by: Greg Farnum <greg@inktank.com>
mds: MDRequest: rename to MDRequestImpl, and declare MDRequestRef

We're switching the MDRequest to be used as a shared pointer. This is the
first step on the path to inserting an OpTracker into the MDS.
Give the MDRequestImpl a weak_ptr self_ref so that we can keep
using the elist for now.

Signed-off-by: Greg Farnum <greg@inktank.com>
MDS: Convert the request_start* functions and their immediate callers

Also, the active_requests mapping gets weak pointers.

Signed-off-by: Greg Farnum <greg@inktank.com>
Server: Use MDRequestRef instead of raw pointers

Signed-off-by: Greg Farnum <greg@inktank.com>
MDCache: use MDRequestRef instead of MDRequest*

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