Commit Graph

11092 Commits

Author SHA1 Message Date
Greg Farnum
6998372a8f mon: Adjust lease time checks.
For some reason this fixes (apparently incorrect) warnings I saw
while running a 2-mon system on my dev server.
2010-08-24 11:49:43 -07:00
Greg Farnum
09fbe8650e Merge branch 'leaks' into unstable
Conflicts:
	src/mds/Locker.cc
2010-08-24 10:35:35 -07:00
Greg Farnum
6ace230b8f Merge branch 'unstable' into leaks
Conflicts:
	src/mds/Locker.cc
2010-08-23 23:41:41 -07:00
Sage Weil
1d8770be27 Merge branch 'auth_change_waiters' into unstable 2010-08-23 20:31:17 -07:00
Sage Weil
067d8bb0d1 mds: don't auth_pin non-auth wrlock targets 2010-08-23 20:23:14 -07:00
Sage Weil
8d462435a7 mds: don't auth_pin non-auth rdlock targets
This generates lots of lock traffic that is unneeded with the authchange
notification machinery.
2010-08-23 20:23:14 -07:00
Sage Weil
aa226df5ca 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.
2010-08-23 20:23:14 -07:00
Sage Weil
46bf806a77 mon: ignore osd boot with bad addr
This sort of masks a bug in the msgr layer.
2010-08-23 12:53:24 -07:00
Sage Weil
cde89c5a49 mds: only revoke client leases when there are leases in AC_LOCK handler
Fixes crash, bc the revoke func assumes it's a CDentry
2010-08-23 11:50:30 -07:00
Sage Weil
45ab5ac1fb mds: fix retry on discover_*
The discover_* methods can block on an ambiguous base auth, so we need to
retry in that case.
2010-08-23 11:39:39 -07:00
Sage Weil
8588100ef7 mds: ignore reqrdlock if frozen 2010-08-23 11:38:43 -07:00
Sage Weil
3adccf5018 mds: handle REQRDLOCK on simple locks too
Use a helper.
2010-08-23 11:16:42 -07:00
Sage Weil
73c6ee9be8 Merge remote branch 'origin/testing' into unstable 2010-08-23 10:32:18 -07:00
Sage Weil
5ec305db70 mds: eval inodes with caps after import 2010-08-23 09:36:10 -07:00
Sage Weil
fc8176c892 qa: add test for snapcap writeback of auth bits 2010-08-22 15:19:53 -07:00
Sage Weil
8950599aef qa: test xattr snap wb 2010-08-22 15:18:21 -07:00
Sage Weil
c85a499b8d osd: disable potentially dangerous dead code
Greg got a segfault accessing the OSDOP& first reference. Not clear why,
but this whole block is dead code.
2010-08-20 13:46:38 -07:00
Greg Farnum
1ac5675500 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.
2010-08-20 13:46:25 -07:00
Sage Weil
f669adb0ab mds: drop old thrash_exports time limit 2010-08-20 09:57:07 -07:00
Sage Weil
cfdc5f0ef2 osdmaptool: print useful error instead of crashing if osdmap is corrupt 2010-08-20 09:31:49 -07:00
Sage Weil
ec80b10f28 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).

Signed-off-by: Sage Weil <sage@newdream.net>
2010-08-20 09:26:34 -07:00
Sage Weil
80c8902d78 mds: return error to client on invalid mds op
e.g., if the client sends a filelock request and we don't support it :)
2010-08-19 22:01:54 -07:00
Sage Weil
4007669c46 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.
2010-08-19 21:47:19 -07:00
Sage Weil
b1350c905c mds: fix pick_inode_snap
Return when we find something.
2010-08-19 16:21:47 -07:00
Sage Weil
84e835f1e6 mds: fix intermediate snapped inode updates
Pass head inode to pick_inode_snap!
2010-08-19 16:21:18 -07:00
Sage Weil
22bd8376a8 osd: disable potentially dangerous dead code
Greg got a segfault accessing the OSDOP& first reference. Not clear why,
but this whole block is dead code.
2010-08-19 16:06:24 -07:00
Sage Weil
3b5a53f01b utime: microsecond -> nanosecond resolution
Strictly speaking, this changes the encoding.  But, the encoding was
broken before, because ceph_timespec in ns but we were actually encoding
us.

