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

scst: Use RCU read lock when accessing sess_tgt_dev_list #151

Merged
merged 2 commits into from
Apr 17, 2023

Conversation

lnocturno
Copy link
Contributor

We must always protect sess_tgt_dev_list during access and modification.

There are two mechanisms for that:

  • tgt_dev_list_mutex for list modifications.
  • RCU for read-only list accesses.

Currently, the codebase doesn't consistently apply protection when accessing the list. Fix this by adding RCU protection.

See also commit 3e64094 ("scst_sysfs: Do not suspend I/O for LUN management").

We must always protect sess_tgt_dev_list during access and
modification.

There are two mechanisms for that:

- tgt_dev_list_mutex for list modifications.
- RCU for read-only list accesses.

Currently, the codebase doesn't consistently apply protection when
accessing the list. Fix this by adding RCU protection.

See also commit 3e64094 ("scst_sysfs: Do not suspend I/O for LUN
management").
@lnocturno lnocturno force-pushed the 3.8/gleb/fix_sess_tgt_dev_list_access branch from 0057d3a to 87999af Compare April 17, 2023 14:04
In the previous commit, we introduced the use of RCU protection when
accessing sess_tgt_dev_list in scst_get_max_lun_commands().

As a result, we can now drop the use of scst_mutex when accessing the
list.
@lnocturno lnocturno force-pushed the 3.8/gleb/fix_sess_tgt_dev_list_access branch from 87999af to b4bd27f Compare April 17, 2023 14:09
@lnocturno lnocturno merged commit 33b8323 into master Apr 17, 2023
@lnocturno lnocturno deleted the 3.8/gleb/fix_sess_tgt_dev_list_access branch April 17, 2023 14:16
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.

1 participant