Merge branch 'optlenmax' of https://github.com/powernap/fio
authorJens Axboe <axboe@kernel.dk>
Mon, 1 Jul 2019 20:26:29 +0000 (14:26 -0600)
committerJens Axboe <axboe@kernel.dk>
Mon, 1 Jul 2019 20:26:29 +0000 (14:26 -0600)
* 'optlenmax' of https://github.com/powernap/fio:
  Increase maximum length of line in jobs file to 8192

1  2 
init.c

diff --combined init.c
index f2ba1e208e8f1cc44d37490501abb932c6b6ed4b,f7e7296fda9b495053b964ff789794dd2009218a..c9f6198ea63abdfa74248628fbb2ffca36a7ca7b
--- 1/init.c
--- 2/init.c
+++ b/init.c
@@@ -1438,7 -1438,7 +1438,7 @@@ static int add_job(struct thread_data *
                   int recursed, int client_type)
  {
        unsigned int i;
 -      char fname[PATH_MAX];
 +      char fname[PATH_MAX + 1];
        int numjobs, file_alloced;
        struct thread_options *o = &td->o;
        char logname[PATH_MAX + 32];
@@@ -1887,7 -1887,7 +1887,7 @@@ static int __parse_jobs_ini(struct thre
                }
        }
  
-       string = malloc(4096);
+       string = malloc(OPT_LEN_MAX);
  
        /*
         * it's really 256 + small bit, 280 should suffice
                        if (is_buf)
                                p = strsep(&file, "\n");
                        else
-                               p = fgets(string, 4096, f);
+                               p = fgets(string, OPT_LEN_MAX, f);
                        if (!p)
                                break;
                }
                                if (is_buf)
                                        p = strsep(&file, "\n");
                                else
-                                       p = fgets(string, 4096, f);
+                                       p = fgets(string, OPT_LEN_MAX, f);
                                if (!p)
                                        break;
                                dprint(FD_PARSE, "%s", p);
                                        strncpy(full_fn,
                                                file, (ts - file) + 1);
                                        strncpy(full_fn + (ts - file) + 1,
 -                                              filename, strlen(filename));
 +                                              filename,
 +                                              len - (ts - file) - 1);
                                        full_fn[len - 1] = 0;
                                        filename = full_fn;
                                }