All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-lvm] Re: Here we go again: vgscan doesn't see my volume groups.
@ 2001-11-26 11:25 Lars Kellogg-Stedman
  2001-11-26 12:00 ` Andreas Dilger
  0 siblings, 1 reply; 4+ messages in thread
From: Lars Kellogg-Stedman @ 2001-11-26 11:25 UTC (permalink / raw)
  To: linux-lvm

> This is a different problem than what I encountered earlier, which
> appeared to be a problem with software RAID devices that went away
> when
> I upgraded to the latest code from CVS.  I'm now using whatever was
> in
> CVS as of Monday Nov. 19.

I've upgraded the userspace tools to today's CVS code.  There's not
much I can do with the kernel until *after* I'm able to access the
volume group again.

There doesn't appear to be any chance in behavior with the updated
tools.

Is there any way for me to determine *why* the lvm tools won't assemble
this volume group?  Vgscan isn't giving me any errors, and the debug
output, while copious, doesn't really help me much.

Thanks,

-- Lars


=====
lars@larsshack.org

__________________________________________________
Do You Yahoo!?
Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1

^ permalink raw reply	[flat|nested] 4+ messages in thread
* [linux-lvm] Re: Here we go again: vgscan doesn't see my volume groups.
@ 2001-11-26 23:20 Lars Kellogg-Stedman
  0 siblings, 0 replies; 4+ messages in thread
From: Lars Kellogg-Stedman @ 2001-11-26 23:20 UTC (permalink / raw)
  To: lvm-devel; +Cc: linux-lvm

Arrrgh, after much fiddling with floppies, as I trundle patched code between my
laptop and my hosed machine, this looks partly like a bug in LVM.

Specifically, in tools/lib/pv_read_all_pv_of_vg.c, in this section of code:

          /* make array contiguous again */
          for ( i = 0; i < np - 2; i++) {
             if ( pv_this[i] == NULL) {
                /* ensure we don't have a sequence of NULLs */
                if ( pv_this[i+1] == NULL) {
                   int j = i + 1;
                   while ( pv_this[j] == NULL && j < np - 1) j++;
                   if ( j < np - 1) pv_this[i+1] = pv_this[j];
                }
                pv_this[i] = pv_this[i+1];
                pv_this[i+1] = NULL;
             }
          }
          np=0;
          while ( pv_this[np] != NULL) np++;

Let's step through this.  Before multiple path/md handling, pv_this[] looked
like this:

  [0] /dev/md0
  [1] /dev/sda
  [2] /dev/sde3
  [3] /dev/sde4

pv_this[1] is set to NULL, because sda is part of md0, so we enter the
above section of code with pv_this[] looking like this:

  [0] /dev/md0
  [1] NULL
  [2] /dev/sde3
  [3] /dev/sde4

In the first iteration of the loop (i=0) nothing changes.

In the second iteration of this loop (i=1), we encounter a NULL value, so
we shift the list down one and set the following element to NULL, leaving us
with:

  [0] /dev/md0
  [1] /dev/sde3
  [2] NULL
  [3] /dev/sde4

And that's it.  Due to the loop condition (i < np - 2), the loop exits,
since np=4 and i would be 2 in the next iteration.  The following code:

          while ( pv_this[np] != NULL) np++;

Will end up setting np to 2, since the NULL value in pv_this[2] will cause
the loop to exit.

I think this loop will work as intended if the loop condition were
i < np -1.  In our situtation, this would cause one more iteration of the loop, and the NULL value in pv_this[2] would cause another shift to occur leaving us with:

  [0] /dev/md0
  [1] /dev/sde3
  [2] /dev/sde4
  [3] NULL

Which looks just great.  I'm ignoring the sub-loop (...ensure we don't have
a sequence of NULLs...) for now, but it probably needs fixing.

I'm about to go check this out.  I noticed that there is@least one other
place in this file that may have a similar problem.  Results in a few minutes.

-- Lars

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2001-11-26 23:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-11-26 11:25 [linux-lvm] Re: Here we go again: vgscan doesn't see my volume groups Lars Kellogg-Stedman
2001-11-26 12:00 ` Andreas Dilger
2001-11-26 14:11   ` Lars Kellogg-Stedman
  -- strict thread matches above, loose matches on Subject: below --
2001-11-26 23:20 Lars Kellogg-Stedman

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.