* Missing code in options.c ?
@ 2014-04-02 9:07 Erwan Velu
2014-04-02 14:27 ` Jens Axboe
0 siblings, 1 reply; 2+ messages in thread
From: Erwan Velu @ 2014-04-02 9:07 UTC (permalink / raw)
To: fio
Hi Jens,
Sorry for spawning many emails but I think it's easier to follow having
an email per problem instead of long emails with mixed stuff in it.
In options.c, we can see that :
http://git.kernel.dk/?p=fio.git;a=blob;f=options.c;h=4a54c98c15045864931ea503d3f7920bab4ae431;hb=HEAD#l212
ret = bssplit_ddir(&td->o, DDIR_READ, str) is performed while ret can be
already setup in the previous line. I'm not mastering this part but I
wonder what is lacks :
- a missing if (!ret) ?
- some strdup + free around ? Does using str directly is safe here ?
Wouldn't be easier to read to get some goto to the global free code at
the end of the function instead of a multiple chained if (!ret) {} ?
Cheers,
Erwan,
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Missing code in options.c ?
2014-04-02 9:07 Missing code in options.c ? Erwan Velu
@ 2014-04-02 14:27 ` Jens Axboe
0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2014-04-02 14:27 UTC (permalink / raw)
To: Erwan Velu, fio
On 2014-04-02 03:07, Erwan Velu wrote:
> Hi Jens,
>
> Sorry for spawning many emails but I think it's easier to follow having
> an email per problem instead of long emails with mixed stuff in it.
No worries, we like hearing about bugs we can get fixed :-)
> In options.c, we can see that :
> http://git.kernel.dk/?p=fio.git;a=blob;f=options.c;h=4a54c98c15045864931ea503d3f7920bab4ae431;hb=HEAD#l212
>
>
> ret = bssplit_ddir(&td->o, DDIR_READ, str) is performed while ret can be
> already setup in the previous line. I'm not mastering this part but I
> wonder what is lacks :
>
> - a missing if (!ret) ?
> - some strdup + free around ? Does using str directly is safe here ?
>
> Wouldn't be easier to read to get some goto to the global free code at
> the end of the function instead of a multiple chained if (!ret) {} ?
I need to take a closer look at that part. It does look a bit messy.
--
Jens Axboe
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-04-02 14:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-02 9:07 Missing code in options.c ? Erwan Velu
2014-04-02 14:27 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox