Skip to contentSkip to conversation

fio and zone support

DISCUSSION Bart Van Assche 2 participants 2 messages Jul 10, 2018

lore
Share & tools
lore
#0 lore raw

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.

#1 lore raw
Quoted 11 lines · Bart Van Assche

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;
Quoted 3 lines

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.

Signature · 1 line
Jens Axboe