linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Possible bug in send/receive with simple reproducer
@ 2013-08-11 18:53 Emil Karlson
  2013-08-11 19:08 ` Emil Karlson
  2013-08-12 14:59 ` Josef Bacik
  0 siblings, 2 replies; 5+ messages in thread
From: Emil Karlson @ 2013-08-11 18:53 UTC (permalink / raw)
  To: Linux Btrfs

Greetings

Send fails for me unexpectedly:

I get:
ERROR: rename o262-5-0 -> snapshots failed. No such file or directory

reproducer ( http://users.tkk.fi/~jkarlson/files/test4.txt  ):

for i in 1 2; do
  mkdir /mnt/$i
  truncate -s 4G /mnt/$i.img
  mkfs.btrfs /mnt/$i.img
  mount -o loop /mnt/$i.img /mnt/$i
done

mkdir /mnt/1/testdir
mkdir /mnt/1/testdir/1/
mkdir /mnt/1/testdir/2/
dd if=/dev/urandom  of=/mnt/1/testdir/aa count=16
dd if=/dev/urandom  of=/mnt/1/testdir/bb count=16

mkdir /mnt/1/snapshots
btrfs sub snap -r /mnt/1/ /mnt/1/snapshots/backup2
btrfs sub snap -r /mnt/1/ /mnt/1/snapshots/backup3
btrfs send /mnt/1/snapshots/backup3/ | btrfs receive /mnt/2/

umount /mnt/{1,2}; rm /mnt/{1,2}.img; rmdir /mnt/{1,2}

Best Regards
-Emil

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Possible bug in send/receive with simple reproducer
  2013-08-11 18:53 Possible bug in send/receive with simple reproducer Emil Karlson
@ 2013-08-11 19:08 ` Emil Karlson
  2013-08-12 14:59 ` Josef Bacik
  1 sibling, 0 replies; 5+ messages in thread
From: Emil Karlson @ 2013-08-11 19:08 UTC (permalink / raw)
  To: Linux Btrfs

On Sun, Aug 11, 2013 at 9:53 PM, Emil Karlson <jekarlson@gmail.com> wrote:
> Greetings
>
> Send fails for me unexpectedly:
>
> I get:
> ERROR: rename o262-5-0 -> snapshots failed. No such file or directory
>
> reproducer ( http://users.tkk.fi/~jkarlson/files/test4.txt  ):
>
> for i in 1 2; do
>   mkdir /mnt/$i
>   truncate -s 4G /mnt/$i.img
>   mkfs.btrfs /mnt/$i.img
>   mount -o loop /mnt/$i.img /mnt/$i
> done
>
> mkdir /mnt/1/testdir
> mkdir /mnt/1/testdir/1/
> mkdir /mnt/1/testdir/2/
> dd if=/dev/urandom  of=/mnt/1/testdir/aa count=16
> dd if=/dev/urandom  of=/mnt/1/testdir/bb count=16
>
> mkdir /mnt/1/snapshots
> btrfs sub snap -r /mnt/1/ /mnt/1/snapshots/backup2
> btrfs sub snap -r /mnt/1/ /mnt/1/snapshots/backup3
> btrfs send /mnt/1/snapshots/backup3/ | btrfs receive /mnt/2/
>
> umount /mnt/{1,2}; rm /mnt/{1,2}.img; rmdir /mnt/{1,2}
>
> Best Regards
> -Emil

Kernel version is 3.11-rc4 with "Btrfs: check our parent dir when
doing a compare send V2" and a few other patches.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Possible bug in send/receive with simple reproducer
  2013-08-11 18:53 Possible bug in send/receive with simple reproducer Emil Karlson
  2013-08-11 19:08 ` Emil Karlson
@ 2013-08-12 14:59 ` Josef Bacik
  2013-08-12 15:16   ` Stefan Behrens
  1 sibling, 1 reply; 5+ messages in thread
From: Josef Bacik @ 2013-08-12 14:59 UTC (permalink / raw)
  To: Emil Karlson; +Cc: Linux Btrfs

On Sun, Aug 11, 2013 at 09:53:01PM +0300, Emil Karlson wrote:
> Greetings
> 
> Send fails for me unexpectedly:
> 
> I get:
> ERROR: rename o262-5-0 -> snapshots failed. No such file or directory
> 
> reproducer ( http://users.tkk.fi/~jkarlson/files/test4.txt  ):
> 
> for i in 1 2; do
>   mkdir /mnt/$i
>   truncate -s 4G /mnt/$i.img
>   mkfs.btrfs /mnt/$i.img
>   mount -o loop /mnt/$i.img /mnt/$i
> done
> 
> mkdir /mnt/1/testdir
> mkdir /mnt/1/testdir/1/
> mkdir /mnt/1/testdir/2/
> dd if=/dev/urandom  of=/mnt/1/testdir/aa count=16
> dd if=/dev/urandom  of=/mnt/1/testdir/bb count=16
> 
> mkdir /mnt/1/snapshots
> btrfs sub snap -r /mnt/1/ /mnt/1/snapshots/backup2
> btrfs sub snap -r /mnt/1/ /mnt/1/snapshots/backup3
> btrfs send /mnt/1/snapshots/backup3/ | btrfs receive /mnt/2/
> 
> umount /mnt/{1,2}; rm /mnt/{1,2}.img; rmdir /mnt/{1,2}

This was perfect, thank you for that.  I've posted a fix and I'll turn this into
an xfstest to make sure we don't ever regress.  Thanks again,

Josef

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Possible bug in send/receive with simple reproducer
  2013-08-12 14:59 ` Josef Bacik
@ 2013-08-12 15:16   ` Stefan Behrens
  2013-08-12 18:12     ` Josef Bacik
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Behrens @ 2013-08-12 15:16 UTC (permalink / raw)
  To: Josef Bacik; +Cc: Emil Karlson, Linux Btrfs

On Mon, 12 Aug 2013 10:59:52 -0400, Josef Bacik wrote:
> On Sun, Aug 11, 2013 at 09:53:01PM +0300, Emil Karlson wrote:
>> Greetings
>>
>> Send fails for me unexpectedly:
>>
>> I get:
>> ERROR: rename o262-5-0 -> snapshots failed. No such file or directory
>>
>> reproducer ( http://users.tkk.fi/~jkarlson/files/test4.txt  ):
>>
>> for i in 1 2; do
>>   mkdir /mnt/$i
>>   truncate -s 4G /mnt/$i.img
>>   mkfs.btrfs /mnt/$i.img
>>   mount -o loop /mnt/$i.img /mnt/$i
>> done
>>
>> mkdir /mnt/1/testdir
>> mkdir /mnt/1/testdir/1/
>> mkdir /mnt/1/testdir/2/
>> dd if=/dev/urandom  of=/mnt/1/testdir/aa count=16
>> dd if=/dev/urandom  of=/mnt/1/testdir/bb count=16
>>
>> mkdir /mnt/1/snapshots
>> btrfs sub snap -r /mnt/1/ /mnt/1/snapshots/backup2
>> btrfs sub snap -r /mnt/1/ /mnt/1/snapshots/backup3
>> btrfs send /mnt/1/snapshots/backup3/ | btrfs receive /mnt/2/
>>
>> umount /mnt/{1,2}; rm /mnt/{1,2}.img; rmdir /mnt/{1,2}
> 
> This was perfect, thank you for that.  I've posted a fix and I'll turn this into
> an xfstest to make sure we don't ever regress.  Thanks again,
>

If you create a subvolume below /mnt/[12] and run the test there, you
have the problem reproduced again :)

for i in 1 2; do
 mkdir /mnt/$i
 truncate -s 4G /mnt/$i.img
 mkfs.btrfs /mnt/$i.img
 mount -o loop /mnt/$i.img /mnt/$i
done

btrfs subv create /mnt/1/sub
btrfs subv create /mnt/2/sub
mkdir /mnt/1/sub/testdir
mkdir /mnt/1/sub/testdir/1/
mkdir /mnt/1/sub/testdir/2/
dd if=/dev/urandom  of=/mnt/1/sub/testdir/aa count=16
dd if=/dev/urandom  of=/mnt/1/sub/testdir/bb count=16

mkdir /mnt/1/sub/snapshots
btrfs sub snap -r /mnt/1/sub/ /mnt/1/sub/snapshots/backup2
btrfs sub snap -r /mnt/1/sub/ /mnt/1/sub/snapshots/backup3
btrfs send /mnt/1/sub/snapshots/backup3/ | btrfs receive /mnt/2/sub/

umount /mnt/[12]; rm /mnt/[12].img; rmdir /mnt/[12]


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Possible bug in send/receive with simple reproducer
  2013-08-12 15:16   ` Stefan Behrens
@ 2013-08-12 18:12     ` Josef Bacik
  0 siblings, 0 replies; 5+ messages in thread
From: Josef Bacik @ 2013-08-12 18:12 UTC (permalink / raw)
  To: Stefan Behrens; +Cc: Josef Bacik, Emil Karlson, Linux Btrfs

On Mon, Aug 12, 2013 at 05:16:04PM +0200, Stefan Behrens wrote:
> On Mon, 12 Aug 2013 10:59:52 -0400, Josef Bacik wrote:
> > On Sun, Aug 11, 2013 at 09:53:01PM +0300, Emil Karlson wrote:
> >> Greetings
> >>
> >> Send fails for me unexpectedly:
> >>
> >> I get:
> >> ERROR: rename o262-5-0 -> snapshots failed. No such file or directory
> >>
> >> reproducer ( http://users.tkk.fi/~jkarlson/files/test4.txt  ):
> >>
> >> for i in 1 2; do
> >>   mkdir /mnt/$i
> >>   truncate -s 4G /mnt/$i.img
> >>   mkfs.btrfs /mnt/$i.img
> >>   mount -o loop /mnt/$i.img /mnt/$i
> >> done
> >>
> >> mkdir /mnt/1/testdir
> >> mkdir /mnt/1/testdir/1/
> >> mkdir /mnt/1/testdir/2/
> >> dd if=/dev/urandom  of=/mnt/1/testdir/aa count=16
> >> dd if=/dev/urandom  of=/mnt/1/testdir/bb count=16
> >>
> >> mkdir /mnt/1/snapshots
> >> btrfs sub snap -r /mnt/1/ /mnt/1/snapshots/backup2
> >> btrfs sub snap -r /mnt/1/ /mnt/1/snapshots/backup3
> >> btrfs send /mnt/1/snapshots/backup3/ | btrfs receive /mnt/2/
> >>
> >> umount /mnt/{1,2}; rm /mnt/{1,2}.img; rmdir /mnt/{1,2}
> > 
> > This was perfect, thank you for that.  I've posted a fix and I'll turn this into
> > an xfstest to make sure we don't ever regress.  Thanks again,
> >
> 
> If you create a subvolume below /mnt/[12] and run the test there, you
> have the problem reproduced again :)
> 

Yeah I noticed this problem when I converted it over to an xfstest, forgot that
I'm an idiot.  Trying to figure out a less braindead way to fix this.  Thanks,

Josef

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-08-12 18:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-11 18:53 Possible bug in send/receive with simple reproducer Emil Karlson
2013-08-11 19:08 ` Emil Karlson
2013-08-12 14:59 ` Josef Bacik
2013-08-12 15:16   ` Stefan Behrens
2013-08-12 18:12     ` Josef Bacik

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).