Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4097a79

Browse files
committed
Don't Insert() a VFD entry until it's fully built.
Otherwise, if FDDEBUG is enabled, the debugging output fails becauseit tries to read the fileName, which isn't set up yet (and should infact always be NULL).AFAICT, this has been wrong since Berkeley. Before96bf88d,it would accidentally fail to crash on platforms where snprintf()is forgiving about being passed a NULL pointer for %s; but thefile name intended to be included in the debug output wouldn'tever have shown up.Report and fix by Greg Nancarrow. Although this is only visiblybroken in custom-made builds, it still seems worth back-patchingto all supported branches, as the FDDEBUG code is pretty uselessas it stands.Discussion:https://postgr.es/m/CAJcOf-cUDgm9qYtC_B6XrC6MktMPNRby2p61EtSGZKnfotMArw@mail.gmail.com
1 parent54a9406 commit4097a79

File tree

1 file changed

+2
-2
lines changed
  • src/backend/storage/file

1 file changed

+2
-2
lines changed

‎src/backend/storage/file/fd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1374,8 +1374,6 @@ PathNameOpenFilePerm(const char *fileName, int fileFlags, mode_t fileMode)
13741374
DO_DB(elog(LOG,"PathNameOpenFile: success %d",
13751375
vfdP->fd));
13761376

1377-
Insert(file);
1378-
13791377
vfdP->fileName=fnamecopy;
13801378
/* Saved flags are adjusted to be OK for re-opening file */
13811379
vfdP->fileFlags=fileFlags& ~(O_CREAT |O_TRUNC |O_EXCL);
@@ -1384,6 +1382,8 @@ PathNameOpenFilePerm(const char *fileName, int fileFlags, mode_t fileMode)
13841382
vfdP->fdstate=0x0;
13851383
vfdP->resowner=NULL;
13861384

1385+
Insert(file);
1386+
13871387
returnfile;
13881388
}
13891389

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp