diff mbox

btrfs send/receive still gets out of sync in 3.14.0

Message ID 20140422160709.GA18265@davidb.org (mailing list archive)
State Deferred
Headers show

Commit Message

David Brown April 22, 2014, 4:07 p.m. UTC
On Sat, Mar 22, 2014 at 02:04:56PM -0700, Marc MERLIN wrote:
>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?

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

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/cmds-receive.c b/cmds-receive.c
index d6cd3da..5bd4161 100644
--- a/cmds-receive.c
+++ b/cmds-receive.c
@@ -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;