linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Chris Mason <mason@suse.com>
To: linux-lvm@sistina.com
Subject: Re: [linux-lvm] [PATCH] fix oops when snapshots get full
Date: Thu, 11 Oct 2001 17:03:14 -0400	[thread overview]
Message-ID: <1532480000.1002834194@tiny> (raw)
In-Reply-To: <20011011135715.G8382@turbolinux.com>


On Thursday, October 11, 2001 01:57:15 PM -0600 Andreas Dilger <adilger@turbolabs.com> wrote:


> I was looking at this, and thought the following:
> 
> 1) Shouldn't we just initialize r=1 in _remap_snapshot(), and then if
>    lv->lv_block_exception is NULL we will not enter __remap_snapshot()
>    at all?  That would remove the need to get the write semaphore for
>    no reason.

Good point.

> 2) Initially, I thought we could just "optimize" the checking of
>    lv->lv_block_exception, but I supposed there are race conditions
>    in dropping the read lock and getting the write lock, so I guess
>    we still need to check lv->lv_block_exception in __remap_snapshot()
>    also?

Yes, I think we do.

> 3) The alternative would be to check lv->lv_block_exception inside
>    lvm_snapshot_remap_block() instead of in the callers (returning "1"
>    if it is NULL, and we don't want to do remap).  This would avoid any
>    problems in the future if someone else calls lvm_snapshot_remap_block()
>    without checking lv_block_exception first.  Untested patch below which
>    should be equivalent to your previous patch.

The only thing I don't like about this is that it makes it hides
the fact that lvm_snapshot_COW and a few other calls depend on 
block_exception being valid.  The code certainly looks right though,
just a matter of style.

thanks,
Chris

  reply	other threads:[~2001-10-11 21:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-11 17:49 [linux-lvm] [PATCH] fix oops when snapshots get full Chris Mason
2001-10-11 19:57 ` Andreas Dilger
2001-10-11 21:03   ` Chris Mason [this message]
2001-10-11 21:37     ` Andreas Dilger
2001-10-12  7:53   ` Joe Thornber

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=1532480000.1002834194@tiny \
    --to=mason@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).