Re: [PATCH] check kernel version for io_method - Mailing list pgsql-hackers

From Andreas Karlsson
Subject Re: [PATCH] check kernel version for io_method
Date
Msg-id d1b3e7c3-800d-4c5b-ac8e-f19373b7c0d3@proxel.se
Whole thread Raw
In response to Re: [PATCH] check kernel version for io_method  (Steven Niu <niushiji@gmail.com>)
List pgsql-hackers
On 1/14/26 3:31 AM, Steven Niu wrote:
> BTW, the error message in the following code block is wrong as it locates in branch that IO_URING is not enabled.
> 
> #else
> +    if (*newval == IOMETHOD_WORKER || *newval == IOMETHOD_SYNC)
> +    {
> +        /*
> +         * OK
> +         */
> +    }
> +    else
> +    {
> +        GUC_check_errdetail("io_uring requires Linux kernel 5.6 or later.");
> +        return false;
> +    }

That code is unreachable so it should just be deleted. Look at the enum.

/* Enum for io_method GUC. */
typedef enum IoMethod
{
    IOMETHOD_SYNC = 0,
    IOMETHOD_WORKER,
#ifdef IOMETHOD_IO_URING_ENABLED
    IOMETHOD_IO_URING,
#endif
}            IoMethod;

Andreas




pgsql-hackers by date:

Previous
From: Chao Li
Date:
Subject: Re: New year, new commitfest app improvements
Next
From: Chao Li
Date:
Subject: Re: Buffer locking is special (hints, checksums, AIO writes)