[sheepdog] [PATCH v4 2/8] sheep: make requests with new epoch sleep until epoch is updated

Christoph Hellwig hch at infradead.org
Sat May 26 16:47:48 CEST 2012


On Fri, May 25, 2012 at 10:30:54AM +0800, levin li wrote:
> +				sys->epoch, req->rq.epoch, req->rq.opcode);
> +			/* ask gateway to retry. */
> +			req->rp.result = SD_RES_OLD_NODE_VER;
> +			req->rp.epoch = sys->epoch;
>  			req->work.done(&req->work);
> +			sys->nr_outstanding_io++;

Any chance you could just opencode the action we want here?  E.g.
currently io_op_done tries to delete the request from the outstanding
I/O list, which it hasn't even been added to, in addition to needing
the nr_outstanding_io increment hack.

> +		} else if (after(req->rq.epoch, sys->epoch)) {
> +			eprintf("new node version %u, %u, %x\n",
> +				sys->epoch, req->rq.epoch, req->rq.opcode);
> +
> +			/* put on local wait queue, waiting for local epoch
> +			   to be lifted */
> +			req->rp.result = SD_RES_NEW_NODE_VER;
> +			list_add_tail(&req->request_list, &sys->wait_rw_queue);
> +			sys->nr_outstanding_io++;

As we don't call the done function here it should not increment
sys->nr_outstanding_io.




More information about the sheepdog mailing list