]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commit
generic/775: Fix an infinite loop due to variable name clash
authorOjaswin Mujoo <ojaswin@linux.ibm.com>
Fri, 10 Apr 2026 06:36:05 +0000 (12:06 +0530)
committerZorro Lang <zlang@kernel.org>
Mon, 13 Apr 2026 17:42:41 +0000 (01:42 +0800)
commit53e68c2afbb9c62de47a227dd05b4373ff85aa1c
treebd7bb5f5367dc1d8e5f9420c7463b37354629590
parentfb11f06d9026a9a449c4a5afb7e9263e88fdea22
generic/775: Fix an infinite loop due to variable name clash

We use i as the iteration variable in the main test loop as well as some
internal loops. Due to this clash, $i variable of main test loops was
getting modified by the following loop in prep_mixed_mapping().

for ((i=0; i<num_blocks; i++)); do

If num_blocks is less than 10 (example ext4 with blocksize 4k and
cluster size 8k) i would always be set as 3 and the main loop would
never exit. Use local variable to fix this and while we are at it,
rename it for clarity.

Reported-by: Disha Goel <disgoel@linux.ibm.com>
Signed-off-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/generic/775