All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][BUGFIX] : LVM1 Snapshots
@ 2004-03-10 14:44 Heinz Mauelshagen
  0 siblings, 0 replies; only message in thread
From: Heinz Mauelshagen @ 2004-03-10 14:44 UTC (permalink / raw)
  To: marcelo.tosatti; +Cc: linux-kernel


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@RedHat.com                            +49 2626 141200
                                                       FAX 924446
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-03-10 14:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-10 14:44 [PATCH][BUGFIX] : LVM1 Snapshots Heinz Mauelshagen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.