Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Chris Ball <cjb@laptop.org>
To: Nickolai Zeldovich <nickolai@csail.mit.edu>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: zero-length files in snapshots
Date: Thu, 11 Feb 2010 22:11:59 -0500	[thread overview]
Message-ID: <m38wazywow.fsf@pullcord.laptop.org> (raw)
In-Reply-To: <12b5f1ef1002111749u4f33b626jb6a901b29f05337f@mail.gmail.com> (Nickolai Zeldovich's message of "Thu, 11 Feb 2010 20:49:42 -0500")

Hi,

   > I often get zero-length files in btrfs snapshots (when the
   > original files were not zero-length).  The shell script below
   > reproduces this problem on two Ubuntu machines, with Ubuntu
   > kernels 2.6.31-17.54 and 2.6.32-12.17.  Is there some mistaken
   > assumption I'm making here in terms of how btrfsctl works?
   > [..]
   > 
   > echo x1 > /mnt/x/d/foo.txt || exit 2
   > btrfsctl -s /mnt/x/snap /mnt/x/d

You're just missing a sync/fsync() between these two lines.

We argued on IRC a while ago about whether this is a sensible default;
cmason wants the no-sync version of snapshot creation to be available,
but was amenable to the idea of changing the default to be sync before
snapshot, since it was pointed out that no-one other than him had
understood we were supposed to be running sync first.

- Chris.
-- 
Chris Ball   <cjb@laptop.org>
One Laptop Per Child

  reply	other threads:[~2010-02-12  3:11 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 [this message]
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
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=m38wazywow.fsf@pullcord.laptop.org \
    --to=cjb@laptop.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=nickolai@csail.mit.edu \
    /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