[sheepdog] [PATCH v2 2/7] sheep: make gateway to retry when received SD_RES_OLD_NODE_VER
Christoph Hellwig
hch at infradead.org
Wed May 23 17:08:08 CEST 2012
Oh ok - this patch changes things enough that we can't do what I
proposed in the previous mail.
> + switch (req->rp.result) {
> + case SD_RES_OLD_NODE_VER:
> + /* retry as gateway. */
> + req->rq.epoch = sys->epoch;
> + put_vnode_info(req->vnodes);
> + req->vnodes = get_vnode_info();
> + setup_access_to_local_objects(req);
Can you add a helper to share this code with gateway_op_done? Having
this in a properly named helper also helps with self-documenting the
code.
> + case SD_RES_NEW_NODE_VER:
> + list_del(&req->request_list);
> + list_add_tail(&req->request_list, &sys->request_queue);
> + process_request_event_queues();
> + break;
> + default:
We're probably still better off calling process_request_event_queues
once after the loop instead of possibly starting to queue and complete
I/O from inside the loop. resume_pending_requests already does that
variant, although I think it has a bug because it only checks for a
non-emptry request_queue but not the event queue.
More information about the sheepdog
mailing list