From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B3B8C433E0 for ; Sun, 10 Jan 2021 10:35:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 16F1D23A01 for ; Sun, 10 Jan 2021 10:35:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726222AbhAJKfJ convert rfc822-to-8bit (ORCPT ); Sun, 10 Jan 2021 05:35:09 -0500 Received: from mail.eclipso.de ([217.69.254.104]:56116 "EHLO mail.eclipso.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726112AbhAJKfI (ORCPT ); Sun, 10 Jan 2021 05:35:08 -0500 Received: from mail.eclipso.de (www1.eclipso.de [217.69.254.102]) by mail.eclipso.de with ESMTP id 2B0AFF34 for ; Sun, 10 Jan 2021 11:34:27 +0100 (CET) Date: Sun, 10 Jan 2021 11:34:27 +0100 MIME-Version: 1.0 Message-ID: <0440549b7c78763ce787b03341ca5b9f@mail.eclipso.de> X-Mailer: eclipso / 7.4.0 From: " " Subject: btrfs send / receive via netcat, fails halfway? Reply-To: " " To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org ­I'm trying to transfer a btrfs snapshot via the network. First attempt: Both NC programs don't exit after the transfer is complete. When I ctrl-C the sending side, the receiving side exits OK. btrfs subvolume delete /mnt/rec/snapshots/* receive side: # nc -l -p 6790 | btrfs receive /mnt/rec/snapshots At subvol 0 sending side: # btrfs send /mnt/send/snapshots/0 | nc -v 127.0.0.1 6790 At subvol /mnt/send/snapshots/0 localhost [127.0.0.1] 6790 (hnmp) open Second attempt: both nc programs exit ok at snapshot 0,1,2, but snapshot3 fails halfway, and 4 fails, as 3 is not complete. receive side: # nc -l -p 6790 | btrfs receive /mnt/rec/snapshots At subvol 0 # nc -l -p 6790 | btrfs receive /mnt/rec/snapshots At snapshot 1 # nc -l -p 6790 | btrfs receive /mnt/rec/snapshots At snapshot 2 # nc -l -p 6790 | btrfs receive /mnt/rec/snapshots At snapshot 3 read(net): Connection reset by peer ERROR: short read from stream: expected 49183 read 10450 # nc -l -p 6790 | btrfs receive /mnt/rec/snapshots At snapshot 4 ERROR: cannot find parent subvolume write(stdout): Broken pipe sending side: # btrfs send /mnt/send/snapshots/0 | nc -v -c 127.0.0.1 6790 At subvol /mnt/send/snapshots/0 localhost [127.0.0.1] 6790 (hnmp) open # btrfs send -p /mnt/send/snapshots/0 /mnt/send/snapshots/1 | nc -v -c 127.0.0.1 6790 At subvol /mnt/send/snapshots/1 localhost [127.0.0.1] 6790 (hnmp) open # btrfs send -p /mnt/send/snapshots/1 /mnt/send/snapshots/2 | nc -v -c 127.0.0.1 6790 At subvol /mnt/send/snapshots/2 localhost [127.0.0.1] 6790 (hnmp) open # btrfs send -p /mnt/send/snapshots/2 /mnt/send/snapshots/3 | nc -v -c 127.0.0.1 6790 At subvol /mnt/send/snapshots/3 localhost [127.0.0.1] 6790 (hnmp) open # btrfs send -p /mnt/send/snapshots/3 /mnt/send/snapshots/4 | nc -v -c 127.0.0.1 6790 At subvol /mnt/send/snapshots/4 localhost [127.0.0.1] 6790 (hnmp) open write(net): Connection reset by peer --- Take your mailboxes with you. Free, fast and secure Mail & Cloud: https://www.eclipso.eu - Time to change!