[LTP] [PATCH RFC] sync_file_range02: remove the toplimit of write back

Sumit Garg sumit.garg@linaro.org
Tue Dec 31 08:41:05 CET 2019


On Tue, 31 Dec 2019 at 13:02, Li Wang <liwang@redhat.com> wrote:
>
>
>
> On Tue, Dec 31, 2019 at 3:05 PM Yang Xu <xuyang2018.jy@cn.fujitsu.com> wrote:
>>
>> ...
>> >>     I have tried this for many different systems, and it doesn't hit
>> >>     the failure at least one time. So if no more comments, I would
>> >>     merge the patch as below in the next step.
>> >
>> >     I have a question.we must call sync()? I think syncfs is more accurate.
>> >
>> >
>> > Here we use sync() is to make fs metadata/cache being written back
>> > before testing because there is no obtainable file descriptor 'fd' for
>> > the ext4 deferred IO (e.g. initialize the journal and inode tables).
>
>
>>
>> I see. For other test cases using tst_dev_bytes_written api such as
>> fdatasync03.c,  we also need to call sync() to make this written value
>> more accurate.  What do you think about it?
>
>
> Good point. I think we should take care of them as we do for sync_file_range02 too. It will more easily report fail in the case of a situation that synced data is less than expected.
>
> $ git grep tst_dev_bytes_written
> kernel/syscalls/fdatasync/fdatasync03.c:        tst_dev_bytes_written(tst_device->dev);
> kernel/syscalls/fdatasync/fdatasync03.c:        written = tst_dev_bytes_written(tst_device->dev);
> kernel/syscalls/fsync/fsync04.c:        tst_dev_bytes_written(tst_device->dev);
> kernel/syscalls/fsync/fsync04.c:        written = tst_dev_bytes_written(tst_device->dev);
> kernel/syscalls/sync/sync03.c:  tst_dev_bytes_written(tst_device->dev);
> kernel/syscalls/sync/sync03.c:  written = tst_dev_bytes_written(tst_device->dev);
> kernel/syscalls/sync_file_range/sync_file_range02.c:    tst_dev_bytes_written(tst_device->dev);
> kernel/syscalls/sync_file_range/sync_file_range02.c:    written = tst_dev_bytes_written(tst_device->dev);
> kernel/syscalls/syncfs/syncfs01.c:      tst_dev_bytes_written(tst_device->dev);
> kernel/syscalls/syncfs/syncfs01.c:      written = tst_dev_bytes_written(tst_device->dev);
>

Agree.

-Sumit

> --
> Regards,
> Li Wang


More information about the ltp mailing list