[PATCH][BUGFIX] : LVM1 Snapshots

From: Heinz Mauelshagen
Date: Wed Mar 10 2004 - 09:48:17 EST



Marcelo,

this patch fixes an LVM1 snapshot sector calculation causing a larger number
of pages in the call to expand_kiobuf() than needed, which causes snapshot
creates to fail on large memory systems and on ia64.

Please apply.

Regards,
Heinz -- The LVM Guy --


--- linux-2.4.26-pre2/drivers/md/lvm-snap.c 2004-03-03 17:36:50.000000000 +0100
+++ linux-2.4.26-pre2/drivers/md/lvm-snap.c.orig 2004-03-03 17:36:02.000000000 +0100
@@ -554,15 +554,17 @@

int lvm_snapshot_alloc(lv_t * lv_snap)
{
- int ret;
+ int ret, max_sectors;

/* allocate kiovec to do chunk io */
ret = alloc_kiovec(1, &lv_snap->lv_iobuf);
if (ret)
goto out;

- ret = lvm_snapshot_alloc_iobuf_pages(lv_snap->lv_iobuf,
- KIO_MAX_SECTORS);
+ max_sectors = KIO_MAX_SECTORS << (PAGE_SHIFT - 9);
+
+ ret =
+ lvm_snapshot_alloc_iobuf_pages(lv_snap->lv_iobuf, max_sectors);
if (ret)
goto out_free_kiovec;


*** Software bugs are stupid.
Nevertheless it needs not so stupid people to solve them ***

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Heinz Mauelshagen Red Hat GmbH
Consulting Development Engineer Am Sonnenhang 11
56242 Marienrachdorf
Germany
Mauelshagen@xxxxxxxxxx +49 2626 141200
FAX 924446
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/