But it's all subsecond resolution, so who cares.  Just change it!
2010-08-19 16:02:01 -07:00
Sage Weil
fcea7d96e0 Merge branch 'testing' into unstable 2010-08-19 10:47:19 -07:00
Sage Weil
e3654dfc96 mds: make null snapflush helper, and call on cap removal too
Move remove_client_cap() from MDCache->Locker while we're at it!
2010-08-19 10:47:16 -07:00
Sage Weil
02522afc09 mds: simplify/fix early null snapflush check, clean up comment 2010-08-19 09:57:50 -07:00
Sage Weil
d0f6991eb6 osd: carry ondisk write lock for cloned objects
This fixes a race when reading and deleting objects, as evidenced by

 cp bigfile a
 mkdir .snap/foo
 rmdir a
 diff bigfile .snap/foo/a    <-- reads cloned object before it hits disk

Reproduced by snaptest-snap-rm-cmp.sh.

Signed-off-by: Sage Weil <sage@newdream.net>
2010-08-19 09:52:55 -07:00
Sage Weil
824de0d6e0 mds: fix crash when REQSCATTER races with an actual scatter/MIX 2010-08-18 15:17:55 -07:00
Sage Weil
c8701f29f0 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.
2010-08-18 13:49:11 -07:00
Sage Weil
f3b323f6d8 mds: don't send null ack in do_snap_update
(In this case, it's a null flushsnap.)
2010-08-18 13:45:43 -07:00
Sage Weil
466c002f18 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
2010-08-18 13:44:34 -07:00
Sage Weil
0bcdd0b499 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.
2010-08-18 13:16:57 -07:00
Sage Weil
e8f56d3294 auth: fix skipping of ~/ if $HOME subst fails
We were breaking out of the loop entirely, and failing to check the rest
of the items in the path list.  Doh!
2010-08-18 12:57:13 -07:00
Sage Weil
28d7a40082 mds: oops, fix null snapflush fix 2010-08-18 10:38:40 -07:00
Sage Weil
9908c0ea65 mds: clean up {have,get}_inode() definitions 2010-08-18 10:27:51 -07:00
Sage Weil
625ffd3e67 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>
2010-08-18 10:27:51 -07:00
Greg Farnum
9092d65b7b rgw: fix commit warning.
size_t is a long unsigned, not a long long unsigned.
2010-08-18 10:27:48 -07:00
Greg Farnum
5a89b8b2c9 qa: add simple snaprealm test script. 2010-08-17 17:01:43 -07:00
Sage Weil
6d0ccd9c7e 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.
2010-08-17 16:38:20 -07:00
Sage Weil
9dd2ffd710 qa: snaptest-capwb check no snapflush case first 2010-08-17 14:29:30 -07:00
Sage Weil
d2205a9423 qa: snaptest-upchildreams.sh should clean up after itself 2010-08-17 14:29:30 -07:00
Sage Weil
2551651069 qa: add capwb check for case where client doesn't send flushsnap 2010-08-17 14:29:30 -07:00
Sage Weil
5f9cc443e7 mds: fix rdlock referral on snapped inode to head
Note: this still needs some fixing, as the head and snapped inodes may be
on different MDSs!
2010-08-17 14:29:26 -07:00
Sage Weil
60596c75a1 mds: drop x/wrlocks before, rdlocks after sending reply
This lets us issue the most leases/caps possible.  It also ensure we can
issue caps in the snapped namespace when we are still on the head inode
(previously, releasing the rdlock twiddled the state, the client didn't
get say Frc, and hung indefinitely).
2010-08-17 12:15:04 -07:00
Sage Weil
caec5d2b19 client: direct requests in snapped namespace based on nonsnap parent
We fixed snapdir before.. but we need to do the same for the entire snapped
portion of the namespace.
2010-08-17 12:00:10 -07:00
Sage Weil
a4930d9eea qa: add snaptest-estale.sh
Verify requests withing snapped namespace are directed to the proper
MDS.  We should never get ESTALE, only ENOENT.
2010-08-17 12:00:07 -07:00