From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: MIME-Version: 1.0 In-Reply-To: <53AE26F4.9050808@kernel.dk> References: <53AE26F4.9050808@kernel.dk> Date: Fri, 27 Jun 2014 20:55:35 -0700 Message-ID: Subject: Re: A typo in io_u.c::get_next_file()? From: Andrey Kuzmin Content-Type: multipart/alternative; boundary=047d7b6762cefee30c04fcdd655b To: Jens Axboe Cc: fio@vger.kernel.org List-ID: --047d7b6762cefee30c04fcdd655b Content-Type: text/plain; charset=UTF-8 Still unsure how it could have worked all the way down to now ;). given the default profile being null (unless I'm missing it being set differently). On Jun 27, 2014 7:22 PM, "Jens Axboe" wrote: > On 2014-06-27 18:54, Andrey Kuzmin wrote: > >> diff --git a/io_u.c b/io_u.c >> index e132fd9..f487b0a 100644 >> --- a/io_u.c >> +++ b/io_u.c >> @@ -1100,7 +1100,7 @@ out: >> >> static struct fio_file *get_next_file(struct thread_data *td) >> { >> - if (!(td->flags & TD_F_PROFILE_OPS)) { >> + if ((td->flags & TD_F_PROFILE_OPS)) { >> struct prof_io_ops *ops = &td->prof_io_ops; >> >> if (ops->get_next_file) >> > > Hah indeed, good catch! I was wondering why it would not segfault, but I > guess we fall through normally anyway. So it only impacts profiles that > have get_next_file set, which makes it a minor issue. > > Thanks for the patch! Applied. > > -- > Jens Axboe > > --047d7b6762cefee30c04fcdd655b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

Still unsure how it could have worked all the way down to no= w ;). given=C2=A0 the default profile being null (unless I'm missing it= being set differently).

On Jun 27, 2014 7:22 PM, "Jens Axboe" = <axboe@kernel.dk> wrote:
On 2014-06-27 18:54, Andrey Kuzmin wrote:
diff --git a/io_u.c b/io_u.c
index e132fd9..f487b0a 100644
--- a/io_u.c
+++ b/io_u.c
@@ -1100,7 +1100,7 @@ out:

=C2=A0 static struct fio_file *get_next_file(struct thread_data *td)
=C2=A0 {
- =C2=A0 =C2=A0 =C2=A0 if (!(td->flags & TD_F_PROFILE_OPS)) {
+ =C2=A0 =C2=A0 =C2=A0 if ((td->flags & TD_F_PROFILE_OPS)) {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0struct prof_i= o_ops *ops =3D &td->prof_io_ops;

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (ops->g= et_next_file)

Hah indeed, good catch! I was wondering why it would not segfault, but I gu= ess we fall through normally anyway. So it only impacts profiles that have = get_next_file set, which makes it a minor issue.

Thanks for the patch! Applied.

--
Jens Axboe

--047d7b6762cefee30c04fcdd655b-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Message-ID: <53AE26F4.9050808@kernel.dk> Date: Fri, 27 Jun 2014 20:22:44 -0600 From: Jens Axboe MIME-Version: 1.0 Subject: Re: A typo in io_u.c::get_next_file()? References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit To: Andrey Kuzmin Cc: fio@vger.kernel.org List-ID: On 2014-06-27 18:54, Andrey Kuzmin wrote: > diff --git a/io_u.c b/io_u.c > index e132fd9..f487b0a 100644 > --- a/io_u.c > +++ b/io_u.c > @@ -1100,7 +1100,7 @@ out: > > static struct fio_file *get_next_file(struct thread_data *td) > { > - if (!(td->flags & TD_F_PROFILE_OPS)) { > + if ((td->flags & TD_F_PROFILE_OPS)) { > struct prof_io_ops *ops = &td->prof_io_ops; > > if (ops->get_next_file) Hah indeed, good catch! I was wondering why it would not segfault, but I guess we fall through normally anyway. So it only impacts profiles that have get_next_file set, which makes it a minor issue. Thanks for the patch! Applied. -- Jens Axboe From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: MIME-Version: 1.0 From: Andrey Kuzmin Date: Fri, 27 Jun 2014 17:54:26 -0700 Message-ID: Subject: A typo in io_u.c::get_next_file()? Content-Type: text/plain; charset=UTF-8 To: Jens Axboe Cc: fio@vger.kernel.org List-ID: diff --git a/io_u.c b/io_u.c index e132fd9..f487b0a 100644 --- a/io_u.c +++ b/io_u.c @@ -1100,7 +1100,7 @@ out: static struct fio_file *get_next_file(struct thread_data *td) { - if (!(td->flags & TD_F_PROFILE_OPS)) { + if ((td->flags & TD_F_PROFILE_OPS)) { struct prof_io_ops *ops = &td->prof_io_ops; if (ops->get_next_file) Regards, Andrey