All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Behrens <sbehrens@giantdisaster.de>
To: Felix Blanke <felixblanke@gmail.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: Problem with btrfs send/receive
Date: Thu, 23 May 2013 14:22:10 +0200	[thread overview]
Message-ID: <519E09F2.4060806@giantdisaster.de> (raw)
In-Reply-To: <CAFTPBc+Z=qK1oi4MzvpTZKB-Qttc0STDHmN2qiwpi36UgqoPhQ@mail.gmail.com>

On Thu, 23 May 2013 13:51:59 +0200, Felix Blanke wrote:
> Hi everyone,
> 
> I was trying the new send/receive feature today but can't make it work.
> 
> These are the commands I was using:
> 
> btrfs subvol snap -r /mnt/data1/@downloads/ /mnt/data1/snapshots/testsnap
> btrfs send /mnt/data1/snapshots/testsnap | btrfs receive
> /mnt/data1/snapshots/testreceive/
> 
> This command never finishes. A 'ls /mnt/data1/snapshots/testreceive/ '
> never finishes too. After killing the send/receive process one can see
> that the target subvolume was created but is empty.
> 
> 
> Sending the snapshot to a file and use this for receiving does work.
> What am I missing?
> 

That's a known design flaw in the btrfs send code.
'btrfs send /subvol | sleep 666'
is an easier way to block the system. But it's interruptable if you
terminate the sleep task in this case.

btrfs send blocks on the pipe while being in the kernel, the call chain
is like this:
btrfs_ioctl_send -> send_subvol -> full_send_tree -> changed_cb ->
send_cmd -> write_buf -> vfs_write -> pipe_write -> pipe_wait

And full_send_tree() has called btrfs_join_transaction() before, thus
the whole file system and afterwards the system is blocked.

You can avoid it if you receive to a different filesystem or if you
redirect the output of btrfs send into a file. In general, the output of
btrfs send must never be blocked or you are lost.


  reply	other threads:[~2013-05-23 12:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-23 11:51 Problem with btrfs send/receive Felix Blanke
2013-05-23 12:22 ` Stefan Behrens [this message]
2013-05-23 12:29   ` Felix Blanke

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=519E09F2.4060806@giantdisaster.de \
    --to=sbehrens@giantdisaster.de \
    --cc=felixblanke@gmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.