Skip to contentSkip to conversation

selftests: ublk: two fixes

PATCH Applied Ming Lei 3 participants 6 messages Apr 22, 2025 – Apr 23, 2025

Subsystems (3)
lore
Share & tools
lore

Ming Lei

author
#0 lore raw

cover selftests: ublk: two fixes

Hello Jens,

The 1st patch fixes recover test & ublk utility, and the 2nd patch removes one useless variable from 'struct dev_ctx', both are introduced recently.

Thanks,

Ming Lei (2):
selftests: ublk: fix recover test
selftests: ublk: remove useless 'delay_us' from 'struct dev_ctx'

 tools/testing/selftests/ublk/kublk.c            | 1 +
 tools/testing/selftests/ublk/kublk.h            | 3 ---
 tools/testing/selftests/ublk/test_generic_05.sh | 2 +-
 3 files changed, 2 insertions(+), 4 deletions(-)
Signature · 1 line
2.47.0
author
#1 lore raw

PATCH 1/2 selftests: ublk: fix recover test

When adding recovery test:

- 'break' is missed for handling '-g' argument

- test name of test_generic_05.sh is wrong

So fix the two.

Fixes 57e13a2e8cd2 ("selftests: ublk: support user recovery")
---
 tools/testing/selftests/ublk/kublk.c            | 1 +
 tools/testing/selftests/ublk/test_generic_05.sh | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
tools/testing/selftests/ublk/kublk.c +1 -0
index 759f06637146..e57a1486bb48 100644
@@ -1354,6 +1354,7 @@ int main(int argc, char *argv[])
 			value = strtol(optarg, NULL, 10);
 			if (value)
 				ctx.flags |= UBLK_F_NEED_GET_DATA;
+			break;
 		case 0:
 			if (!strcmp(longopts[option_idx].name, "debug_mask"))
 				ublk_dbg_mask = strtol(optarg, NULL, 16);
tools/testing/selftests/ublk/test_generic_05.sh +1 -1
index 714630b4b329..3bb00a347402 100755
@@ -3,7 +3,7 @@
 
 . "$(cd "$(dirname "$0")" && pwd)"/test_common.sh
 
-TID="generic_04"
+TID="generic_05"
 ERR_CODE=0
 
 ublk_run_recover_test()
Signature · 1 line
2.47.0
Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH 6.15 1/2] selftests: ublk: fix recover test

Quoted 10 lines · Ming Lei

When adding recovery test:

- 'break' is missed for handling '-g' argument

- test name of test_generic_05.sh is wrong

So fix the two.

Fixes 57e13a2e8cd2 ("selftests: ublk: support user recovery")
Quoted 33 lines
---
 tools/testing/selftests/ublk/kublk.c            | 1 +
 tools/testing/selftests/ublk/test_generic_05.sh | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
tools/testing/selftests/ublk/kublk.c +1 -0
index 759f06637146..e57a1486bb48 100644
@@ -1354,6 +1354,7 @@ int main(int argc, char *argv[])
 			value = strtol(optarg, NULL, 10);
 			if (value)
 				ctx.flags |= UBLK_F_NEED_GET_DATA;
+			break;
 		case 0:
 			if (!strcmp(longopts[option_idx].name, "debug_mask"))
 				ublk_dbg_mask = strtol(optarg, NULL, 16);
tools/testing/selftests/ublk/test_generic_05.sh +1 -1
index 714630b4b329..3bb00a347402 100755
@@ -3,7 +3,7 @@
 
 . "$(cd "$(dirname "$0")" && pwd)"/test_common.sh
 
-TID="generic_04"
+TID="generic_05"
 ERR_CODE=0
 
 ublk_run_recover_test()
Signature · 1 line
2.47.0
author
#3 lore raw

PATCH 2/2 selftests: ublk: remove useless 'delay_us' from 'struct dev_ctx'

In reply to Ming Lei

'delay_us' shouldn't be added to 'struct dev_ctx' since now it is handled by per-target command line & 'struct fault_inject_ctx'.

So remove it.

Fixes 81586652bb1f ("selftests: ublk: add generic_06 for covering fault inject")
---
 tools/testing/selftests/ublk/kublk.h | 3 ---
 1 file changed, 3 deletions(-)
tools/testing/selftests/ublk/kublk.h +0 -3
index 29571eb296f1..918db5cd633f 100644
@@ -86,9 +86,6 @@ struct dev_ctx {
 	unsigned int	fg:1;
 	unsigned int	recovery:1;
 
-	/* fault_inject */
-	long long	delay_us;
-
 	int _evtfd;
 	int _shmid;
 
Signature · 1 line
2.47.0
Reviewed-by on v1 2/2
#4 lore raw

Re: [PATCH 6.15 2/2] selftests: ublk: remove useless 'delay_us' from 'struct dev_ctx'

Quoted 7 lines · Ming Lei

'delay_us' shouldn't be added to 'struct dev_ctx' since now it is handled by per-target command line & 'struct fault_inject_ctx'.

So remove it.

Fixes 81586652bb1f ("selftests: ublk: add generic_06 for covering fault inject")
Quoted 21 lines
---
 tools/testing/selftests/ublk/kublk.h | 3 ---
 1 file changed, 3 deletions(-)
tools/testing/selftests/ublk/kublk.h +0 -3
index 29571eb296f1..918db5cd633f 100644
@@ -86,9 +86,6 @@ struct dev_ctx {
 	unsigned int	fg:1;
 	unsigned int	recovery:1;
 
-	/* fault_inject */
-	long long	delay_us;
-
 	int _evtfd;
 	int _shmid;
 
Signature · 1 line
2.47.0
maintainer Applied
#5 lore raw
In reply to Ming Lei
Quoted 10 lines · Ming Lei

The 1st patch fixes recover test & ublk utility, and the 2nd patch removes one useless variable from 'struct dev_ctx', both are introduced recently.

Thanks,

Ming Lei (2):
selftests: ublk: fix recover test
selftests: ublk: remove useless 'delay_us' from 'struct dev_ctx'

[...]

Applied, thanks!

[1/2] selftests: ublk: fix recover test

      commit: 5533bc70aedc7c9872841ac8649344f8cbc6bc4c
[2/2] selftests: ublk: remove useless 'delay_us' from 'struct dev_ctx'
      commit: 8f503637898313c048bf21e386e09be90e30cc31

Best regards,

Signature · 1 line
Jens Axboe