Commit ccf1626b authored by Alexander Block's avatar Alexander Block Committed by Chris Mason

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: default avatarAlex Lyakas <alex.bolshoy.btrfs@gmail.com>
Signed-off-by: default avatarAlexander Block <ablock84@googlemail.com>
parent 9ea3ef51
...@@ -2805,6 +2805,17 @@ verbose_printk("btrfs: process_recorded_refs %llu\n", sctx->cur_ino); ...@@ -2805,6 +2805,17 @@ verbose_printk("btrfs: process_recorded_refs %llu\n", sctx->cur_ino);
if (ret < 0) if (ret < 0)
goto out; 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)) { } else if (!S_ISDIR(sctx->cur_inode_mode)) {
/* /*
* We have a non dir inode. Go through all deleted refs and * We have a non dir inode. Go through all deleted refs and
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment