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

Cyril Hrubis chrubis@suse.cz
Mon Mar 4 15:40:00 CET 2019


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% ?

Other than that the patch looks good.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list