All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Thornber <thornber@btconnect.com>
To: linux-lvm@sistina.com
Subject: Re: [linux-lvm] lvcreate segfault in vg_setup_pointers_for_snapshots
Date: Thu, 4 Oct 2001 12:05:03 +0100	[thread overview]
Message-ID: <20011004120503.A3373@btconnect.com> (raw)
In-Reply-To: <Pine.LNX.4.33.0110041120590.14465-100000@dunlop.dub.ie.alphyra.com>; from paulj@alphyra.ie on Thu, Oct 04, 2001 at 11:31:15AM +0100

On Thu, Oct 04, 2001 at 11:31:15AM +0100, Paul Jakma wrote:
> ok... looking at tools/lib/vg_setup_pointers_for_snapshots():
> 
>  if ( vg == NULL) goto vg_setup_pointers_for_snapshots_end;
>    for ( l = 0; l < vg->lv_max; l++) {
>       lv_t *lv_chain_ptr = vg->lv[l];
>       if ( lv_chain_ptr == NULL) continue;
>       if ( lv_chain_ptr->lv_access & LV_SNAPSHOT_ORG) {
> 
> isn't this a wee bit suspect? we test for NULL /after/ the assignment, 
> and continue anyway? next line deferences that pointer, irregardless 
> of the test for previously..

No, this snippet looks right to me.  How can we test before the assignment ?
If lv_chain_ptr is NULL the code then jumps back to the top of the 'for' loop.

- Joe

  reply	other threads:[~2001-10-04 11:05 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-03 15:30 [linux-lvm] lvcreate segfault in vg_setup_pointers_for_snapshots Paul Jakma
2001-10-03 18:22 ` Paul Jakma
2001-10-03 19:00   ` Paul Jakma
2001-10-03 19:12     ` svetljo
2001-10-03 19:30       ` Andreas Dilger
2001-10-03 19:40         ` svetljo
2001-10-03 19:52           ` Paul Jakma
2001-10-03 20:44             ` svetljo
2001-10-03 19:56         ` Paul Jakma
2001-10-04  0:45         ` Paul Jakma
2001-10-04  2:54           ` [linux-lvm] What have I done!? Jason A. Lixfeld
2001-10-04  3:06             ` Jason A. Lixfeld
2001-10-04  5:44             ` idsfa
2001-10-04 11:00               ` Jason A. Lixfeld
2001-10-04 11:24                 ` Jason A. Lixfeld
2001-10-04 17:33                   ` Andreas Dilger
2001-10-04 17:57                     ` Steven Lembark
2001-10-05  7:05                       ` Heinz J . Mauelshagen
2001-10-04  3:28           ` [linux-lvm] lvcreate segfault in vg_setup_pointers_for_snapshots Jason A. Lixfeld
2001-10-04  3:33             ` Andreas Dilger
2001-10-04  3:46               ` Jason A. Lixfeld
2001-10-04  6:04                 ` Andreas Dilger
2001-10-04  7:05                   ` Sean Burford
2001-10-04 10:31                   ` Paul Jakma
2001-10-04 11:05                     ` Joe Thornber [this message]
2001-10-04 14:51                       ` Paul Jakma
2001-10-04 11:38                   ` Jason A. Lixfeld
2001-10-04 14:01                     ` Jason A. Lixfeld
2001-10-04 14:23                       ` Jason A. Lixfeld
2001-10-04 15:57                         ` Jason A. Lixfeld
2001-10-04 20:12                           ` Goetz Bock

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=20011004120503.A3373@btconnect.com \
    --to=thornber@btconnect.com \
    --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.