Skip to contentSkip to conversation

btrfs send/receive still gets out of sync in 3.14.0

DISCUSSION Marc MERLIN 4 participants 8 messages Mar 22, 2014 – Apr 22, 2014 Btrfs file system

lore
Share & tools
lore
#0 lore raw

After deleting a huge directory tree in my /home subvolume, syncing snapshots now fails with:

ERROR: rmdir o1952777-157-0 failed. No such file or directory Error line 156 with status 1

DIE: Code dump:
153 if [[ -n "$init" ]]; then
154 btrfs send "$src_newsnap" | $ssh btrfs receive "$dest_pool/"
155 else
156 btrfs send -p "$src_snap" "$src_newsnap" | $ssh btrfs receive "$dest_pool/"
157 fi
158
159 # We make a read-write snapshot in case you want to use it for a chroot

Is there anything useful I can provide before killing my snapshot and doing a full sync again?

Thanks,
Marc

Signature · 4 lines
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems ....
                                      .... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/  
#1 lore raw
Quoted 4 lines · Marc MERLIN

After deleting a huge directory tree in my /home subvolume, syncing snapshots now fails with:

ERROR: rmdir o1952777-157-0 failed. No such file or directory

So, I'm ok again after I deleted my destination snapshot and re-init'ed, but on multi terabyte backups, this ain't great :)

Do I need to file a bug that btrfs send/receive still gets out of sync in 3.14, or is it already known and maybe even fixed in btrfs-next?

Thanks,
Marc

Signature · 4 lines
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems ....
                                      .... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/                         | PGP 1024R/763BE901
#2 lore raw
Quoted 11 lines · Marc MERLIN
Quoted 4 lines · Marc MERLIN

After deleting a huge directory tree in my /home subvolume, syncing snapshots now fails with:

ERROR: rmdir o1952777-157-0 failed. No such file or directory

So, I'm ok again after I deleted my destination snapshot and re-init'ed, but on multi terabyte backups, this ain't great :)

Do I need to file a bug that btrfs send/receive still gets out of sync in 3.14, or is it already known and maybe even fixed in btrfs-next?

Filipe has been posting a series of patches related to send/receive
recently, so this may be related to those bugs.

Hugo.

Signature · 3 lines
=== Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ===
  PGP key: 65E74AC0 from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
                   --- Gort!  Klaatu barada nikto! ---                   
#3 lore raw
Quoted 7 lines · Hugo Mills
Quoted 6 lines · Marc MERLIN
Quoted 4 lines · Marc MERLIN

After deleting a huge directory tree in my /home subvolume, syncing snapshots now fails with:

ERROR: rmdir o1952777-157-0 failed. No such file or directory

Quoted 8 lines
Quoted 5 lines

So, I'm ok again after I deleted my destination snapshot and re-init'ed, but on multi terabyte backups, this ain't great :)

Do I need to file a bug that btrfs send/receive still gets out of sync in 3.14, or is it already known and maybe even fixed in btrfs-next?

Filipe has been posting a series of patches related to send/receive
recently, so this may be related to those bugs.

Yes, this one in particular might have fixed the issue:

http://git.kernel.org/cgit/linux/kernel/git/josef/btrfs-next.git/commit/?id=29d6d30f5c8aa58b04f40a58442df3bcaae5a1d5

(There might be other cases that attempt to rmdir a non-existing orphan directory)

Quoted 7 lines

Hugo.

--
=== Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ===
PGP key: 65E74AC0 from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
--- Gort! Klaatu barada nikto! ---

Signature · 5 lines
Filipe David Manana,

"Reasonable men adapt themselves to the world.
 Unreasonable men adapt the world to themselves.
 That's why all progress depends on unreasonable men."
#4 lore raw
Quoted 17 lines · Filipe David Manana
Quoted 7 lines · Hugo Mills
Quoted 6 lines · Marc MERLIN
Quoted 4 lines · Marc MERLIN

After deleting a huge directory tree in my /home subvolume, syncing snapshots now fails with:

ERROR: rmdir o1952777-157-0 failed. No such file or directory

Quoted 8 lines
Quoted 5 lines

So, I'm ok again after I deleted my destination snapshot and re-init'ed, but on multi terabyte backups, this ain't great :)

