8
8
*
9
9
*
10
10
* 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 $
12
12
*
13
13
*-------------------------------------------------------------------------
14
14
*/
@@ -1977,7 +1977,10 @@ LockBuffer(Buffer buffer, int mode)
1977
1977
* buflock &= ~BL_W_LOCK ;
1978
1978
}
1979
1979
else
1980
+ {
1981
+ S_UNLOCK (& (buf -> cntx_lock ));
1980
1982
elog (ERROR , "UNLockBuffer: buffer %lu is not locked" , buffer );
1983
+ }
1981
1984
}
1982
1985
else if (mode == BUFFER_LOCK_SHARE )
1983
1986
{
@@ -2033,7 +2036,10 @@ LockBuffer(Buffer buffer, int mode)
2033
2036
}
2034
2037
}
2035
2038
else
2039
+ {
2040
+ S_UNLOCK (& (buf -> cntx_lock ));
2036
2041
elog (ERROR , "LockBuffer: unknown lock mode %d" , mode );
2042
+ }
2037
2043
2038
2044
S_UNLOCK (& (buf -> cntx_lock ));
2039
2045
}
@@ -2122,11 +2128,11 @@ InitBufferIO(void)
2122
2128
#endif
2123
2129
2124
2130
/*
2131
+ * Clean up any active buffer I/O after an error.
2125
2132
* This function is called from ProcReleaseSpins().
2126
2133
* 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.
2130
2136
*/
2131
2137
void
2132
2138
AbortBufferIO (void )
@@ -2142,6 +2148,7 @@ AbortBufferIO(void)
2142
2148
else
2143
2149
{
2144
2150
Assert (buf -> flags & BM_DIRTY || buf -> cntxDirty );
2151
+ /* Issue notice if this is not the first failure... */
2145
2152
if (buf -> flags & BM_IO_ERROR )
2146
2153
{
2147
2154
elog (NOTICE , "write error may be permanent: cannot write block %u for %s/%s" ,
0 commit comments