On 2016-11-29 00:06, Duncan wrote:
Niccolò Belli posted on Mon, 28 Nov 2016 12:11:49 +0100 as excerpted:

On lunedì 28 novembre 2016 09:20:15 CET, Kai Krakow wrote:
You can, however, use chattr to make the subvolume root directory (that
one where it is mounted) nodatacow (chattr +C) _before_ placing any
files or directories in there. That way, newly created files and
directories will inherit the flag. Take note that this flag can only
applied to directories and empty (zero-sized) files.

Do I keep checksumming for this directory such a way?

No.  Keeping checksums current on NOCOW files is racy, and compression
would be complex as well because rewritten data may compress more or less
well than the original so the on-filesystem size could change, so both
features are disabled in the presence of NOCOW, regardless of how it is
set.

Put another way, btrfs assumes COW by default and many of its features
depend on COW -- that's why these features don't tend to be implemented
on conventional rewrite-in-place filesystems in the first place.  Both
checksumming and compression are among these COW-dependent features.

We really should get this put up somewhere very visible on the wiki. It's pretty blatantly obvious to anyone with a CS degree, but most users don't have a CS degree, and I can't count the number of e-mails I've sent explaining why checksums plus NOCOW are a recipe for disaster.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to