* fio and zone support
@ 2018-07-10 15:32 Bart Van Assche
2018-07-10 15:36 ` Jens Axboe
0 siblings, 1 reply; 2+ messages in thread
From: Bart Van Assche @ 2018-07-10 15:32 UTC (permalink / raw)
To: axboe@kernel.dk; +Cc: fio@vger.kernel.org, gv.kovai@gmail.com
Hello Jens,
In __fill_io_u_zone() I found the following code (see also commit 224b3093cc21
("Fix zoning issue with seq-io and randommap issue")):
/*
* Wrap from the beginning, if we exceed the file size
*/
if (f->file_offset >= f->real_file_size)
f->file_offset = f->real_file_size - f->file_offset;
If f->file_offset > f->real_file_size then f->real_file_size - f->file_offset
will be negative and hence the above assignment will store a negative number
in f->file_offset. Is that what the above code is intended to do?
Thanks,
Bart.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: fio and zone support
2018-07-10 15:32 fio and zone support Bart Van Assche
@ 2018-07-10 15:36 ` Jens Axboe
0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2018-07-10 15:36 UTC (permalink / raw)
To: Bart Van Assche; +Cc: fio@vger.kernel.org, gv.kovai@gmail.com
On 7/10/18 9:32 AM, Bart Van Assche wrote:
> Hello Jens,
>
> In __fill_io_u_zone() I found the following code (see also commit 224b3093cc21
> ("Fix zoning issue with seq-io and randommap issue")):
>
> /*
> * Wrap from the beginning, if we exceed the file size
> */
> if (f->file_offset >= f->real_file_size)
> f->file_offset = f->real_file_size - f->file_offset;
>
> If f->file_offset > f->real_file_size then f->real_file_size - f->file_offset
> will be negative and hence the above assignment will store a negative number
> in f->file_offset. Is that what the above code is intended to do?
No, that looks wrong. But looking at the commit, it basically just moved
that code, so the issue predates that particular change.
--
Jens Axboe
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-07-10 15:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-10 15:32 fio and zone support Bart Van Assche
2018-07-10 15:36 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox