[LTP] [PATCH 1/2] syscalls/sync_file_range: add partial file sync test-case

Sumit Garg sumit.garg@linaro.org
Tue Mar 5 07:35:22 CET 2019


On Mon, 4 Mar 2019 at 20:10, Cyril Hrubis <chrubis@suse.cz> wrote:
>
> Hi!
> > +static void verify_sync_partial_file(void)
> > +{
> > +     int fd;
> > +     unsigned long written;
> > +
> > +     fd = SAFE_OPEN(FNAME, O_RDWR|O_CREAT, MODE);
> > +
> > +     lseek(fd, FILE_SIZE/4, SEEK_SET);
> > +
> > +     tst_dev_bytes_written(tst_device->dev);
> > +
> > +     tst_fill_fd(fd, 0xff, TST_MB, FILE_SIZE_MB/2);
>
> Any reason why we don't do full FILE_SIZE_MB write here and then check
> that the result was somewhere between FILE_SIZE/2 +-10% ?
>

Don't have any compelling reason to not do full file write. So will
write whole file and test sync for particular portion of file
(FILE_SIZE/4 to 3*FILE_SIZE/4).

-Sumit

> Other than that the patch looks good.
>
> --
> Cyril Hrubis
> chrubis@suse.cz


More information about the ltp mailing list