This mirrors the logic in cc8f5ac47c. Make
the renamed inode first match the destdn to avoid problems down the line.
Do this after we've (potentially) cowed the inode in the journal_cow_dentry
on srcdn.
We can get a dn->first that is greater than the parent dir's seq. Notably,
when we do something like
mkdir foo
mkdir foo/.snap/a
rmdir foo/.snap/a
rmdir foo
Here, the foo dentry has a high seq, and subsequent mkdir foo should make
sure we give the new foo dir inode the same seq (and not a lower one from
the parent). Otherwise, things get confused later on.
The problem is if we revoke caps, nothing is dirty, but we do writeback
because we are adjusting max_size. Then we have to wait for the log to
flush even though the revocation should proceed immediately. To move
things along, flush the log immediately.
This still isn't ideal.. it would be nice to allow the locking to continue
and adjust max_size in parallel, but that isn't always possible, and will
require some more thought.
This just avoids l=-1 from showing up in the logs, makes the logic a bit
cleaner (keeps missing and missing_loc in sync).
Signed-off-by: Sage Weil <sage@newdream.net>
Depend on libgoogle-perftools0, not libtcmalloc-minimal0, since we link
against libtcmalloc, not libtcmalloc-minimal. Duh.
Signed-off-by: Sage Weil <sage@newdream.net>
- If we are non-auth, stick with the snap, and the auth will do the
inference.
- If we are auth, the head had better exist, because our lock is
pinned in an unreadable state for some reason. Assert as much.
This fixes a race with successive elections: we may see a new election
(X+1), then get a victory (X). The victory is ignored (rightly so). But
then a paxos follows that which assumes X, and our check was against
mon_epoch, only updated on election victory.. and we are inconsistent and
crash.
So, just get rid of private mon_epoch and use the elector's value.
Signed-off-by: Sage Weil <sage@newdream.net>
This zeros the log, and the bounds, when we start pg removal. Previously
we just removed the log and didn't write the (empty) bounds, breaking
cosd startup later when the old bounds are totally wrong.
Signed-off-by: Sage Weil <sage@newdream.net>