Skip to content

dm/003: fix readonly variable conflict by renaming TO_SKIP to SKIP_VAL#204

Closed
yizhanglinux wants to merge 1 commit intolinux-blktests:masterfrom
yizhanglinux:dm-003-fix
Closed

dm/003: fix readonly variable conflict by renaming TO_SKIP to SKIP_VAL#204
yizhanglinux wants to merge 1 commit intolinux-blktests:masterfrom
yizhanglinux:dm-003-fix

Conversation

@yizhanglinux
Copy link
Copy Markdown
Contributor

@yizhanglinux yizhanglinux commented Sep 12, 2025

The TO_SKIP variable was declared as readonly but conflicts with an existing readonly variable in nvme/065, causing "readonly variable" errors when running tests in certain orders. Rename TO_SKIP to SKIP_VAL to avoid the naming conflict.

$ ./check dm/003 nvme/065
tests/nvme/065: line 23: TO_SKIP: readonly variable
dm/003 (test unmap write zeroes sysfs interface with dm devices) [passed]
runtime 5.790s ... 5.839s
nvme/065 (test unmap write zeroes sysfs interface with nvmet devices) [passed]
runtime 9.534s ... 9.619s
$ ./check nvme/065 dm/003
tests/dm/003: line 18: TO_SKIP: readonly variable
dm/003 (test unmap write zeroes sysfs interface with dm devices) [passed]
runtime 5.839s ... 5.728s
nvme/065 (test unmap write zeroes sysfs interface with nvmet devices) [passed]
runtime 9.619s ... 9.546s

The TO_SKIP variable was declared as readonly but conflicts with an
existing readonly variable in nvme/065, causing "readonly variable"
errors when running tests in certain orders. Rename TO_SKIP to SKIP_VAL
to avoid the naming conflict.

$ ./check dm/003 nvme/065
tests/nvme/065: line 23: TO_SKIP: readonly variable
dm/003 (test unmap write zeroes sysfs interface with dm devices) [passed]
    runtime  5.790s  ...  5.839s
nvme/065 (test unmap write zeroes sysfs interface with nvmet devices) [passed]
    runtime  9.534s  ...  9.619s
$ ./check nvme/065 dm/003
tests/dm/003: line 18: TO_SKIP: readonly variable
dm/003 (test unmap write zeroes sysfs interface with dm devices) [passed]
    runtime  5.839s  ...  5.728s
nvme/065 (test unmap write zeroes sysfs interface with nvmet devices) [passed]
    runtime  9.619s  ...  9.546s

Signed-off-by: Yi Zhang <yi.zhang@redhat.com>
kawasaki added a commit to kawasaki/blktests that referenced this pull request Sep 18, 2025
TO_SKIP is defined as readonly at two places in dm/003 and nvme/065.
When these two test cases are run at once, bash complains that the
readonly value is assigned twice. To avoid the error, do not declare the
value as readonly. Also, move the declarations of TO_SKIP to common/rc
to avoid the duplicated declarations.

Link: linux-blktests#204
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
kawasaki added a commit to kawasaki/blktests that referenced this pull request Sep 18, 2025
TO_SKIP is defined as readonly at two places in dm/003 and nvme/065.
When these two test cases are run at once, bash complains that the
readonly value is assigned twice. To avoid the error, do not declare the
value as readonly. Also, move the declarations of TO_SKIP to common/rc
to avoid the duplicated declarations.

Reported-by: Yi Zhang <yi.zhang@redhat.com>
Link: linux-blktests#204
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
@kawasaki
Copy link
Copy Markdown
Collaborator

@yizhanglinux Thank you for catching this. As to the fix approach, I think it's the better to avoid the duplication. So how about moving the TO_SKIP declarations to common/rc. I created a patch to do it. If you don't mind, I will apply this fix.

@yizhanglinux
Copy link
Copy Markdown
Contributor Author

@yizhanglinux Thank you for catching this. As to the fix approach, I think it's the better to avoid the duplication. So how about moving the TO_SKIP declarations to common/rc. I created a patch to do it. If you don't mind, I will apply this fix.

Yeah, I agree, your approach looks better, thanks. :)

@kawasaki
Copy link
Copy Markdown
Collaborator

@yizhanglinux Thanks for the comment. I have applied the patch.

@kawasaki kawasaki closed this Sep 22, 2025
@yizhanglinux yizhanglinux deleted the dm-003-fix branch October 17, 2025 04:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants