Messages in this thread | | | Date | Tue, 20 May 2014 11:20:25 +0800 | Subject | Re: [PATCH] block: mq flush: fix race between IPI handler and mq flush worker | From | Ming Lei <> |
| |
On Mon, May 19, 2014 at 11:18 PM, Christoph Hellwig <hch@lst.de> wrote: > On Mon, May 19, 2014 at 11:05:50PM +0800, Ming Lei wrote: >> Another simple fix is to disable ipi for flush request, but looks >> this one should be better. > > I think the first thing is to bite the bullet and sort out and document > the various unions in struct request for real.
Considered the problem can be reproduced easily and cause data loss on kvm-guest, I hope fix can be seen in 3.15. Also it should be backported to 3.14 because someone may enable ctx->ipi_redirect.
Thinking it further, looks the patch is fine:
- sizeof(call_single_data) and sizeof(work_struct) is very close and both are not small, so it is reasonable to put the two in one union for saving request space
- the conflict on the two structures just happens with flush requests because rq->requeue_work is only used to queue flush requests
- in the flush sequence, the conflict won't happen on request with data, so it only happens with completing and queueing PREFLUSH/POSTFLUSH request.
Any comments and suggestions?
Thanks, -- Ming Lei
| |