Skip to content

Commit

Permalink
TMP
Browse files Browse the repository at this point in the history
  • Loading branch information
ojab committed Nov 7, 2023
1 parent 882240a commit b502fc7
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions tests/bcachefs/tier.ktest
Original file line number Diff line number Diff line change
Expand Up @@ -288,4 +288,39 @@ test_change_replicas()
check_counters ${ktest_scratch_dev[0]}
}

test_concurrent_removal()
{
set_watchdog 60

run_quiet "" bcachefs format \
--label=ssd.ssd1 ${ktest_scratch_dev[0]} \
--label=ssd.ssd2 ${ktest_scratch_dev[1]} \
--label=hdd.hdd1 ${ktest_scratch_dev[2]} \
--label=hdd.hdd2 ${ktest_scratch_dev[3]} \
--metadata_replicas=4 \
--data_replicas=4 \
--promote_target=ssd

mount -t bcachefs "${ktest_scratch_dev[0]}:${ktest_scratch_dev[1]}:${ktest_scratch_dev[2]}:${ktest_scratch_dev[3]}" /mnt

echo "DONE"
dd if=/dev/zero of=/mnt/foo bs=128M count=40 oflag=direct

for i in 1 2 3 4; do
cat /mnt/foo > /dev/null
done
bcachefs fs usage -h /mnt
bcachefs device remove ${ktest_scratch_dev[0]} &
bcachefs device remove ${ktest_scratch_dev[1]} &
bcachefs device remove ${ktest_scratch_dev[2]} &
bcachefs device remove ${ktest_scratch_dev[3]} &
wait
umount /mnt

bcachefs fsck -ny "${ktest_scratch_dev[0]}" "${ktest_scratch_dev[1]}" "${ktest_scratch_dev[2]}" "${ktest_scratch_dev[3]}"
mount -t bcachefs "${ktest_scratch_dev[0]}:${ktest_scratch_dev[1]}:${ktest_scratch_dev[2]}:${ktest_scratch_dev[3]}" /mnt
umount /mnt
check_counters ${ktest_scratch_dev[0]}
}

main $@

0 comments on commit b502fc7

Please sign in to comment.