@@ -1960,7 +1960,11 @@ struct cl_io {
/**
* Bypass quota check
*/
- unsigned int ci_noquota:1;
+ unsigned int ci_noquota:1,
+ /**
+ * io_uring direct IO with flags IOCB_NOWAIT.
+ */
+ ci_iocb_nowait:1;
/**
* How many times the read has retried before this one.
* Set by the top level and consumed by the LOV.
@@ -1587,6 +1587,12 @@ void ll_io_init(struct cl_io *io, const struct file *file, int write,
IOCB_DSYNC));
}
+#ifdef IOCB_NOWAIT
+ io->ci_iocb_nowait = !!(args &&
+ (args->u.normal.via_iocb->ki_flags &
+ IOCB_NOWAIT));
+#endif
+
io->ci_obj = ll_i2info(inode)->lli_clob;
io->ci_lockreq = CILR_MAYBE;
if (ll_file_nolock(file)) {
@@ -776,7 +776,7 @@ int cl_io_loop(const struct lu_env *env, struct cl_io *io)
if (rc && !result)
result = rc;
- if (result == -EAGAIN && io->ci_ndelay) {
+ if (result == -EAGAIN && io->ci_ndelay && !io->ci_iocb_nowait) {
io->ci_need_restart = 1;
result = 0;
}