ReplicatedPG::make_writeable: fill in ssc on clone

ssc should always be filled in on live ObjectContexts.

Fixes: #7835
Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG:: s/_delete_head/_delete_oid, adjust head_exists iff is_head

Fixes: #7872
Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG: disable clone subsets for cache pools

To do this properly, we need to take appropriate read
locks on clone sources and handle evicted clones.

Fixes: #7874
Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG: include pending_attrs when reseting attrs in WRITEFULL

This is necessary for ops like:

2014-03-25 11:48:20.354168 7f0df0ff9700  1 -- 192.168.106.226:0/1016231
--> 192.168.106.226:6814/13647 -- osd_op(client.4198.0:153
default.4198.1_foo [create 0~0,delete,setxattr user.rgw.idtag
(15),writefull 0~3,setxattr user.rgw.manifest (407),setxattr
user.rgw.acl (133),setxattr user.rgw.content_type (25),setxattr
user.rgw.etag (33)] 3.ee3a09ea ondisk+write e49) v4 -- ?+0 0xd09830 con
0xcd74d0

Fixes: #7837
Signed-off-by: Samuel Just <sam.just@inktank.com>
Pipe: rename keepalive->send_keepalive

Signed-off-by: Greg Farnum <greg@inktank.com>
mds: properly propagate dirty dirstat to auth inode

Propagate dirty dirstat to freezing auth inode if the inode is
already auth pinned by the Mutation. Otherwiese the dirstat can
be propagated to inode after client changes inode's mtime.

Fixes: #7880
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
doc: fix typos in tiering dev doc

Signed-off-by: Loic Dachary <loic@dachary.org>
Merge pull request #1549 from dachary/wip-doc

doc: fix typos in tiering dev doc
mds: handle interaction between slave rollback and fragmenting

For slave rename and rmdir events, the MDS needs to preserve non-auth
dirfrag where the renamed inode originally lives in until slave commit
event is encountered. Current method to handle this is use MDCache::
uncommitted_slave_rename_olddir to track any non-auth dirfrag that
need to be preserved. This method does not works well if any preserved
dirfrag gets fragmented by log event (such as ESubtreeMap) between the
slave prepare event and the slave commit event.

The fix is tracking inode of dirfrag instead of tracking dirfrag that
need to preserved directly.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
mds: handle race between cache rejoin and fragmenting

MDCache::handle_cache_expire() ignores mismatched dirfrags. this is
OK during normal operation because MDS doesn't trim replica inode
whose dirfrags are likely being fragmented (see commit 22535340).

During recovery, the recovering MDS can reveive survivor MDS' cache
expire message before it sends cache rejoin acks. In this case,
there still can be mismatched dirfrags, but nothing prevents the
survivor MDS to trim inode of these mismatched dirfrags. So there
can be unconnected dirfrags when the recovering MDS sends cache
rejoin acks.

The fix is, when mismatched dirfrag is encountered during recovery,
check if inode of the dirfrag is still replicated to the sender MDS.
If the inode is not replicated, remove the sender MDS from replica
maps of all child dirfrags.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
mds: avoid journaling non-auth opened inode

Exporting inode has AUTH bit set while EExport event is being
journaled.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
mds: fix CDir::WAIT_ANY_MASK

make sure CDir::WAIT_ANY_MASK include MDSCacheObject::WAIT_UNFREEZE

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
mds: properly journal fragment rollback

If dirfrags are subtree roots, mark the dirfragtreelock as scattered
dirty, otherwise journal the dirfragtree change.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
mds: trim non-auth inode with remote parents

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
mds: trim empty non-auth dirfrags

Fragmenting a non-auth dirfrag results several smaller dirfrags. Some
of the resulting dirfrags can be empty, which are not used to connected
to auth subtree.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
mds: don't trim ambiguous import dirfrags

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
mds: fix CInode::get_approx_dirfrag

return NULL if there is no opened dirfrag

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
mds: journal EFragment::OP_COMMIT before drop locks

Dropping locks can dispatch other requests. These request can submit
log entry.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
mds: fix null pointer dereference in MDCache::rejoin_send_rejoins()

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
mds: skip non-opened session when flushing client sessions

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>