mirror of
https://github.com/kdave/btrfs-progs
synced 2025-05-03 16:37:55 +00:00
btrfs-progs: tests: add a test to check orphaned directories
When adding the GC support I noticed we were failing fsck when we had a directory that hadn't been cleaned up yet because of rm -rf. However this isn't limited to extent-tree-v2, we'll actually fail in the same way if we were unable to do the evict portion of the deletion and left the orphan items around for everybody. This is a valid file system, it'll be cleaned up properly at mount time, so fsck shouldn't fail in this case. Signed-off-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
c9703d8726
commit
babbfa8ac2
BIN
tests/fsck-tests/054-orphan-directory/default.img.xz
Normal file
BIN
tests/fsck-tests/054-orphan-directory/default.img.xz
Normal file
Binary file not shown.
20
tests/fsck-tests/054-orphan-directory/test.sh
Executable file
20
tests/fsck-tests/054-orphan-directory/test.sh
Executable file
@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
# We could potentially have a directory and it's children with ORPHAN items left
|
||||
# for them without having been cleaned up.
|
||||
#
|
||||
# fsck shouldn't complain about this or attempt to do anything about it, the
|
||||
# orphan cleanup will do the correct thing.
|
||||
#
|
||||
# To create this image I simply modified the kernel to skip doing the
|
||||
# btrfs_truncate_inode_items() and removing the orphan item at evict time, and
|
||||
# then rm -rf'ed a directory.
|
||||
|
||||
source "$TEST_TOP/common"
|
||||
|
||||
check_prereq btrfs
|
||||
|
||||
check_image() {
|
||||
run_check "$TOP/btrfs" check "$1"
|
||||
}
|
||||
|
||||
check_all_images
|
Loading…
Reference in New Issue
Block a user