summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/send.c
diff options
context:
space:
mode:
authorAlexander Block2012-07-28 11:46:29 +0200
committerChris Mason2012-10-01 21:18:47 +0200
commitccf1626b49a94d66f3bb58d634888049ac695b46 (patch)
tree0001864d120b03cf3734d5c6bdb4f4c549857bed /fs/btrfs/send.c
parentBtrfs: remove unused code with #if 0 (diff)
downloadkernel-qcow2-linux-ccf1626b49a94d66f3bb58d634888049ac695b46.tar.gz
kernel-qcow2-linux-ccf1626b49a94d66f3bb58d634888049ac695b46.tar.xz
kernel-qcow2-linux-ccf1626b49a94d66f3bb58d634888049ac695b46.zip
Btrfs: add correct parent to check_dirs when dir got moved
We only added the parent for the new position of a moved dir. We also need to add the old parent of the moved dir. Reported-by: Alex Lyakas <alex.bolshoy.btrfs@gmail.com> Signed-off-by: Alexander Block <ablock84@googlemail.com>
Diffstat (limited to 'fs/btrfs/send.c')
-rw-r--r--fs/btrfs/send.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
index 9e3f6d127d82..328654ea4400 100644
--- a/fs/btrfs/send.c
+++ b/fs/btrfs/send.c
@@ -2805,6 +2805,17 @@ verbose_printk("btrfs: process_recorded_refs %llu\n", sctx->cur_ino);
if (ret < 0)
goto out;
}
+ } else if (S_ISDIR(sctx->cur_inode_mode) &&
+ !list_empty(&sctx->deleted_refs)) {
+ /*
+ * We have a moved dir. Add the old parent to check_dirs
+ */
+ cur = list_entry(sctx->deleted_refs.next, struct recorded_ref,
+ list);
+ ret = ulist_add(check_dirs, cur->dir, cur->dir_gen,
+ GFP_NOFS);
+ if (ret < 0)
+ goto out;
} else if (!S_ISDIR(sctx->cur_inode_mode)) {
/*
* We have a non dir inode. Go through all deleted refs and