Re: zero-length files in snapshots

2010-02-12 Thread Josef Bacik
On Thu, Feb 11, 2010 at 08:50:48PM -0800, Mike Fedyk wrote: > On Thu, Feb 11, 2010 at 7:11 PM, Chris Ball wrote: > >   > 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 whil

Re: zero-length files in snapshots

2010-02-12 Thread Mike Fedyk
On Fri, Feb 12, 2010 at 7:19 AM, Josef Bacik wrote: > On Thu, Feb 11, 2010 at 08:50:48PM -0800, Mike Fedyk wrote: >> On Thu, Feb 11, 2010 at 7:11 PM, Chris Ball wrote: >> >   > echo x1 > /mnt/x/d/foo.txt || exit 2 >> >   > btrfsctl -s /mnt/x/snap /mnt/x/d >> > >> > You're just missing a sync/fsyn

Re: zero-length files in snapshots

2010-02-12 Thread Josef Bacik
On Fri, Feb 12, 2010 at 08:18:01AM -0800, Mike Fedyk wrote: > On Fri, Feb 12, 2010 at 7:19 AM, Josef Bacik wrote: > > On Thu, Feb 11, 2010 at 08:50:48PM -0800, Mike Fedyk wrote: > >> On Thu, Feb 11, 2010 at 7:11 PM, Chris Ball wrote: > >> >   > echo x1 > /mnt/x/d/foo.txt || exit 2 > >> >   > btrf

Re: zero-length files in snapshots

2010-02-12 Thread Mike Fedyk
On Fri, Feb 12, 2010 at 8:22 AM, Josef Bacik wrote: > On Fri, Feb 12, 2010 at 08:18:01AM -0800, Mike Fedyk wrote: >> On Fri, Feb 12, 2010 at 7:19 AM, Josef Bacik wrote: >> > On Thu, Feb 11, 2010 at 08:50:48PM -0800, Mike Fedyk wrote: >> >> On Thu, Feb 11, 2010 at 7:11 PM, Chris Ball wrote: >> >>

Re: zero-length files in snapshots

2010-02-12 Thread Josef Bacik
On Fri, Feb 12, 2010 at 08:27:00AM -0800, Mike Fedyk wrote: > On Fri, Feb 12, 2010 at 8:22 AM, Josef Bacik wrote: > > On Fri, Feb 12, 2010 at 08:18:01AM -0800, Mike Fedyk wrote: > >> On Fri, Feb 12, 2010 at 7:19 AM, Josef Bacik wrote: > >> > On Thu, Feb 11, 2010 at 08:50:48PM -0800, Mike Fedyk wr

Re: zero-length files in snapshots

2010-02-12 Thread Mike Fedyk
On Fri, Feb 12, 2010 at 8:32 AM, Josef Bacik wrote: > On Fri, Feb 12, 2010 at 08:27:00AM -0800, Mike Fedyk wrote: >> On Fri, Feb 12, 2010 at 8:22 AM, Josef Bacik wrote: >> > On Fri, Feb 12, 2010 at 08:18:01AM -0800, Mike Fedyk wrote: >> >> On Fri, Feb 12, 2010 at 7:19 AM, Josef Bacik wrote: >> >

Re: zero-length files in snapshots

2010-02-12 Thread Ravi Pinjala
On 02/12/10 09:19, Josef Bacik wrote: On Thu, Feb 11, 2010 at 08:50:48PM -0800, Mike Fedyk wrote: On Thu, Feb 11, 2010 at 7:11 PM, Chris Ball wrote: > 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. W

Re: zero-length files in snapshots

2010-02-12 Thread Josef Bacik
On Fri, Feb 12, 2010 at 12:22:12PM -0600, Ravi Pinjala wrote: > On 02/12/10 09:19, Josef Bacik wrote: >> On Thu, Feb 11, 2010 at 08:50:48PM -0800, Mike Fedyk wrote: >>> On Thu, Feb 11, 2010 at 7:11 PM, Chris Ball wrote: > echo x1> /mnt/x/d/foo.txt || exit 2 > btrfsctl -s /mnt/x/

