public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Heinz Mauelshagen <hjm@redhat.com>
To: marcelo.tosatti@cyclades.com.br
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH][BUGFIX] : LVM1 Snapshots
Date: Wed, 10 Mar 2004 15:44:38 +0100	[thread overview]
Message-ID: <20040310144438.GE3065@redhat.com> (raw)


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
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

                 reply	other threads:[~2004-03-10 14:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040310144438.GE3065@redhat.com \
    --to=hjm@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo.tosatti@cyclades.com.br \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox