Merge branch 'fix_iouring_eintr' of https://github.com/anarazel/fio
authorJens Axboe <axboe@kernel.dk>
Thu, 12 Sep 2019 20:23:21 +0000 (14:23 -0600)
committerJens Axboe <axboe@kernel.dk>
Thu, 12 Sep 2019 20:23:21 +0000 (14:23 -0600)
* 'fix_iouring_eintr' of https://github.com/anarazel/fio:
  engines/io_uring: Handle EINTR.

1  2 
engines/io_uring.c

diff --combined engines/io_uring.c
index 65f8e2361cbda824b8efe97aae009e6dae169f4d,a1b1324b8e65fdbc0ecbe1ad80b692d17e7c60c0..8c4bcc57f414582419bad9986a29143b2d686785
@@@ -259,7 -259,7 +259,7 @@@ static int fio_ioring_getevents(struct 
                        r = io_uring_enter(ld, 0, actual_min,
                                                IORING_ENTER_GETEVENTS);
                        if (r < 0) {
-                               if (errno == EAGAIN)
+                               if (errno == EAGAIN || errno == EINTR)
                                        continue;
                                td_verror(td, errno, "io_uring_enter");
                                break;
@@@ -370,7 -370,7 +370,7 @@@ static int fio_ioring_commit(struct thr
                        io_u_mark_submit(td, ret);
                        continue;
                } else {
-                       if (errno == EAGAIN) {
+                       if (errno == EAGAIN || errno == EINTR) {
                                ret = fio_ioring_cqring_reap(td, 0, ld->queued);
                                if (ret)
                                        continue;
@@@ -555,7 -555,6 +555,7 @@@ static int fio_ioring_post_init(struct 
                return 1;
        }
  
 +      printf("files=%d\n", o->registerfiles);
        if (o->registerfiles) {
                err = fio_ioring_register_files(td);
                if (err) {
@@@ -614,7 -613,7 +614,7 @@@ static int fio_ioring_open_file(struct 
        struct ioring_data *ld = td->io_ops_data;
        struct ioring_options *o = td->eo;
  
 -      if (!o->registerfiles)
 +      if (!ld || !o->registerfiles)
                return generic_open_file(td, f);
  
        f->fd = ld->fds[f->engine_pos];
  
  static int fio_ioring_close_file(struct thread_data *td, struct fio_file *f)
  {
 +      struct ioring_data *ld = td->io_ops_data;
        struct ioring_options *o = td->eo;
  
 -      if (!o->registerfiles)
 +      if (!ld || !o->registerfiles)
                return generic_close_file(td, f);
  
        f->fd = -1;