Issue time fixup for guasi/libaio
[fio.git] / engines / splice.c
index 868f6e0d3b6977ee3b9b0dea52ba3c52045c90b8..a847f9caaf7d5ca35cf08d9cadca59a50345d5bc 100644 (file)
@@ -130,6 +130,10 @@ restart:
                                        munmap(map, mmap_len);
                                        goto restart;
                                }
+                               if (errno == EBADF) {
+                                       ret = -EBADF;
+                                       break;
+                               }
                                td_verror(td, errno, "vmsplice");
                                break;
                        } else if (!ret) {
@@ -197,7 +201,7 @@ static int fio_splice_write(struct thread_data *td, struct io_u *io_u)
 static int fio_spliceio_queue(struct thread_data *td, struct io_u *io_u)
 {
        struct spliceio_data *sd = td->io_ops->data;
-       int ret;
+       int uninitialized_var(ret);
 
        fio_ro_check(td, io_u);
 
@@ -228,8 +232,12 @@ static int fio_spliceio_queue(struct thread_data *td, struct io_u *io_u)
                        io_u->error = errno;
        }
 
-       if (io_u->error)
+       if (io_u->error) {
                td_verror(td, io_u->error, "xfer");
+               if (io_u->error == EINVAL)
+                       log_err("fio: looks like splice doesn't work on this"
+                                       " file system\n");
+       }
 
        return FIO_Q_COMPLETED;
 }
@@ -242,7 +250,6 @@ static void fio_spliceio_cleanup(struct thread_data *td)
                close(sd->pipe[0]);
                close(sd->pipe[1]);
                free(sd);
-               td->io_ops->data = NULL;
        }
 }