Re: [PATCH 2/4] FUSE: make request_wait_answer() wait for ->end() completion
From: Miklos Szeredi
Date: Wed Jun 24 2009 - 06:03:02 EST
On Thu, 18 Jun 2009, Tejun Heo wrote:
> Previously, a request was marked FINISHED before ->end() is executed
> and thus request_wait_answer() can return before it's done. This
> patch makes request_wait_answer() wait for ->end() to finish before
> returning.
Why is this change needed?
>
> Note that no current ->end() user waits for request completion, so
> this change doesn't cause any behavior difference.
>
> While at it, beef up the comment above ->end() hook and clarify when
> and where it's called.
OK.
[snip]
> @@ -293,10 +292,21 @@ __releases(&fc->lock)
> fc->active_background--;
> flush_bg_queue(fc);
> }
> +
> spin_unlock(&fc->lock);
> - wake_up(&req->waitq);
> - if (end)
> +
> + if (end) {
> end(fc, req);
> + smp_wmb();
Why is this barrier needed?
Thanks,
Miklos
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/