Re: [patch] aio: fix buggy put_ioctx call in aio_complete - v2

From: Jeff Moyer
Date: Thu Feb 01 2007 - 16:13:50 EST


==> On Fri, 29 Dec 2006 17:34:26 -0800, "Chen, Kenneth W" <kenneth.w.chen@xxxxxxxxx> said:

Kenneth> An AIO bug was reported that sleeping function is being called in softirq
Kenneth> context:

Kenneth> The real problem is that the condition check of ctx->reqs_active in
Kenneth> wait_for_all_aios() is incorrect that access to reqs_active is not
Kenneth> being properly protected by spin lock.

Kenneth> This patch adds that protective spin lock, and at the same time removes
Kenneth> all duplicate ref counting for each kiocb as reqs_active is already used
Kenneth> as a ref count for each active ioctx. This also ensures that buggy call
Kenneth> to flush_workqueue() in softirq context is eliminated.

I was finally able to wrap my head around this, and testing has
confirmed that this patch fixes the problem. So,

Acked-by: Jeff Moyer <jmoyer@xxxxxxxxxx>

Better late than never.

-Jeff
-
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/