Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 41b99e1a authored by Matthew R. Ochs's avatar Matthew R. Ochs Committed by Martin K. Petersen
Browse files

scsi: cxlflash: Avoid mutex when destroying context



Context information structures are protected by a mutex that is held
when accessing/manipulating the context. When the code that manages
these structures was authored, a decision was made to include taking the
mutex as part of the allocation/initialization sequence and also handle
the scenario where the mutex was already held when freeing the context.

While not a problem outright, this design decision has been deemed as
too flexible and the code should be made more rigid to avoid future
bugs.  In addition, further review of the code yields that the existing
mutex manipulations in both of these context management paths are
superfluous.

This commit removes the obtaining of the context mutex in the context
initialization routine and assumes the mutex is not held in the context
free path.

Inspired-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarMatthew R. Ochs <mrochs@linux.vnet.ibm.com>
Acked-by: default avatarManoj N. Kumar <manoj@linux.vnet.ibm.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent a850ced4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment