Skip to content

Commit d7fe02f

Browse files
committed
Fixup for prefetching support on macOS
The new code path (commit 6654bb9) should call FileAccess() first, like the posix_fadvise() path. Reported-by: Thomas Munro <thomas.munro@gmail.com> Discussion: https://www.postgresql.org/message-id/flat/0827edec-1317-4917-a186-035eb1e3241d%40eisentraut.org
1 parent 640178c commit d7fe02f

File tree

1 file changed

+4
-0
lines changed
  • src/backend/storage/file

1 file changed

+4
-0
lines changed

src/backend/storage/file/fd.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2110,6 +2110,10 @@ FilePrefetch(File file, off_t offset, off_t amount, uint32 wait_event_info)
21102110
} ra;
21112111
int returnCode;
21122112

2113+
returnCode = FileAccess(file);
2114+
if (returnCode < 0)
2115+
return returnCode;
2116+
21132117
ra.ra_offset = offset;
21142118
ra.ra_count = amount;
21152119
pgstat_report_wait_start(wait_event_info);

0 commit comments

Comments
 (0)