[PATCH 2.5.71-mm1] aio process hang on EINVAL

From: Daniel McNeil (daniel@osdl.org)
Date: Mon Jun 16 2003 - 19:43:28 EST


Andrew,

Here is a patch to fix EINVAL handling in io_submit_one() that was
causing a process hang when attempting AIO to a device not able
to handle aio. I hit this doing a AIO read from /dev/zero. The
process would hang on exit in wait_for_all_aios(). The fix is
to check for EINVAL coming back from aio_setup_iocb() in addition
to the EFAULT and EBADF already there. This causes the io_submit
to fail with EINVAL. That check looks error prone.
Are there other error return values where it should jump to the
aio_put_req()? Should the check be:

        if (ret != 0 && ret != -EIOCBQUEUED)
                goto out_put_req;

Thanks,

Daniel McNeil <daniel@osdl.org>



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Jun 23 2003 - 22:00:19 EST