Add some diagnostics for snapshots. Index: current-quilt-publish/drivers/md/dm-snap.c =================================================================== --- current-quilt-publish.orig/drivers/md/dm-snap.c 2006-01-05 14:26:06.000000000 +0000 +++ current-quilt-publish/drivers/md/dm-snap.c 2006-01-05 14:26:06.000000000 +0000 @@ -934,7 +934,7 @@ static int __origin_write(struct list_he int r = 1, first = 1; struct dm_snapshot *snap; struct exception *e; - struct pending_exception *pe, *last = NULL; + struct pending_exception *pe, *next_pe, *last = NULL; chunk_t chunk; /* Do all the snapshots on this origin */ @@ -990,6 +990,8 @@ static int __origin_write(struct list_he down_write(&pe->snap->lock); if (first) bio_list_add(&pe->origin_bios, bio); + next_pe = list_entry(pe->siblings.next, + struct pending_exception, siblings); if (!pe->started) { pe->started = 1; up_write(&pe->snap->lock); @@ -999,7 +1001,11 @@ static int __origin_write(struct list_he first = 0; pe = list_entry(pe->siblings.next, struct pending_exception, siblings); - + if (pe != next_pe) { + printk(KERN_ERR "%s(%s,%d): pending exception with changed sibling: next_pe=%p pe=%p last=%p\n", + __FUNCTION__, current->comm, current->pid, next_pe, pe, last); + dump_stack(); + } } while (pe != last); }