Re: Typos in smgr.c

From: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
To: Сергей Шиндерук <s(dot)shinderuk(at)postgrespro(dot)ru>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Typos in smgr.c
Date: 2026-07-29 07:37:08
Message-ID: C333CC74-A773-4995-B873-51720A1AF37A@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On Jul 29, 2026, at 15:21, Сергей Шиндерук <s(dot)shinderuk(at)postgrespro(dot)ru> wrote:
>
> Hello,
>
> while reading the code I spotted a couple of typos in smgr.c. Please see attached.
>
> Looks like PgAioTargetData.smgr.skip_fsync is not used anywhere.
>
> Best regards,
> Sergey Shinderuk
> https://postgrespro.com/
>
> <typos-in-smgr.diff>

1.
```
- * If more than one block is intended to be read, callers need to use
+ * If more than one block is intended to be written, callers need to use
```

Yep, this seems like a copy-pasto.

2.
```
@@ -1053,7 +1053,7 @@ pgaio_io_set_target_smgr(PgAioHandle *ioh,
sd->smgr.nblocks = nblocks;
sd->smgr.is_temp = SmgrIsTemp(smgr);
/* Temp relations should never be fsync'd */
- sd->smgr.skip_fsync = skip_fsync && !SmgrIsTemp(smgr);
+ sd->smgr.skip_fsync = skip_fsync || SmgrIsTemp(smgr);
```

This is actually a bug fix. The current code incorrectly sets skip_fsync to false for every temporary relation, but temporary relations should not be fsynced.

Maybe worth adding a test under src/test/modules/test_aio.

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/

In response to

  • Typos in smgr.c at 2026-07-29 07:21:30 from Сергей Шиндерук

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Yuefei Shi 2026-07-29 08:05:39 Re: Typos in smgr.c
Previous Message Сергей Шиндерук 2026-07-29 07:21:30 Typos in smgr.c