[LTP] [PATCH v2 3/3] tst_fill_fs: Add alternate access pattern "flat"

Richard Palethorpe rpalethorpe@suse.de
Mon Dec 12 17:20:23 CET 2022


Hello,

Cyril Hrubis <chrubis@suse.cz> writes:

> Hi!
>> > Depending on the workload, the way in which a file system is filled
>> > will be different. The system calls will also be different.
>> 
>> > This adds a fill mode which uses writev with uniform batches of
>> > data. This simulates when the FS is filled by a program which batches
>> > writes.
>> ...
>> 
>> FYI this broke CI on Alpine.
>> 
>> > +++ b/lib/tst_fill_fs.c
>> ...
>> > +void fill_flat_vec(const char *path, int verbose)
>> > +{
>> > +	int dir = SAFE_OPEN(path, O_PATH | O_DIRECTORY | O_FSYNC);
>> 
>> Alpine has problem with O_FSYNC:
>> 
>> In file included from ../include/tst_test.h:110,
>>                  from tst_fill_fs.c:13:
>> tst_fill_fs.c: In function 'fill_flat_vec':
>> tst_fill_fs.c:76:58: error: 'O_FSYNC' undeclared (first use in this function); did you mean 'O_ASYNC'?
>>    76 |         int dir = SAFE_OPEN(path, O_PATH | O_DIRECTORY | O_FSYNC);
>>       |                                                          ^~~~~~~
>> ../include/tst_safe_macros.h:90:58: note: in definition of macro 'SAFE_OPEN'
>>    90 |         safe_open(__FILE__, __LINE__, NULL, (pathname), (oflags), \
>>       |                                                          ^~~~~~
>> tst_fill_fs.c:76:58: note: each undeclared identifier is reported only once for each function it appears in
>>    76 |         int dir = SAFE_OPEN(path, O_PATH | O_DIRECTORY | O_FSYNC);
>>       |                                                          ^~~~~~~
>> ../include/tst_safe_macros.h:90:58: note: in definition of macro 'SAFE_OPEN'
>>    90 |         safe_open(__FILE__, __LINE__, NULL, (pathname), (oflags), \
>>       |                                                          ^~~~~~
>> make: *** [../include/mk/rules.mk:15: tst_fill_fs.o] Error 1
>> 
>> It actually does not have it in fcntl.h (and nowhere in the sources).
>
> O_FSYNC originates from BSD it should be O_SYNC on Linux, but given that
> this is only file descriptor passed to later openat() we can just remove
> it instead since it does not make sense at all.

Ah, that was supposed to be added to the next open. However I guess it
can just be removed.

-- 
Thank you,
Richard.


More information about the ltp mailing list