Greg Farnum [Wed, 25 Aug 2010 19:04:53 +0000 (12:04 -0700)]
mds: fix invalid comparison.
We just want the code in this if block to execute if the previous if block did.
But the previous if block unlinked destdnl, so the comparison always fails! Use
a bool and set it appropriately to fix.
Sage Weil [Tue, 24 Aug 2010 17:38:21 +0000 (10:38 -0700)]
mds: expose projected values for all locks to loner (not just filelock)
There is nothing special about filelock in this case. If the client is
the loner, we should use the projected values. This is important when
we are looking at a snapid on the head (see snaptest-authwb.sh).
Sage Weil [Thu, 19 Aug 2010 22:19:33 +0000 (15:19 -0700)]
mds: add wait on auth change machinery
Special wait mask is passed through lock wait mask to parent object.
Caller adds item to a list on the subtree root.
Removal of wait item automatically removes from said list.
Subtree topology changes adjust authchange wait lists.
Migrator auth change update waits waiters. Import/export should be
protected by freeze/thaw or the blanket wakeups.
Greg Farnum [Thu, 19 Aug 2010 19:01:11 +0000 (12:01 -0700)]
backtrace: fix segfault in tcmalloc.
The print function is only called when we're about to crash anyway,
and the datamember 'foo' is allocated by ptmalloc, not tcmalloc. Freeing
it via tcmalloc causes its own crash which pollutes our debugging and
incorrectly sticks tcmalloc into the stack. So, just don't free.
Sage Weil [Fri, 20 Aug 2010 16:26:34 +0000 (09:26 -0700)]
crush: return error instead of BUGing on bad forcefed mapping
The forcefed mapping relies on a parent map. However, the current
implementation assumes that the parent mapping is unique for all rules. If
that is not the case (i.e., some osd exists in multiple hierarchies) then
we cannot assert that the TAKE matches the calculated force_context.
For now, we can just fail the mapping in that case (we don't use forcefed
mappings yet). The real solution is probably to define parent maps for
all possible hierarchies (i.e., starting at each unique TAKE starting
point).
Sage Weil [Fri, 20 Aug 2010 04:47:19 +0000 (21:47 -0700)]
mds: fix ENOTEMPTY checking on rmdir/rename
We can't trust the inode rstat size without holding the locks. We can
look at our auth frags and though without fear of a false positive
ENOTEMPTY, however.
Rename the function, introduce a helper for the locked check, update
comments, etc.
Greg Farnum [Thu, 19 Aug 2010 19:01:11 +0000 (12:01 -0700)]
backtrace: fix segfault in tcmalloc.
The print function is only called when we're about to crash anyway,
and the datamember 'foo' is allocated by ptmalloc, not tcmalloc. Freeing
it via tcmalloc causes its own crash which pollutes our debugging and
incorrectly sticks tcmalloc into the stack. So, just don't free.
Greg Farnum [Thu, 19 Aug 2010 19:01:11 +0000 (12:01 -0700)]
backtrace: fix segfault in tcmalloc.
The print function is only called when we're about to crash anyway,
and the datamember 'foo' is allocated by ptmalloc, not tcmalloc. Freeing
it via tcmalloc causes its own crash which pollutes our debugging and
incorrectly sticks tcmalloc into the stack. So, just don't free.
Sage Weil [Wed, 18 Aug 2010 20:49:11 +0000 (13:49 -0700)]
mds: fix null snapflush logic
We only want to do a null snapflush if we _know_ there isn't another one
coming: that is, there aren't any outstanding issued excl/wr cap bits at
the client. The old test has the bitwise NOT backwards. We can also
limit the test to the bits we care about.
Sage Weil [Wed, 18 Aug 2010 20:44:34 +0000 (13:44 -0700)]
qa: add snaptest-snap-rm-cmp
This (usually) reproduced a bug where:
- we write a big file
- snap it
- remove it. this makes the mds cow it.
- cp the snapped version.
- mds syncs the head
- client starts writeback
- (sometimes!) client sends other caps back to the mds
- mds does null flushsnap, not realizing a real one is still coming
Sage Weil [Wed, 18 Aug 2010 20:16:57 +0000 (13:16 -0700)]
mds: remove forward-on-nonauth-rdlock behavior
The problem is that we may be rdlocking items with a different auth than
the main item we are modifying, so forwarding based on lock state is
inconsistent with our requirement that we be on the modified item's auth.
Either we can somehow mark whether the locked item is the "main thing" we
are operating on, or we can drop the forward behavior from the locker and
put any forwarding heuristics elsewhere. I'm opting for the latter.
Sage Weil [Wed, 18 Aug 2010 17:18:21 +0000 (10:18 -0700)]
mds: fix null snapflush inode lookup
Don't use pick_inode_snap is totally wrong (it depends on the current set
of snaps, etc.).. look up the inode directly via the ino and last snapid,
which we have. Fixes a failure at the assert.
Reported-by: Thomas Mueller <thomas@chaschperli.ch> Signed-off-by: Sage Weil <sage@newdream.net>
Sage Weil [Tue, 17 Aug 2010 23:38:20 +0000 (16:38 -0700)]
mds: handle no flushsnap
We won't get a flushsnap when the client has EXCL/WR caps but no dirty
data. The MDS needs to release the snapped inode's locks when it gets a
normal update but no FLUSHSNAP.