]> granicus.if.org Git - postgresql/commit
Fix failure to restart Postgres when Linux kernel returns EIDRM for shmctl().
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 2 Jul 2007 20:12:11 +0000 (20:12 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 2 Jul 2007 20:12:11 +0000 (20:12 +0000)
commit54faed3bc58b6a40ea5209043f5d7cf67e781505
treef4140f2ec7e48606f98aaedbf60a816a4991c9a8
parent2f5c37e94ae85cab84419f43795945edbabae967
Fix failure to restart Postgres when Linux kernel returns EIDRM for shmctl().

This is a Linux kernel bug that apparently exists in every extant kernel
version: sometimes shmctl() will fail with EIDRM when EINVAL is correct.
We were assuming that EIDRM indicates a possible conflict with pre-existing
backends, and refusing to start the postmaster when this happens.  Fortunately,
there does not seem to be any case where Linux can legitimately return EIDRM
(it doesn't track shmem segments in a way that would allow that), so we can
get away with just assuming that EIDRM means EINVAL on this platform.

Per reports from Michael Fuhr and Jon Lapham --- it's a bit surprising
we have not seen more reports, actually.
src/backend/port/sysv_shmem.c
src/include/port/linux.h