88 *
99 *
1010 * IDENTIFICATION
11- * $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.101 2000/12/29 21 :31:21 tgl Exp $
11+ * $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.102 2001/01/08 18 :31:49 tgl Exp $
1212 *
1313 *-------------------------------------------------------------------------
1414 */
@@ -1977,7 +1977,10 @@ LockBuffer(Buffer buffer, int mode)
19771977* buflock &= ~BL_W_LOCK ;
19781978}
19791979else
1980+ {
1981+ S_UNLOCK (& (buf -> cntx_lock ));
19801982elog (ERROR ,"UNLockBuffer: buffer %lu is not locked" ,buffer );
1983+ }
19811984}
19821985else if (mode == BUFFER_LOCK_SHARE )
19831986{
@@ -2033,7 +2036,10 @@ LockBuffer(Buffer buffer, int mode)
20332036}
20342037}
20352038else
2039+ {
2040+ S_UNLOCK (& (buf -> cntx_lock ));
20362041elog (ERROR ,"LockBuffer: unknown lock mode %d" ,mode );
2042+ }
20372043
20382044S_UNLOCK (& (buf -> cntx_lock ));
20392045}
@@ -2122,11 +2128,11 @@ InitBufferIO(void)
21222128#endif
21232129
21242130/*
2131+ *Clean up any active buffer I/O after an error.
21252132 *This function is called from ProcReleaseSpins().
21262133 *BufMgrLock isn't held when this function is called.
2127- *BM_IO_ERROR is always set. If BM_IO_ERROR was already
2128- *set in case of output,this routine would kill all
2129- *backends and reset postmaster.
2134+ *
2135+ *If I/O was in progress, BM_IO_ERROR is always set.
21302136 */
21312137void
21322138AbortBufferIO (void )
@@ -2142,6 +2148,7 @@ AbortBufferIO(void)
21422148else
21432149{
21442150Assert (buf -> flags & BM_DIRTY || buf -> cntxDirty );
2151+ /* Issue notice if this is not the first failure... */
21452152if (buf -> flags & BM_IO_ERROR )
21462153{
21472154elog (NOTICE ,"write error may be permanent: cannot write block %u for %s/%s" ,