We actually do want witnesses who aren't auth for anything
to do journaling in some cases, so kill the assert.
That also negates the need for the not_journaling check.
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
It's possible we have non-auth metadata only because we have a subtree
nested beneath. If we rename a directory out of a non-auth subtree, we
should try to trim any non-auth content from that subtree that may now
be possible due to the child subtrees being linked elsewhere.
Fixes: #1146
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
If we replay a metablob that unlinks something, throw it out immediately.
Recursively. This comes up when:
- we rename a file from one mds to another, and we replay the event on
the source mds. the inode gets thrown out.
- we rename a directory from one mds to another, and when journaled, the
source mds had no nested metadata. same thing: we throw it out. we
may have something in our cache nested beneath that, though, that was
since committed and such, but the fact that we didn't journal it being
reattached elsewhere implies that it was clean and gone when our event
was journaled, and we can throw it all out. recursively.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
libcommon uses symbols from the crypto libraries, so they must appear on
the link line whenever libcommon appears. Later, we may want to revisit
this dependency; however, right now, having unit tests that build
consistently is pretty important.
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
This patch fixes the typo in the usage description to match the actual argument string.
Signed-off-by: Sam Lang <samlang@gmail.com>
Signed-off-by: Sage Weil <sage@newdream.net>
This patchset includes minor fixes to the crushtool utility. If an invalid bucket type is speicifed on the command line, the code was iterating through bucket_types for the length of the static array, but the last entry in that array has null (0) values, which was causing a segfault. This patch just checks that bucket_types[i].name is non-null instead. Also, if the wrong bucket type or algorithm is specified, prints the usage string on exit.
Signed-off-by: Sam Lang <samlang@gmail.com>
Signed-off-by: Sage Weil <sage@newdream.net>
Currently only tests the read path for O_DIRECT and sync (if the ioctl is
in place). Also currently crashes the kclient with
read_direct buf_align 0 offset 4190720 len 4096
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
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>