Bug 195597
Summary: | Subvolume copy fails with "ERROR: empty stream is not considered valid" | ||
---|---|---|---|
Product: | File System | Reporter: | Nazar Mokrynskyi (nazar) |
Component: | btrfs | Assignee: | Josef Bacik (josef) |
Status: | RESOLVED PATCH_ALREADY_AVAILABLE | ||
Severity: | normal | CC: | christianvanbrauner, dsterba, lakshmipathi.g, stgraber |
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 4.10 | Subsystem: | |
Regression: | No | Bisected commit-id: | |
Attachments: | btrfs-progs: send: fail on first -ENODATA only |
Description
Nazar Mokrynskyi
2017-04-27 20:07:33 UTC
Comparing above patch https://patchwork.kernel.org/patch/9643035/ with latest btrfs-progs https://github.com/kdave/btrfs-progs/blob/master/cmds-receive.c#L1205 Seems like above patch not yet accepted into btrfs-progs? I can see below code is missing on btrfs-progs master branch. > + if (ret < 0 && ret == -ENODATA) { > + /* Empty stream is invalid */ > error("empty stream is not considered valid"); > ret = -EINVAL; > goto out; > + } else if (ret < 0) { > + goto out; Can you try with latest btrfs-progs from https://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git and see whether you have still this issue? I've just compiled master branch (commit bd0ab27afbf14370f9f0da1f5f5ecbb0adc654c1) and it works fine: root@nazar-pc:~# /media/Data/btrfs-progs-master/btrfs send -p "/media/Backup/web/2017-04-04_06:20:52" "/media/Backup/web/2017-04-04_14:30:06" | /media/Data/btrfs-progs-master/btrfs receive "/media/Backup_backup/web" At subvol /media/Backup/web/2017-04-04_14:30:06 At snapshot 2017-04-04_14:30:06 root@nazar-pc:~# /media/Data/btrfs-progs-master/btrfs --version btrfs-progs v4.10.2 Apparently it wasn't merged yet. However it is already in Ubuntu's repositories, so if that patch was indeed needed, it should be corrected. Additional info: My setup consists of primary SSD where I do regular snapshots, these snapshots are immediately sent to online HDD and then from time to time to the offline HDD. This bug describes sending snapshots from the online HDD to the offline HDD, however, sending snapshots from SSD to the online HDD works fine. There might be some more tricks happening, I'm still keeping affected partition to test possible fix in future. Here is an exact patch applied to latest version of Ubuntu's package: https://launchpadlibrarian.net/314579804/btrfs-progs_4.9.1-1_4.9.1-1ubuntu1.diff.gz (In reply to Nazar Mokrynskyi from comment #2) > I've just compiled master branch (commit > bd0ab27afbf14370f9f0da1f5f5ecbb0adc654c1) and it works fine: > root@nazar-pc:~# /media/Data/btrfs-progs-master/btrfs send -p > "/media/Backup/web/2017-04-04_06:20:52" > "/media/Backup/web/2017-04-04_14:30:06" | > /media/Data/btrfs-progs-master/btrfs receive "/media/Backup_backup/web" > At subvol /media/Backup/web/2017-04-04_14:30:06 > At snapshot 2017-04-04_14:30:06 > root@nazar-pc:~# /media/Data/btrfs-progs-master/btrfs --version > btrfs-progs v4.10.2 > > Apparently it wasn't merged yet. However it is already in Ubuntu's > repositories, so if that patch was indeed needed, it should be corrected. I shared this bug with patch dev, hopefully he will look into it. I'm sorry for confusion, the same error indeed happens in all cases. Regular backups are happening in cron task so I haven't seen the output, but snapshots look fine. thanks for the details.Yes, received your email on mailing list too. I've sent a patch to the btrfs mailing list that tries to address this problem. My tests show that this should work. Please test, if possible. Patch: https://mail-archive.com/linux-btrfs@vger.kernel.org/msg63609.html I've applied latest patch on top of previous patch on top of mentioned upstream 4.10.2 (commit bd0ab27afbf14370f9f0da1f5f5ecbb0adc654c1) and the issue is gone now, thanks! Created attachment 256157 [details]
btrfs-progs: send: fail on first -ENODATA only
I think this bug can be marked as 'fixed'. Nazar, can change the state? (I don't see options for that) Sure Thank you all, patch merged and scheduled for 4.11 release. |