Do I need to file a bug that btrfs send/receive still gets out of sync in 3.14, or is it already known and maybe even fixed in btrfs-next?

Filipe has been posting a series of patches related to send/receive
recently, so this may be related to those bugs.

Quoted 6 lines

Yes, this one in particular might have fixed the issue:

http://git.kernel.org/cgit/linux/kernel/git/josef/btrfs-next.git/commit/?id=29d6d30f5c8aa58b04f40a58442df3bcaae5a1d5

(There might be other cases that attempt to rmdir a non-existing orphan directory)

Cool, thanks for fixing those.
Is that meant to make it in 3.14 final, or is it going to be 3.15?

Thanks,
Marc

Signature · 4 lines
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems ....
                                      .... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/                         | PGP 1024R/763BE901
#5 lore raw
Quoted 20 lines · Marc MERLIN
Quoted 19 lines · Filipe David Manana
Quoted 7 lines · Hugo Mills
Quoted 6 lines · Marc MERLIN
Quoted 4 lines · Marc MERLIN

After deleting a huge directory tree in my /home subvolume, syncing snapshots now fails with:

ERROR: rmdir o1952777-157-0 failed. No such file or directory

Quoted 8 lines
Quoted 5 lines

So, I'm ok again after I deleted my destination snapshot and re-init'ed, but on multi terabyte backups, this ain't great :)

Do I need to file a bug that btrfs send/receive still gets out of sync in 3.14, or is it already known and maybe even fixed in btrfs-next?

Filipe has been posting a series of patches related to send/receive
recently, so this may be related to those bugs.

Yes, this one in particular might have fixed the issue:

Quoted 7 lines
Quoted 4 lines

http://git.kernel.org/cgit/linux/kernel/git/josef/btrfs-next.git/commit/?id=29d6d30f5c8aa58b04f40a58442df3bcaae5a1d5

(There might be other cases that attempt to rmdir a non-existing orphan directory)

Cool, thanks for fixing those.
Is that meant to make it in 3.14 final, or is it going to be 3.15?

My guess is 3.15.

Quoted 8 lines

Thanks,
Marc
--
"A mouse is a device used to point at the xterm you want to type in" - A.S.R. Microsoft is to operating systems ....
.... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/ | PGP 1024R/763BE901

Signature · 5 lines
Filipe David Manana,

"Reasonable men adapt themselves to the world.
 Unreasonable men adapt the world to themselves.
 That's why all progress depends on unreasonable men."
#6 lore raw
Quoted 4 lines · Filipe David Manana
Quoted 2 lines

Cool, thanks for fixing those.
Is that meant to make it in 3.14 final, or is it going to be 3.15?

My guess is 3.15.

Understood. I'll see if I can find your btrfs patches and apply them to 3.14.

Thanks for letting me know.

Marc

Signature · 4 lines
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems ....
                                      .... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/                         | PGP 1024R/763BE901
#7 lore raw
In reply to Marc MERLIN
Quoted 16 lines · Marc MERLIN

After deleting a huge directory tree in my /home subvolume, syncing snapshots now fails with:

ERROR: rmdir o1952777-157-0 failed. No such file or directory Error line 156 with status 1

DIE: Code dump:
153 if [[ -n "$init" ]]; then
154 btrfs send "$src_newsnap" | $ssh btrfs receive "$dest_pool/"
155 else
156 btrfs send -p "$src_snap" "$src_newsnap" | $ssh btrfs receive "$dest_pool/"
157 fi
158
159 # We make a read-write snapshot in case you want to use it for a chroot

Quoted 2 lines

Is there anything useful I can provide before killing my snapshot and doing a full sync again?

I have been able to work around this by hacking up btrfs receive to ignore the rmdir. As far as I can tell (tree comparison) the resulting tree is correct.

David

cmds-receive.c +3 -0
index d6cd3da..5bd4161 100644
@@ -492,6 +492,9 @@ static int process_rmdir(const char *path, void *user)
 		fprintf(stderr, "ERROR: rmdir %s failed. %s\n", path,
 				strerror(-ret));
 	}
+	// Ugly hack to work around kernel problem of sending
+	// redundant rmdirs.
+	ret = 0;
 
 	free(full_path);
 	return ret;