linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Duncan <1i5t5.duncan@cox.net>
To: linux-btrfs@vger.kernel.org
Subject: Re: Questions about FIEMAP
Date: Mon, 12 Oct 2015 06:01:01 +0000 (UTC)	[thread overview]
Message-ID: <pan$9fdb4$9abccde1$23cdcfaa$1804db33@cox.net> (raw)
In-Reply-To: CY1PR10MB04283CC6BA7D9AE8F3F0B984E4310@CY1PR10MB0428.namprd10.prod.outlook.com

Wang, Zhiye posted on Mon, 12 Oct 2015 04:37:55 +0000 as excerpted:

> I guess we cannot write to block device directly after get block list
> using FIEMAP. This is because:
> 
> 1. COW feature of btrfs (but this can be disabled using NOCOW)

I'm a user not a dev and many of the specifics of this discussion will 
with little doubt be above my head, but a warning on this assumption, 
just in case you overlooked it...

Btrfs' snapshot feature conflicts with nocow, because a snapshot locks in 
place existing extents, relying on cow for any rewrite, to write the new 
blocks elsewhere.

So what happens when a nocow file is snapshotted and then written into?

Simple enough, it's effectively cow1.  That is, the first write to a 
particular block of a nocow file after a snapshot will still cow it, but 
the file retains its nocow attribute, and further writes to the same 
block will rewrite the block in its now existing new location... until 
the next snapshot locks that too in place, of course.

Bottom line, in the presence of snapshotting, particularly scheduled 
snapshotting that the admin may have forgotten about and/or doesn't know 
the consequences of, you can't rely on nocow actually being absolute 
rewrite-in-place nocow.

So just in case you weren't aware, don't assume what can't be assumed. 
=:^)

-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman


  reply	other threads:[~2015-10-12  6:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-12  4:37 Questions about FIEMAP Wang, Zhiye
2015-10-12  6:01 ` Duncan [this message]
2015-10-12  8:10 ` Hugo Mills
2015-10-12 13:04 ` David Sterba
2015-10-12 13:27 ` Eric Sandeen
2015-10-28  9:57   ` Wang, Zhiye
2015-10-28 12:36     ` Duncan

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='pan$9fdb4$9abccde1$23cdcfaa$1804db33@cox.net' \
    --to=1i5t5.duncan@cox.net \
    --cc=linux-btrfs@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).