Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NAS-126694 / 23.10.2 / scst.h, scst, device handlers: Fix scst_replace_port_info #18

Merged
merged 1 commit into from
Jan 22, 2024

Conversation

bmeagherix
Copy link

scst_pass_through_cmd_done can run in interrupt context, and call scst_replace_port_info, which in turn was calling scst_lookup_tg_id. Since scst_lookup_tg_id does a mutex_lock, we should not call it from interrupt context.

Add scst_cmd_inquired_dev_ident and use in various locations.


This is a backport of a commit (df039cb) which has been accepted upstream, and is currently part of truenas-3.8.x branch.

Also performed some unit testing of 23.10 with this change:

[2024-01-22 13:08:53] api2/test_001_iscsi.py::test_06_test_ssh PASSED
[2024-01-22 13:08:56] api2/test_261_iscsi_cmd.py::test_00_setup PASSED
[2024-01-22 13:09:05] api2/test_261_iscsi_cmd.py::test_01_inquiry PASSED
[2024-01-22 13:09:26] api2/test_261_iscsi_cmd.py::test_02_read_capacity16 PASSED
[2024-01-22 13:10:12] api2/test_261_iscsi_cmd.py::test_03_readwrite16_file_extent PASSED
[2024-01-22 13:10:40] api2/test_261_iscsi_cmd.py::test_04_readwrite16_zvol_extent PASSED
[2024-01-22 13:11:08] api2/test_261_iscsi_cmd.py::test_05_chap PASSED
[2024-01-22 13:11:31] api2/test_261_iscsi_cmd.py::test_06_mutual_chap PASSED
[2024-01-22 13:11:55] api2/test_261_iscsi_cmd.py::test_07_report_luns PASSED
[2024-01-22 13:12:27] api2/test_261_iscsi_cmd.py::test_08_snapshot_zvol_extent PASSED
[2024-01-22 13:13:29] api2/test_261_iscsi_cmd.py::test_09_snapshot_file_extent PASSED
[2024-01-22 13:14:28] api2/test_261_iscsi_cmd.py::test_10_target_alias PASSED
[2024-01-22 13:15:00] api2/test_261_iscsi_cmd.py::test_11_modify_portal PASSED
[2024-01-22 13:15:09] api2/test_261_iscsi_cmd.py::test_12_pblocksize_setting PASSED
[2024-01-22 13:15:50] api2/test_261_iscsi_cmd.py::test_13_test_target_name[FILE] PASSED
[2024-01-22 13:16:25] api2/test_261_iscsi_cmd.py::test_13_test_target_name[VOLUME] PASSED
[2024-01-22 13:17:03] api2/test_261_iscsi_cmd.py::test_14_target_lun_extent_modify[FILE] PASSED
[2024-01-22 13:18:07] api2/test_261_iscsi_cmd.py::test_14_target_lun_extent_modify[VOLUME] PASSED
[2024-01-22 13:19:17] api2/test_261_iscsi_cmd.py::test_15_test_isns PASSED
[2024-01-22 13:19:59] api2/test_261_iscsi_cmd.py::TestFixtureInitiatorName::test_16_invalid_initiator_name[None-True] PASSED
[2024-01-22 13:20:12] api2/test_261_iscsi_cmd.py::TestFixtureInitiatorName::test_16_invalid_initiator_name[iqn.1991-05.com.microsoft:fake-host-True] PASSED
[2024-01-22 13:20:16] api2/test_261_iscsi_cmd.py::TestFixtureInitiatorName::test_16_invalid_initiator_name[iqn.1991-05.com.microsoft:fake-/-host-False] PASSED
[2024-01-22 13:20:20] api2/test_261_iscsi_cmd.py::TestFixtureInitiatorName::test_16_invalid_initiator_name[iqn.1991-05.com.microsoft:fake-#-host-False] PASSED
[2024-01-22 13:20:23] api2/test_261_iscsi_cmd.py::TestFixtureInitiatorName::test_16_invalid_initiator_name[iqn.1991-05.com.microsoft:fake-%s-host-False] PASSED
[2024-01-22 13:20:27] api2/test_261_iscsi_cmd.py::TestFixtureInitiatorName::test_16_invalid_initiator_name[iqn.1991-05.com.microsoft:unicode-\u6d4b\u8bd5-ok-True] PASSED
[2024-01-22 13:20:31] api2/test_261_iscsi_cmd.py::TestFixtureInitiatorName::test_16_invalid_initiator_name[iqn.1991-05.com.microsoft:unicode-\u30c6\u30b9\u30c8-ok-True] PASSED
[2024-01-22 13:20:35] api2/test_261_iscsi_cmd.py::TestFixtureInitiatorName::test_16_invalid_initiator_name[iqn.1991-05.com.microsoft:unicode-\u180e-bad-False] PASSED
[2024-01-22 13:20:39] api2/test_261_iscsi_cmd.py::TestFixtureInitiatorName::test_16_invalid_initiator_name[iqn.1991-05.com.microsoft:unicode-\u2009-bad-False] PASSED
[2024-01-22 13:20:42] api2/test_261_iscsi_cmd.py::TestFixtureInitiatorName::test_16_invalid_initiator_name[iqn.1991-05.com.microsoft:unicode-\ufeff-bad-False] PASSED
[2024-01-22 13:20:54] api2/test_261_iscsi_cmd.py::test_17_basic_persistent_reservation PASSED
[2024-01-22 13:21:18] api2/test_261_iscsi_cmd.py::test_18_persistent_reservation_two_initiators PASSED
[2024-01-22 13:22:10] api2/test_261_iscsi_cmd.py::test_19_alua_config PASSED
[2024-01-22 13:26:06] api2/test_261_iscsi_cmd.py::test_20_alua_basic_persistent_reservation PASSED
[2024-01-22 13:26:50] api2/test_261_iscsi_cmd.py::test_21_alua_persistent_reservation_two_initiators PASSED
[2024-01-22 13:28:33] api2/test_261_iscsi_cmd.py::test_22_extended_copy[FILE-FILE] PASSED
[2024-01-22 13:29:14] api2/test_261_iscsi_cmd.py::test_22_extended_copy[FILE-VOLUME] PASSED
[2024-01-22 13:29:59] api2/test_261_iscsi_cmd.py::test_22_extended_copy[VOLUME-FILE] PASSED
[2024-01-22 13:30:44] api2/test_261_iscsi_cmd.py::test_22_extended_copy[VOLUME-VOLUME] PASSED
[2024-01-22 13:31:30] api2/test_261_iscsi_cmd.py::test_23_ha_extended_copy[FILE-FILE] PASSED
[2024-01-22 13:33:07] api2/test_261_iscsi_cmd.py::test_23_ha_extended_copy[FILE-VOLUME] PASSED
[2024-01-22 13:34:46] api2/test_261_iscsi_cmd.py::test_23_ha_extended_copy[VOLUME-FILE] PASSED
[2024-01-22 13:36:25] api2/test_261_iscsi_cmd.py::test_23_ha_extended_copy[VOLUME-VOLUME] PASSED
[2024-01-22 13:38:03] api2/test_261_iscsi_cmd.py::test_24_iscsi_target_disk_login PASSED
[2024-01-22 13:38:57] api2/test_261_iscsi_cmd.py::test_25_resize_target_zvol PASSED
[2024-01-22 13:39:25] api2/test_261_iscsi_cmd.py::test_26_resize_target_file PASSED
[2024-01-22 13:39:50] api2/test_261_iscsi_cmd.py::test_27_initiator_group PASSED
[2024-01-22 13:40:31] api2/test_261_iscsi_cmd.py::test_28_portal_access PASSED
[2024-01-22 13:41:14] api2/test_261_iscsi_cmd.py::test_29_multiple_extents PASSED
[2024-01-22 13:41:41] api2/test_261_iscsi_cmd.py::test_30_target_without_active_extent PASSED
[2024-01-22 13:42:36] api2/test_261_iscsi_cmd.py::test_32_multi_lun_targets PASSED
[2024-01-22 13:43:53] api2/test_261_iscsi_cmd.py::test_99_teardown PASSED

=============================================================================== 51 passed in 2112.85s (0:35:12) ===============================================================================

scst_pass_through_cmd_done can run in interrupt context, and call
scst_replace_port_info, which in turn was calling scst_lookup_tg_id.
Since scst_lookup_tg_id does a mutex_lock, we should not call it from
interrupt context.

Add scst_cmd_inquired_dev_ident and use in various locations.
@bugclerk bugclerk changed the title scst.h, scst, device handlers: Fix scst_replace_port_info NAS-126694 / 23.10.2 / scst.h, scst, device handlers: Fix scst_replace_port_info Jan 22, 2024
@bugclerk
Copy link

@bmeagherix bmeagherix requested a review from yocalebo January 22, 2024 21:51
Copy link

@yocalebo yocalebo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic, fix seems isolated enough.

@yocalebo yocalebo merged commit 259d4d7 into stable/cobia Jan 22, 2024
0 of 4 checks passed
@yocalebo yocalebo deleted the NAS-126694 branch January 22, 2024 22:32
@bugclerk
Copy link

This PR has been merged and conversations have been locked.
If you would like to discuss more about this issue please use our forums or raise a Jira ticket.

@truenas truenas locked as resolved and limited conversation to collaborators Jan 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants