The unified diff between revisions [eeec8cbf..] and [bb59f6ce..] is displayed below. It can also be downloaded as a raw diff.

#
#
# patch "src/fs/coss/store_io_coss.c"
#  from [d903b5fc046ce7be75b5c1584e88fec70a8c0a22]
#    to [58268fcef5532d82fa407f8dbf909e78282df2e0]
#
============================================================
--- src/fs/coss/store_io_coss.c	d903b5fc046ce7be75b5c1584e88fec70a8c0a22
+++ src/fs/coss/store_io_coss.c	58268fcef5532d82fa407f8dbf909e78282df2e0
@@ -651,7 +651,7 @@ storeCossCreateMemBuf(SwapDir * SD, int
 {
     CossMemBuf *newmb, *t;
     StoreEntry *e;
-    dlink_node *m;
+    dlink_node *m, *n;
     int numreleased = 0;
     CossInfo *cs = (CossInfo *) SD->fsdata;
     off_t start = (off_t) stripe * COSS_MEMBUF_SZ;
@@ -688,16 +688,19 @@ storeCossCreateMemBuf(SwapDir * SD, int
     /*
      * Kill objects from the tail to make space for a new chunk
      */
-    while (cs->stripes[stripe].objlist.head != NULL) {
-        m = cs->stripes[stripe].objlist.head;
+    m = cs->stripes[stripe].objlist.head;
+    while (m != NULL) {
+	n = m->next;
 	off_t o;
 	e = m->data;
 	o = storeCossFilenoToDiskOffset(e->swap_filen, cs);
-	if (curfn == e->swap_filen)
+	if (curfn > -1 && curfn == e->swap_filen)
 	    *collision = 1;	/* Mark an object alloc collision */
 	assert((o >= newmb->diskstart) && (o < newmb->diskend));
+	debug(79, 5) ("check: %s: stripe %d, releasing %x\n", SD->path, stripe, e);
 	storeRelease(e);
 	numreleased++;
+	m = n;
     }
     if (numreleased > 0)
 	debug(79, 3) ("storeCossCreateMemBuf: this allocation released %d storeEntries\n", numreleased);