[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#545999: Acknowledgement (linux-image-2.6.26-2-amd64: OOPS when using two lvm2 snapshots of one volume)



I've found a patch that fixes this issue. Details are here:

https://bugzilla.redhat.com/show_bug.cgi?id=465825

The patch:
diff -p -u -r linux-2.6.18.x86_64.orig/drivers/md/dm-snap.c
linux-2.6.18.x86_64/drivers/md/dm-snap.c
--- linux-2.6.18.x86_64.orig/drivers/md/dm-snap.c       2008-10-14
00:45:00.000000000 +0200
+++ linux-2.6.18.x86_64/drivers/md/dm-snap.c    2008-10-14
16:18:27.000000000 +0200
@@ -826,8 +826,10 @@ static struct bio *put_pending_exception
         * the bios for the original write to the origin.
         */
        if (primary_pe &&
-           atomic_dec_and_test(&primary_pe->ref_count))
+           atomic_dec_and_test(&primary_pe->ref_count)) {
                origin_bios = bio_list_get(&primary_pe->origin_bios);
+               free_pending_exception(primary_pe);
+       }

        /*
         * Free the pe if it's not linked to an origin write or if
@@ -836,12 +838,6 @@ static struct bio *put_pending_exception
        if (!primary_pe || primary_pe != pe)
                free_pending_exception(pe);

-       /*
-        * Free the primary pe if nothing references it.
-        */
-       if (primary_pe && !atomic_read(&primary_pe->ref_count))
-               free_pending_exception(primary_pe);
-
        return origin_bios;
 }

I have verified it on my system and it seems to work. I can now create
multiple snapshots and do lots of IO without my system going down.



Reply to: