From: Chris Mason <chris.mason@oracle.com>
To: Yan Zheng <yanzheng@21cn.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: Algorithm for nodatacow is broken
Date: Thu, 17 Jul 2008 12:45:35 +0000 [thread overview]
Message-ID: <1216298735.24425.338.camel@think.oraclecorp.com> (raw)
In-Reply-To: <1216214154.24425.326.camel@think.oraclecorp.com>
On Wed, 2008-07-16 at 13:15 +0000, Chris Mason wrote:
> On Wed, 2008-07-16 at 15:41 +0800, Yan Zheng wrote:
> > Hello,
> >
> > Yesterday, I realized the algorithm for nodatacow is broken, it can't
> > reliably detect whether a given extent is referenced by only one
> > snapshot.
>
> I had to change around nodatacow back in May because it was definitely
> broken in the way you describe. I agree the special case I added to
> allow nodatacow when one of the references comes from the running
> transaction is broken.
>
> But, we should be able to fix it by extending the reference count checks
> up the tree. Any reference > 1 not held by the running transaction on
> any block should force a cow.
Actually the existing code assumes any reference held by a different
generation of the current root is safe. As Yan's picture shows that
isn't quite true. So, we can make it safe by walking down that root and
checking for snapshots as well.
-chris
prev parent reply other threads:[~2008-07-17 12:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-16 7:41 Algorithm for nodatacow is broken Yan Zheng
2008-07-16 13:15 ` Chris Mason
2008-07-17 12:45 ` Chris Mason [this message]
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=1216298735.24425.338.camel@think.oraclecorp.com \
--to=chris.mason@oracle.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=yanzheng@21cn.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