Sage Weil 80fc7314a7 ceph: fix mds sync() race with completing requests
The wait_unsafe_requests() helper dropped the mdsc mutex to wait
for each request to complete, and then examined r_node to get the
next request after retaking the lock.  But the request completion
removes the request from the tree, so r_node was always undefined
at this point.  Since it's a small race, it usually led to a
valid request, but not always.  The result was an occasional
crash in rb_next() while dereferencing node->rb_left.

Fix this by clearing the rb_node when removing the request from
the request tree, and not walking off into the weeds when we
are done waiting for a request.  Since the request we waited on
will _always_ be out of the request tree, take a ref on the next
request, in the hopes that it won't be.  But if it is, it's ok:
we can start over from the beginning (and traverse over older read
requests again).

Signed-off-by: Sage Weil <sage@newdream.net>
2010-03-23 07:46:56 -07:00
..
2010-02-07 03:06:21 -05:00
2010-01-14 09:05:42 -05:00
2010-01-19 22:36:06 -06:00
2010-02-19 03:35:12 -05:00
2010-03-17 18:43:47 -07:00
2010-01-11 14:30:09 +01:00
2010-01-26 22:22:26 -05:00
2010-03-12 15:52:35 -08:00
2009-12-16 07:20:13 -08:00
2010-03-06 11:26:29 -08:00
2010-03-06 11:26:29 -08:00
2010-03-08 16:55:37 +01:00
2010-03-12 15:52:32 -08:00
2010-03-03 14:13:08 -05:00
2009-12-17 04:52:13 -05:00
2010-03-06 11:26:29 -08:00
2010-03-06 11:26:29 -08:00
2010-03-03 14:07:59 -05:00
2010-03-08 16:55:37 +01:00
2010-03-08 16:55:37 +01:00
2009-12-17 10:51:40 -05:00
2010-03-12 15:52:32 -08:00
2010-03-03 14:08:00 -05:00
2009-12-16 12:16:49 -05:00