Open up any child frags of the imported renamed inode that are noted in
the journal event. (Note we blindly open up that list here; it's up to the
journaler to only populate it when appropriate.) If the listed frags are
not already open, open them up and set the dir_auth to unknown; presumably
they belong to the rename source/exporter. If we already had them open,
then the adjust_subtree_after_rename call above will have caught them and
already done the necessary subtree adjustment.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
If we are importing the renamed inode, and it is a directory, journal a
list of all open dirfrags (currently, this is actually all frags) so that
we can open them up during journal replay.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
If a rename witness has any subtrees that are nested beneath the renamed
directory, we need to journal the rename event so that our cache is
properly updated on journal replay.
Further, if we are exporting srci, we also need to journal the dest
(even if we aren't auth for destdn) if we have any open dirfrags because
those will turn into nested subtrees shortly.
We still need to ensure that the cache is properly trimmed during replay.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
Hopefully this will make gcc stop complaining. The void cast no longer
seems to silence unchecked return code errors, on gitbuilder at least.
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
This is required for gcov to work on daemons since the coverage data
is written atexit, and the function that writes the data is not
exported.
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
We genuinely don't care about the return code we get back from this call
to write(2). So cast the result to void to tell gcc that we don't care.
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
- make the pop match position with the project in prepare
- don't pop on linkmerge, since we don't project in that case
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
We need the ability to drop caps on another inode that isn't req->inode
or req->old_inode in the request struct.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
If the target is a remote dentry, we need to consider that the destdn
and desti may have different auths.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
We want to send link requests to the auth for the new name, not the
target inode. We also want to drop FILE_SHARED caps on new name's
directory.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
Only add target into the stray dir if we are renaming over a primary
dentry. (Otherwise we aren't moving the target.)
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
- create xlock import/export helpers
- fix/simplify checks: we want to export/import only xlocks on the inode
that is being migrated, unless they are locallock.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
If we replay a dir rename operation, we need to adjust the subtree map
accordingly.
This covers the case where the metablob contains both the src and dest
dentries. Remaining cases will follow.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
This code has suffered a great deal of bitrot and is superceded
by the cmds --dump-journal functionality anyway, which
is much more full-featured.
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>