Re: BufFileRead() error signalling

From: Ibrar Ahmed <ibrar(dot)ahmad(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Cc: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Subject: Re: BufFileRead() error signalling
Date: 2019-12-10 13:06:19
Message-ID: 157598317991.13092.10640296975039971799.pgcf@coridan.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

You are checking file->dirty twice, first before calling the function and within the function too. Same for the Assert. For example.
size_t
BufFileRead(BufFile *file, void *ptr, size_t size)
{  
     size_t      nread = 0;
     size_t      nthistime;
     if (file->dirty)
     {  
         BufFileFlush(file);
         Assert(!file->dirty);
     }
static void
 BufFileFlush(BufFile *file)
 {
     if (file->dirty)
         BufFileDumpBuffer(file);
     Assert(!file->dirty);

The new status of this patch is: Waiting on Author

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ranier Vilela 2019-12-10 13:20:57 RE: [Proposal] Level4 Warnings show many shadow vars
Previous Message Karl O. Pinc 2019-12-10 12:56:33 Re: proposal: minscale, rtrim, btrim functions for numeric