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>
function-scoped globals are protected by a mutex, and taking a mutex
inside a spin lock implementation kind of defeats the point...
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
MonClient should contain a KeyRing and a RotatingKeyRing. All the
MonClient users, except possibly csyn, don't want to manage those
objects themselves.
Don't chdir until after we have opened the KeyRing. If the KeyRing is at
a relative path, a chdir may make it inaccessible. Separate the chdir
function from the daemonize function.
Refactor the cmds argument parsing a little bit. Separate the special
actions from the normal operations of the daemon.
This should allow librados and libceph to support CephX finally! yay!
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
This reverts commit e8ac5aa2a4.
This commit is just erroneous. It adds checks on a pipe write
for the result and an abort if the write failed. But that's broken
in the desired case where we succeed, block on ceph_fuse_ll_main(),
and the parent process is long-gone by the time we get to this code!
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
Somehow, in the last major change, the constraints that kept the
bencher from trying to read non-existent objects got removed. Put
a check back in the main bench loop to fix that.
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
This has been broken for a while in terms of journaling
things the MDS isn't auth for. This patch should fix that, and
adds a few asserts to that effect.
Also adds a new not_journaling flag to _rename_prepare
for those cases which call the function and then discard
the bufferlist results.
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
Previously, we could get stuck thinking that we'd flushed caps
(that went to the original MDS, waited on freeze for export,
and then were dropped) without ever telling the auth MDS that we
wanted to do so. This caused hung shutdowns:
1) during shutdown we drop all our caps
2) we get stuck and notice that we have a flushing cap
3) we send cap flush
4) MDS ignores it (I think because actual data already got updated?
and now we don't have the proper caps either)
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
Previously we used a check for if there were CEPH_CAP_FILE_BUFFER refs,
but that was racy if we had other threads (they could hold caps for
sync writes or something). Instead, see if we have any in-flight
writes or uncommitted objects.
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
Previously if we had a null dentry which we were not auth for,
we would go into a loop of discover lookups on that dentry.
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
Download files to a 'temporary' name and then rename them when they are
complete. If the download gets aborted halfway through, this prevents
rados sync from getting confused next time when it sees the downloaded
file. This is similar to how rsync operates.
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
If srcdn is a remote dentry, we will be journaling the src inode to update
the mtime, but we need to ensure the parent dirs are in the metablob.
Fixes: #1132
Signed-off-by: Sage Weil <sage@newdream.net>
The reread_head method needs to initialize trimming_pos (like read_head
does) or else we get confused later.
Signed-off-by: Sage Weil <sage@newdream.net>
Make sure the inode is pinned while it is on the LogSegment::renamed_files
list. Avoids a crash when an inode on that list is wrongly trimmed.
Signed-off-by: Sage Weil <sage@newdream.net>
Using a recursive mutex for dout is desirable because it allows us to
survive situations like this:
> foo() { dout << "foo" << dendl; }
> dout(0) << foo() << dendl;
These cases should be fixed because they produce garbled output.
However, with this change, at least they will not cause deadlock.
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
Fix a bug that was keeping lockdep from starting. Add a printout that
lets the user know that lockdep is enabled.
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>