From: Robert White <rwhite@pobox.com>
To: Roman Mamedov <rm@romanrm.net>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: Can't cp --reflink files on a Ext4-converted FS w/o checksums
Date: Wed, 26 Nov 2014 16:31:59 -0800 [thread overview]
Message-ID: <547670FF.3090407@pobox.com> (raw)
In-Reply-To: <20141127052021.47734be0@natsu>
On 11/26/2014 04:20 PM, Roman Mamedov wrote:
> On Wed, 26 Nov 2014 16:00:23 -0800
> Robert White <rwhite@pobox.com> wrote:
>
>> Uh... you may _still_ have no checksums on any of those data extents.
>> They are not going to come back until you write them to a normal file
>> with a normal copy. So you may be lacking most of the data validation
>> features of this filesystem.
>
> Well, this FS is coming from being Ext4 for years, so it's not worse off now
> than it was before. And anyways the main feature that I wanted were snapshots.
Given that you wont be able to scrub the data and BTRFS is usable but
still a little brittle, it might be a little worse off than you think.
Plus if you ever find yourself in need of balancing you've tossed out
one level of data integrity right here at the start.
>> You might want to go experiment. Make another new subvol (or at least a
>> directory in a directory/root/subvol that never had the +C attribute
>> set) and see if you can cp --reflink any of these files into that
>> subdirectory without repeating the +C trick.
>
> Ha, indeed I can't. Maybe there should be a way to generate checksums without
> rewriting files, just via reading them, then calculating and writing checksum
> to metadata.
That problem would be "computationally hard" because you'd have to
verify that no other file was using that extent before you put that
extent under control of the csum machinery, otherwise you might break
later break the COW promise when the file that knows those blocks by
their checksum changes the contents out from underneath the other
references.
>> Clearing NODATACOW does _not_ clear NODATASUM (at least not on a
>> non-empty file) as near as I can tell, so that directory hierarchy and
>> its subsequent snapshots is likely "less safe" than you think.
>
> The nodatasum flag also isn't accessible via chattr, is it?
It is not. NODATASUM and NODATACOW are private features. The linux
kernel has no general concept of data checksums. The BTRFS guys mapped
the NODATACOW attribute onto the existing lsattr/chattr bit because it
was defined for another file system long ago.
You'll also find that you can not set or clear the C attr on a file in a
BTRFS unless its size is zero. So all your files now have the C
attribute more-or-less forever. Only a normal copy operation (e.g.
allocating new extents and writing the data into them wiht the checksum
feature in force) will change that.
next prev parent reply other threads:[~2014-11-27 0:32 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-26 19:55 Can't cp --reflink files on a Ext4-converted FS w/o checksums Roman Mamedov
2014-11-26 23:18 ` Robert White
2014-11-26 23:33 ` Roman Mamedov
2014-11-27 0:00 ` Robert White
2014-11-27 0:20 ` Roman Mamedov
2014-11-27 0:31 ` Robert White [this message]
2014-11-27 0:57 ` Robert White
2014-11-27 0:20 ` Robert White
2014-11-27 0:28 ` Roman Mamedov
2014-11-27 0:45 ` Robert White
2014-11-27 9:27 ` Duncan
2014-11-28 7:12 ` Robert White
2014-11-27 3:31 ` Liu Bo
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=547670FF.3090407@pobox.com \
--to=rwhite@pobox.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=rm@romanrm.net \
/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.