[PATCH 0/2] btrfs: a new tool to manage a btrfs filesystem

2010-02-12 Thread Goffredo Baroncelli
Hi all, enclosed in the next two emails you can find two patches which introduce a new program called "btrfs". This program has the ambitious to replace the utilities of the btrfs-prog package, like: - btrfsctl - btrfs-show - btrfs-volume - btrfs The goals are: - improve the usability of the t

[PATCH 2/2] btrfs: a new tool to manage a btrfs filesystem - man page

2010-02-12 Thread Goffredo Baroncelli
This is the man page of the btrfs command. diff --git a/man/Makefile b/man/Makefile index 4e8893b..4a90b75 100644 --- a/man/Makefile +++ b/man/Makefile @@ -7,13 +7,16 @@ mandir = $(prefix)/man man8dir = $(mandir)/man8 MANPAGES = mkfs.btrfs.8.gz btrfsctl.8.gz btrfsck.8.gz btrfs-image.8.gz \ -

[PATCH 1/2] btrfs: a new tool to manage a btrfs filesystem

2010-02-12 Thread Goffredo Baroncelli
This patch add the btrfs command, and update the Makefile. diff --git a/Makefile b/Makefile index 02f881e..888ef8d 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ bindir = $(prefix)/bin LIBS=-luuid progs = btrfsctl mkfs.btrfs btrfs-debug-tree btrfs-show btrfs-vol btrfsck \ - btrf

Re: zero-length files in snapshots

2010-02-12 Thread Chris Ball
Hi, > Is there a race in there? It seems like if a process starts > modifying a file between the sync and the snapshot, data could > still be lost. Is there something else going on here that I'm > missing that would prevent this race? AIUI, you're correct that a writer process concurr

Re: zero-length files in snapshots

2010-02-12 Thread Christoph Hellwig
On Fri, Feb 12, 2010 at 10:19:40AM -0500, Josef Bacik wrote: > 3) sync - this is not as obvious. sync doesn't mean anything than "start > writing back dirty data to the fs", and returns before it's done. For btrfs > what that means is we run through _every_ inode that has delalloc pages > associa

Re: [PATCH 0/2] btrfs: a new tool to manage a btrfs filesystem

2010-02-12 Thread Mike Fedyk
On Fri, Feb 12, 2010 at 11:01 AM, Goffredo Baroncelli wrote: > Usage: >        btrfs delete|-D >                Delete the subvolume . >        btrfs defrag|-d | [|...] >                Defragment a file or a directory. I think the short options should be removed or else you'll still have the ea

Kernel BUG on mounting BtrFS / after reboot

2010-02-12 Thread Alex Elsayed
I'm getting a rather nasty BUG when I try to mount this filesystem, _including_ when I specify -o ro. I'm unsure what caused it, but the problem manifested after my computer hardlocked while reading my RSS feeds, complete with flashing lights. After I rebooted it, the screen filled with panic m

Re: btrfs-vol -b endless loop

2010-02-12 Thread Pär Andersson
"Yan, Zheng " writes: > The loop is due to fragments of free space. I'm working on make 'btrfs-vol -b' > return -ENOSPC in this case. If I remember correctly the filesystem had 3G free space according to df, which I know is not reliable on btrfs. After removing one 540M file 'btrfs-vol -b' ran

Re: Kernel BUG on mounting BtrFS / after reboot

2010-02-12 Thread Mike Fedyk
On Fri, Feb 12, 2010 at 1:04 PM, Alex Elsayed wrote: > I'm getting a rather nasty BUG when I try to mount this filesystem, > _including_ when I specify -o ro. I'm unsure what caused it, but the problem > manifested after my computer hardlocked while reading my RSS feeds, complete > with flashing l

Re: Kernel BUG on mounting BtrFS / after reboot

2010-02-12 Thread Alex Elsayed
Mike Fedyk mikefedyk.com> writes: > > On Fri, Feb 12, 2010 at 1:04 PM, Alex Elsayed gmail.com> wrote: > > I'm getting a rather nasty BUG when I try to mount this filesystem, > > _including_ when I specify -o ro. I'm unsure what caused it, but the problem > > manifested after my computer hardlo