Re: Incorrect errno used with %m for backend code - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Incorrect errno used with %m for backend code
Date
Msg-id 20180622091454.GA16899@paquier.xyz
Whole thread Raw
In response to Re: Incorrect errno used with %m for backend code  (Ashutosh Sharma <ashu.coek88@gmail.com>)
Responses Re: Incorrect errno used with %m for backend code
List pgsql-hackers
On Fri, Jun 22, 2018 at 01:00:45PM +0530, Ashutosh Sharma wrote:
> It seems like in case of few system calls for e.g. write system call,
> errno is not set even if the number of bytes written is smaller than
> the bytes requested and for such cases we explicitly set an errno to
> ENOSPC. Something like this,
>
>                 /*
>                  * if write didn't set errno, assume problem is no disk space
>                  */
>                 errno = save_errno ? save_errno : ENOSPC;
>
> Shouldn't we do similar handling in your patch as well or please let
> me know if i am missing something here.

Yeah, I can see at least three of them in twophase.c.  Let's fix those
as well at the same time.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Chris Travers
Date:
Subject: utilities to rebuild commit logs from wal
Next
From: Amit Kapila
Date:
Subject: Re: server crashed with TRAP: FailedAssertion("!(!parallel_aware || pathnode->path.parallel_safe)"