lkml.org 
[lkml]   [2020]   [Feb]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] scsi: sr: get rid of sr global mutex
On Tue, Feb 18, 2020 at 09:20:28AM -0800, James Bottomley wrote:
> > > Replace the global mutex with per-sr-device mutex.
> >
> > Do we actually need the lock at all? What is protected by it?
>
> We do at least for cdrom_open. It modifies the cdi structure with no
> other protection and concurrent modification would at least screw up
> the use counter which is not atomic. Same reasoning for cdrom_release.

Wouldn't the right fix to add locking to cdrom_open/release instead of
having an undocumented requirement for the callers?

\
 
 \ /
  Last update: 2020-02-18 18:24    [W:0.049 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site