2017-09-01 14:45:34 +00:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# btrfs fi du should handle empty subvolumes (with ino == 2)
|
|
|
|
|
2018-02-08 06:34:19 +00:00
|
|
|
source "$TEST_TOP/common"
|
2017-09-01 14:45:34 +00:00
|
|
|
|
|
|
|
check_prereq mkfs.btrfs
|
|
|
|
check_prereq btrfs
|
|
|
|
setup_root_helper
|
|
|
|
prepare_test_dev
|
|
|
|
|
2019-06-05 17:09:38 +00:00
|
|
|
run_check_mkfs_test_dev
|
2017-09-01 14:45:34 +00:00
|
|
|
run_check_mount_test_dev
|
|
|
|
|
|
|
|
cd "$TEST_MNT"
|
|
|
|
|
|
|
|
run_check $SUDO_HELPER "$TOP/btrfs" subvolume create test1
|
|
|
|
run_check $SUDO_HELPER "$TOP/btrfs" subvolume create test1/test2
|
|
|
|
run_check $SUDO_HELPER "$TOP/btrfs" subvolume snapshot test1 test1-snap
|
|
|
|
run_check $SUDO_HELPER "$TOP/btrfs" filesystem du -s test1
|
|
|
|
run_check_stdout $SUDO_HELPER "$TOP/btrfs" filesystem du -s test1-snap | \
|
|
|
|
grep -q "ERROR:.*ioctl" && _fail "empty subvolume not handled"
|
|
|
|
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
run_check_umount_test_dev
|