lkml.org 
[lkml]   [2021]   [Oct]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] counter: drop chrdev_lock
On Sun, Oct 17, 2021 at 01:55:21PM -0500, David Lechner wrote:
> This removes the chrdev_lock from the counter subsystem. This was
> intended to prevent opening the chrdev more than once. However, this
> doesn't work in practice since userspace can duplicate file descriptors
> and pass file descriptors to other processes. Since this protection
> can't be relied on, it is best to just remove it.

Much better, thanks!

One remaining question:

> --- a/include/linux/counter.h
> +++ b/include/linux/counter.h
> @@ -297,7 +297,6 @@ struct counter_ops {
> * @events: queue of detected Counter events
> * @events_wait: wait queue to allow blocking reads of Counter events
> * @events_lock: lock to protect Counter events queue read operations
> - * @chrdev_lock: lock to limit chrdev to a single open at a time
> * @ops_exist_lock: lock to prevent use during removal

Why do you still need 2 locks for the same structure?

thanks,

greg k-h

\
 
 \ /
  Last update: 2021-10-18 08:09    [W:0.271 / U:0.440 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site