Skip to content

Commit

Permalink
Fix echo bug
Browse files Browse the repository at this point in the history
Removed the 'recreating hardlinks' echo for inode groups of 1 file.
  • Loading branch information
undaunt authored Nov 6, 2024
1 parent 3ae15e5 commit d7c7444
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions zfs-inplace-rebalancing.sh
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,16 @@ function process_inode_group() {
fi
mv "${tmp_file_path}" "${main_file}"

echo "Recreating hardlinks..."
for (( i=1; i<${#paths[@]}; i++ )); do
if [ "$debug_flag" = true ]; then
echo "Linking ${main_file} to ${paths[$i]}"
fi
ln "${main_file}" "${paths[$i]}"
done
# Only recreate hardlinks if there are multiple paths
if [ "${num_paths}" -gt 1 ]; then
echo "Recreating hardlinks..."
for (( i=1; i<${#paths[@]}; i++ )); do
if [ "$debug_flag" = true ]; then
echo "Linking ${main_file} to ${paths[$i]}"
fi
ln "${main_file}" "${paths[$i]}"
done
fi

if [ "${passes_flag}" -ge 1 ]; then
# Update rebalance "database" for all files
Expand Down

0 comments on commit d7c7444

Please sign in to comment.