All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-lvm] Patch for vg_status_with_pv_and_lv.c
@ 2003-03-03 12:56 Dale J. Stephenson
  2003-03-04  5:53 ` Heinz J . Mauelshagen
  0 siblings, 1 reply; 4+ messages in thread
From: Dale J. Stephenson @ 2003-03-03 12:56 UTC (permalink / raw)
  To: linux-lvm

A minor patch to prevent  a possible segfault -- if an error occurs 
getting the lv list, vg_setup_pointers_for_snapshot doesn't do well. 
 Patch was originally generated against 1.0.3, but the bug still seems 
to be in 1.0.6.

--- 1.0.3/tools/lib/vg_status_with_pv_and_lv.c.orig	Thu Apr 11 10:45:18 2002
+++ 1.0.3/tools/lib/vg_status_with_pv_and_lv.c	Thu Apr 11 10:45:41 2002
@@ -57,10 +57,10 @@
       for ( p = 0; pv[p] != NULL; p++) (*vg)->pv[p] = pv[p];
       for ( ; p < (*vg)->pv_max; p++) (*vg)->pv[p] = NULL;
       for ( l = 0; l < (*vg)->lv_max; l++) (*vg)->lv[l] = lv[l];
-   }
 
-   /* Set up core pointers for snapshots */
-   vg_setup_pointers_for_snapshots ( *vg);
+      /* Set up core pointers for snapshots */
+      vg_setup_pointers_for_snapshots ( *vg);
+   }
 
    debug_leave ( "vg_status_with_pv_and_lv -- LEAVING with ret: %d\n", ret);
    return ret;

^ permalink raw reply	[flat|nested] 4+ messages in thread
* [linux-lvm] Patch for vg_status_with_pv_and_lv.c
@ 2002-05-01 14:16 Stephenson, Dale
  2002-05-06  8:33 ` Heinz J . Mauelshagen
  0 siblings, 1 reply; 4+ messages in thread
From: Stephenson, Dale @ 2002-05-01 14:16 UTC (permalink / raw)
  To: 'linux-lvm@sistina.com'

I'm not sure if I sent this patch out when I generated it (I'm guessing not,
since it doesn't seem to be different in CVS), so I'm sending it out now.

This patch solves a segfault in lvscan.  When there was a problem reading
the lv_list (lv_status_all_lv_of_vg() returned an error) in
vg_status_with_pv_and_lv.c, the routine would still call
vg_setup_pointers_for_snapshots.  Since the error had prevented setting up
the vg->lv[] array, this didn't work.  I just moved
vg_setup_pointers_for_snapshot inside the no error case.  No one uses the vg
if an error is returned, so it doesn't matter that it isn't setup for
snapshots :->.

Dale J. Stephenson
steph@snapserver.com

--- 1.0.3/tools/lib/vg_status_with_pv_and_lv.c.orig	Thu Apr 11 10:45:18
2002
+++ 1.0.3/tools/lib/vg_status_with_pv_and_lv.c	Thu Apr 11 10:45:41 2002
@@ -57,10 +57,10 @@
       for ( p = 0; pv[p] != NULL; p++) (*vg)->pv[p] = pv[p];
       for ( ; p < (*vg)->pv_max; p++) (*vg)->pv[p] = NULL;
       for ( l = 0; l < (*vg)->lv_max; l++) (*vg)->lv[l] = lv[l];
-   }
 
-   /* Set up core pointers for snapshots */
-   vg_setup_pointers_for_snapshots ( *vg);
+      /* Set up core pointers for snapshots */
+      vg_setup_pointers_for_snapshots ( *vg);
+   }
 
    debug_leave ( "vg_status_with_pv_and_lv -- LEAVING with ret: %d\n",
ret);
    return ret;

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

end of thread, other threads:[~2003-03-04  5:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-03 12:56 [linux-lvm] Patch for vg_status_with_pv_and_lv.c Dale J. Stephenson
2003-03-04  5:53 ` Heinz J . Mauelshagen
  -- strict thread matches above, loose matches on Subject: below --
2002-05-01 14:16 Stephenson, Dale
2002-05-06  8:33 ` Heinz J . 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.