Re: [PATCH] check kernel version for io_method

From: Steven Niu <niushiji(at)gmail(dot)com>
To: Andreas Karlsson <andreas(at)proxel(dot)se>, Pierre <pierre(dot)forstmann(at)gmail(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [PATCH] check kernel version for io_method
Date: 2026-01-14 07:31:09
Message-ID: MN2PR15MB30219A576678B504EFB0380FA78FA@MN2PR15MB3021.namprd15.prod.outlook.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

From: Andreas Karlsson <andreas(at)proxel(dot)se>
Sent: Wednesday, January 14, 2026 15:27
To: Steven Niu <niushiji(at)gmail(dot)com>; Pierre <pierre(dot)forstmann(at)gmail(dot)com>; pgsql-hackers(at)lists(dot)postgresql(dot)org <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [PATCH] check kernel version for io_method

On 1/14/26 8:22 AM, Steven Niu wrote:
> I agree that you are correct for now. But in future, the IoMethod may have new member. Then we have to process it.
>
> How about change to like this:
>   + #else
>   +     if (*newval == IOMETHOD_IO_URING)
>   +     {
>   +             GUC_check_errdetail("io_uring not enabled.");
>   +             return false;
>   +     }

No, that would be incorrect. It would not even compile.
IOMETHOD_IO_URING is not even defined if we do not compile with liburing
enabled. You can try it out yourself by compiling PostgreSQL without
io_uring support and then try to enable it. You will get an error and
that code will never be reached.

Andreas

________________________________________

Yes, you are definitely correct.
I'd like to withdwar my proposal.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2026-01-14 07:33:20 Re: Remove redundant assignment in CreateWorkExprContext
Previous Message Andreas Karlsson 2026-01-14 07:27:07 Re: [PATCH] check kernel version for io_method