|
@@ -712,8 +712,16 @@ static ssize_t aio_run_iocb(struct kiocb *iocb)
|
|
*/
|
|
*/
|
|
ret = retry(iocb);
|
|
ret = retry(iocb);
|
|
|
|
|
|
- if (ret != -EIOCBRETRY && ret != -EIOCBQUEUED)
|
|
|
|
|
|
+ if (ret != -EIOCBRETRY && ret != -EIOCBQUEUED) {
|
|
|
|
+ /*
|
|
|
|
+ * There's no easy way to restart the syscall since other AIO's
|
|
|
|
+ * may be already running. Just fail this IO with EINTR.
|
|
|
|
+ */
|
|
|
|
+ if (unlikely(ret == -ERESTARTSYS || ret == -ERESTARTNOINTR ||
|
|
|
|
+ ret == -ERESTARTNOHAND || ret == -ERESTART_RESTARTBLOCK))
|
|
|
|
+ ret = -EINTR;
|
|
aio_complete(iocb, ret, 0);
|
|
aio_complete(iocb, ret, 0);
|
|
|
|
+ }
|
|
out:
|
|
out:
|
|
spin_lock_irq(&ctx->ctx_lock);
|
|
spin_lock_irq(&ctx->ctx_lock);
|
|
|
|
|