All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ragnar Kjørstad" <lvm@ragnark.vestdata.no>
To: linux-lvm@sistina.com
Subject: Re: [linux-lvm] pv_move_pe() error again :/
Date: Mon, 10 Sep 2001 00:16:43 +0200	[thread overview]
Message-ID: <20010910001643.A19424@vestdata.no> (raw)
In-Reply-To: <E15fJux-0005Kk-00@hermes.sistina.com>; from fejf@gmx.de on Fri, Sep 07, 2001 at 01:36:16PM +0200

[-- Attachment #1: Type: text/plain, Size: 1355 bytes --]


OK, this is the patch.

With this patch pe_move will not even try to lock the extent before
moving it. (because it would fail). I'm not sure exactly what
implications that has, but I would avoid using LVM when you're running
pe_move. I also removed the code that unlock the extent - but only for
the standard execution path - if any other errors occur pe_move will try
to unlock the extent. 

Another problem is that the file possition in the source is undefined
after a failed read - so if you move several extents at the same time,
chances are that pe_move will read the broken extent over and over
again, instead of reading first the broken extent and then other extent
- it will in other words destroy your data.

This patch was written specificly to fix a problem with LVM on one of
our workstations, and it is not intended for general use! If you still
choose to try it, i recommend first moving all the extents you can move
with the regular pe_move command - then install this one and move the
remaining extents one by one.

Be aware that you have to do make install to use it (or use
LD_LIBRARY_PATH), as the library is linken in dynamicly - if you do make
install - be sure to install the proper utilities afterwards so you
don't risk running this modified pe_move by accident later.

You have been warned....



-- 
Ragnar Kjorstad
Big Storage

[-- Attachment #2: LVM_ignore_read_errors.patch2 --]
[-- Type: text/plain, Size: 1553 bytes --]

diff -u -r LVM/1.0.1-rc2/tools/lib/pv_move.c LVM_ignore_read_errors/1.0.1-rc2/tools/lib/pv_move.c
--- LVM/1.0.1-rc2/tools/lib/pv_move.c	Thu Jul 19 17:19:01 2001
+++ LVM_ignore_read_errors/1.0.1-rc2/tools/lib/pv_move.c	Mon Sep 10 00:06:47 2001
@@ -494,12 +494,14 @@
    if ( opt_t == 0) {
       int lv_num = vg->pv[dst_pv_index]->pe[pe_dest].lv_num;
 
+/* Don't even try to lock
       if ( ( ret = pe_lock ( vg->vg_name, vg->pv[src_pv_index]->pv_dev,
                              le_remap_req.old_pe, vg->vg_number,
                              lv_num, vg->lv[lv_num-1]->lv_dev)) < 0) {
          ret = -LVM_EPV_MOVE_PE_LOCK;
-         goto pv_move_pe_end;
+         goto pv_move_pe_end; 
       }
+*/
    }
 
 
@@ -521,9 +523,13 @@
             fprintf ( stderr, "%s -- ERROR reading input "
                               "physical volume \"%s\" (still %d bytes to read)\n\n",
                       cmd, vg->pv[src_pv_index]->pv_name, size);
+	    fprintf( stderr, " -- IGNORED \n");
+	/*
             pe_unlock ( vg->vg_name);
             ret = -LVM_EPV_MOVE_PE_READ_IN;
             goto pv_move_pe_end;
+	*/
+	    red=to_read;
          }
          to_write = red;
       }
@@ -570,8 +576,9 @@
                            cmd, lvm_error ( ret),
                            pe_source,
                            vg->pv[src_pv_index]->pv_name);
-         ret = -LVM_EPV_MOVE_PE_UNLOCK;
-         goto pv_move_pe_end;
+	fprintf( stderr, "IGNORED\n");
+     /*    ret = -LVM_EPV_MOVE_PE_UNLOCK;
+         goto pv_move_pe_end; */
       }
    }
 

  reply	other threads:[~2001-09-09 22:16 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-06 15:28 [linux-lvm] pv_move_pe() error again :/ FEJF
2001-09-06 20:05 ` Ragnar Kjørstad
2001-09-06 23:41   ` FEJF
2001-09-07  9:43     ` Ragnar Kjørstad
2001-09-07 11:36       ` FEJF
2001-09-09 22:16         ` Ragnar Kjørstad [this message]
2001-09-09 23:51           ` FEJF
2001-09-10  8:39             ` Ragnar Kjørstad
2001-09-10 11:27               ` Heinz J . Mauelshagen
2001-09-10 11:45                 ` FEJF
2001-09-10 13:43                   ` Heinz J . Mauelshagen
2001-09-10 13:49                     ` FEJF
2001-09-10 15:38                 ` Ragnar Kjørstad
2001-09-10 16:13                   ` FEJF
2001-09-11 14:31                   ` Heinz J . Mauelshagen
2001-09-11 17:26                     ` Ragnar Kjørstad
2001-09-10 11:53               ` FEJF
2001-09-07 10:46     ` Heinz J . Mauelshagen
2001-09-07 11:45       ` FEJF

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=20010910001643.A19424@vestdata.no \
    --to=lvm@ragnark.vestdata.no \
    --cc=linux-lvm@sistina.com \
    /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 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.