linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Fedyk <mfedyk@mikefedyk.com>
To: sander@humilis.net
Cc: Josef Bacik <josef@redhat.com>, Chris Ball <cjb@laptop.org>,
	Nickolai Zeldovich <nickolai@csail.mit.edu>,
	linux-btrfs@vger.kernel.org
Subject: Re: zero-length files in snapshots
Date: Sat, 13 Feb 2010 11:26:09 -0800	[thread overview]
Message-ID: <93cdabd21002131126v4b4d3c1ei2a747a7a5de7b1c8@mail.gmail.com> (raw)
In-Reply-To: <20100213112540.GB23512@attic.humilis.net>

On Sat, Feb 13, 2010 at 3:25 AM, Sander <sander@humilis.net> wrote:
> Mike Fedyk wrote (ao):
>> On Fri, Feb 12, 2010 at 8:32 AM, Josef Bacik <josef@redhat.com> wrot=
e:
>> > Creating a file is a metadata operation, and _any_ metadata operat=
ion has to be
>> > committed to disk when the transaction commits in order to maintai=
n a coherent
>> > fs. ??Thanks,
>>
>> What I still don't understand though is that the create could have
>> taken up to 30 seconds to commit and the same for the few bytes of
>> data, but a few ms later a snapshot was made and the metadata change
>> was there and the data change was not. =C2=A0Could it have happened =
that
>> the snapshot would not have the newly created file and this was just=
 a
>> timing issue that should not be relied upon?
>>
>> I'm just wondering why that file was there at all.
>
> I would say that is because the moment the file got created, the
> resulting metadata was commited immediately. The data not yet.
>

Josef explained it to me on IRC.  Meta-data changes like file creation
get added to the current transaction and snapshots start a new
transaction so that is why the empty file is in the snapshot.

The file is empty because with delayed allocation, the data has not
hit the filesystem yet and thus has no representation in filesystem
operations like snapshots.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" =
in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2010-02-13 19:26 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-12  1:49 zero-length files in snapshots Nickolai Zeldovich
2010-02-12  3:11 ` Chris Ball
2010-02-12  4:50   ` Mike Fedyk
2010-02-12 15:19     ` Josef Bacik
2010-02-12 16:18       ` Mike Fedyk
2010-02-12 16:22         ` Josef Bacik
2010-02-12 16:27           ` Mike Fedyk
2010-02-12 16:32             ` Josef Bacik
2010-02-12 17:13               ` Mike Fedyk
2010-02-13 11:25                 ` Sander
2010-02-13 19:26                   ` Mike Fedyk [this message]
2010-02-19 22:22                     ` Sage Weil
2010-02-25 18:57                       ` Goffredo Baroncelli
2010-02-12 18:22       ` Ravi Pinjala
2010-02-12 18:45         ` Josef Bacik
2010-02-12 19:03         ` Chris Ball
2010-02-12 19:10       ` Christoph Hellwig

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=93cdabd21002131126v4b4d3c1ei2a747a7a5de7b1c8@mail.gmail.com \
    --to=mfedyk@mikefedyk.com \
    --cc=cjb@laptop.org \
    --cc=josef@redhat.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=nickolai@csail.mit.edu \
    --cc=sander@humilis.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 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).