AIO deletion race fix
commit8bd8199f708c41fd779e2b84a7bcc1b8cdb5b753
authorAlexander Graf <alex@csgraf.de>
Wed, 6 May 2009 00:58:48 +0000 (6 02:58 +0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Fri, 8 May 2009 20:57:33 +0000 (8 15:57 -0500)
treeaa9930b8354477e9acd939031cce8924278c72d2
parent2da1e398641d9fccf683645c808dee0d088f84cf
AIO deletion race fix

When deleting an fd event there is a chance the object doesn't get
deleted, but only ->deleted set positive and deleted somewhere later.

Now, if we create a handler for the fd again before the actual
deletion occurs, we end up writing data into an object that has
->deleted set, which is obviously wrong.

I see two ways to fix this:

1. Don't return ->deleted objects in the search
2. Unset ->deleted in the search

This patch implements 1. which feels safer to do. It fixes AIO issues
I've seen with curl, as libcurl unsets fd event listeners pretty
frequently.

Signed-off-by: Alexander Graf <alex@csgraf.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
aio.c