t/zbd: avoid test case 31 failure with small devices
[fio.git] / t / io_uring.c
index 6fc40cbb671ded906e132bbda9ffc689f52442fb..aa6e09e9edf94b3438e434dac0f4e21bb113d964 100644 (file)
@@ -820,7 +820,7 @@ static void set_affinity(struct submitter *s)
 #endif
 }
 
-static int detect_node(struct submitter *s, const char *name)
+static int detect_node(struct submitter *s, char *name)
 {
 #ifdef CONFIG_LIBNUMA
        const char *base = basename(name);
@@ -974,7 +974,9 @@ static int setup_ring(struct submitter *s)
        for (i = 0; i < p.sq_entries; i++)
                sring->array[i] = i;
 
-       s->per_file_depth = (depth + s->nr_files - 1) / s->nr_files;
+       s->per_file_depth = INT_MAX;
+       if (s->nr_files)
+               s->per_file_depth = (depth + s->nr_files - 1) / s->nr_files;
        return 0;
 }