--- bdbuf.old.c	2005-07-04 15:21:52.000000000 +0400
+++ bdbuf.c	2005-07-04 15:23:28.000000000 +0400
@@ -1545,7 +1545,7 @@
          * and release semaphore */
         if (bd_buf->use_count == 0)
         {
-            if (bd_buf->modified)
+            if ((bd_buf->status != RTEMS_IO_ERROR) && (bd_buf->modified))
             {
                 Chain_Append(&bd_ctx.mod, &bd_buf->link);
                 rc = rtems_semaphore_release(bd_ctx.flush_sema);
