if [[ $bsub ]]; then
tmp=$(mktemp)
# in testing, same subvol is 136 bytes. allow some overhead
- btrfs send --no-data -p $bsub $leaf | head -c 1000 > $tmp
+ btrfs send --no-data -p $bsub $leaf | head -c 1000 > $tmp || [[ $? == 141 ]]
if (( $(stat -c%s $tmp) < 1000)); then
# example output for an empty diff:
# Found a valid Btrfs stream header, version 1