From: Dave Chinner <david@fromorbit.com>
To: Gionatan Danti <g.danti@assyoma.it>
Cc: "Darrick J. Wong" <darrick.wong@oracle.com>,
Amir Goldstein <amir73il@gmail.com>,
linux-xfs <linux-xfs@vger.kernel.org>
Subject: Re: Reflink (cow) copy of busy files
Date: Wed, 28 Feb 2018 09:04:04 +1100 [thread overview]
Message-ID: <20180227220404.GI30854@dastard> (raw)
In-Reply-To: <fc797c0a-7263-c347-729d-c381b6936d3a@assyoma.it>
On Tue, Feb 27, 2018 at 09:06:25AM +0100, Gionatan Danti wrote:
> On 27/02/2018 01:33, Dave Chinner wrote:
> >On Mon, Feb 26, 2018 at 09:26:01AM -0800, Darrick J. Wong wrote:
> >
> >My point is that vfs_clone_file_range is not running fsync(2)i
> >operations.
> >
> >It's a fdatawrite_and_wait() call, which submits dirty data to disk
> >and waits for it, but does *not flush volatile storage caches*.
> >IOWs, it's not a data integrity operation.
> >
> >Hence while the reflink now has "data on disk" and can clone the
> >extents, Neither the data nor the extents being cloned are stable
> >and won't be until an fsync operation is performed on either the
> >reflink source or destination file....
> >
> >Still no cache flushes. Hence even after the clone has run,
> >you can still lose the data (and extents!) from the host file....
>
> Am I right saying that you are speaking about an *host* crash during
> or just after the clone?
>
> Even in such a case, only the newly created file clone should be
> lost/corrupted, while the original file will *not* be affected,
> right? Or will an interrupted clone operation (ie: due to a power
> failure) leave *both* files in an unconsistent state?
A host crash can lose data from the original file when it is
configured in writeback mode (as you've said you are using). If the
clone is there, both source and clone should be fully intact. If
it's not, then you will have lost data from the original image file.
But, really, why risk losing data or filesystem corruption by trying
to take shortcuts?
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2018-02-27 22:04 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-24 18:20 Reflink (cow) copy of busy files Gionatan Danti
2018-02-24 22:07 ` Dave Chinner
2018-02-24 22:57 ` Gionatan Danti
2018-02-25 2:47 ` Dave Chinner
2018-02-25 11:40 ` Gionatan Danti
2018-02-25 21:13 ` Dave Chinner
2018-02-25 21:58 ` Gionatan Danti
2018-02-26 0:25 ` Dave Chinner
2018-02-26 7:19 ` Gionatan Danti
2018-02-26 7:58 ` Amir Goldstein
2018-02-26 8:26 ` Gionatan Danti
2018-02-26 17:26 ` Darrick J. Wong
2018-02-26 21:23 ` Gionatan Danti
2018-02-26 21:31 ` Darrick J. Wong
2018-02-26 21:39 ` Gionatan Danti
2018-02-27 0:33 ` Dave Chinner
2018-02-27 0:58 ` Darrick J. Wong
2018-02-27 8:06 ` Gionatan Danti
2018-02-27 22:04 ` Dave Chinner [this message]
2018-02-28 7:08 ` Gionatan Danti
2018-02-28 17:07 ` Darrick J. Wong
2018-02-28 18:27 ` Gionatan Danti
2018-02-26 20:29 ` Amir Goldstein
2018-02-26 21:28 ` Gionatan Danti
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=20180227220404.GI30854@dastard \
--to=david@fromorbit.com \
--cc=amir73il@gmail.com \
--cc=darrick.wong@oracle.com \
--cc=g.danti@assyoma.it \
--cc=linux-xfs@vger.kernel.org \
/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).