Re: Possible io_uring related race leads to btrfs data csum mismatch

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

 



On Sun, Aug 20, 2023 at 08:11:04AM -0600, Jens Axboe wrote:
> +static int io_get_single_event(struct io_event *event)
> +{
> +	int ret;
> +
> +	do {
> +		/*
> +		 * We can get -EINTR if competing with io_uring using signal
> +		 * based notifications. For that case, just retry the wait.
> +		 */
> +		ret = io_getevents(io_ctx, 1, 1, event, NULL);
> +		if (ret != -EINTR)
> +			break;
> +	} while (1);
> +
> +	return ret;
> +}

Is there a reason to prefer this style over:

	do {
		ret = io_getevents(io_ctx, 1, 1, event, NULL);
	} while (ret == -1 && errno == EINTR);

(we need to check errno, here, right?  Or is io_getevents() special
somehow?)




[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