Re: [PATCH liburing 3/3] tests: add more file registration tests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 4/17/22 3:09 AM, Pavel Begunkov wrote:
> diff --git a/test/file-register.c b/test/file-register.c
> index bd15408..ee2fdcd 100644
> --- a/test/file-register.c
> +++ b/test/file-register.c
> @@ -745,7 +745,90 @@ static int test_fixed_removal_ordering(void)
>  	return 0;
>  }
>  
> +/* mix files requiring SCM-accounting and not in a single register */
> +static int test_mixed_af_unix(void)
> +{
> +	struct io_uring ring;
> +	int i, ret, fds[2];
> +	int reg_fds[32];
> +	int sp[2];
> +
> +	ret = io_uring_queue_init(8, &ring, 0);
> +	if (ret < 0) {
> +		fprintf(stderr, "failed to init io_uring: %s\n", strerror(-ret));
> +		return ret;
> +	}
> +	if (pipe(fds)) {
> +		perror("pipe");
> +		return -1;
> +	}
> +	if (socketpair(AF_UNIX, SOCK_DGRAM, 0, sp) != 0) {
> +		perror("Failed to create Unix-domain socket pair\n");
> +		return 1;
> +	}
> +
> +	for (i = 0; i < 16; i++) {
> +		reg_fds[i * 2] = fds[0];
> +		reg_fds[i * 2 + 1] = sp[0];
> +	}
>  
> +	ret = io_uring_register_files(&ring, reg_fds, 32);
> +	if (!ret) {
> +		fprintf(stderr, "file_register: %d\n", ret);
> +		return ret;
> +	}

This check looks wrong.

-- 
Jens Axboe




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux