lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <170544437475.23031.9738852723187400936@noble.neil.brown.name>
Date: Wed, 17 Jan 2024 09:32:54 +1100
From: "NeilBrown" <neilb@...e.de>
To: "Jeff Layton" <jlayton@...nel.org>
Cc: "Christian Brauner" <brauner@...nel.org>,
 "Alexander Viro" <viro@...iv.linux.org.uk>,
 "Eric Van Hensbergen" <ericvh@...nel.org>,
 "Latchesar Ionkov" <lucho@...kov.net>,
 "Dominique Martinet" <asmadeus@...ewreck.org>,
 "Christian Schoenebeck" <linux_oss@...debyte.com>,
 "David Howells" <dhowells@...hat.com>,
 "Marc Dionne" <marc.dionne@...istor.com>, "Xiubo Li" <xiubli@...hat.com>,
 "Ilya Dryomov" <idryomov@...il.com>, "Alexander Aring" <aahringo@...hat.com>,
 "David Teigland" <teigland@...hat.com>, "Miklos Szeredi" <miklos@...redi.hu>,
 "Andreas Gruenbacher" <agruenba@...hat.com>,
 "Trond Myklebust" <trond.myklebust@...merspace.com>,
 "Anna Schumaker" <anna@...nel.org>, "Chuck Lever" <chuck.lever@...cle.com>,
 "Olga Kornievskaia" <kolga@...app.com>, "Dai Ngo" <Dai.Ngo@...cle.com>,
 "Tom Talpey" <tom@...pey.com>, "Jan Kara" <jack@...e.cz>,
 "Mark Fasheh" <mark@...heh.com>, "Joel Becker" <jlbec@...lplan.org>,
 "Joseph Qi" <joseph.qi@...ux.alibaba.com>, "Steve French" <sfrench@...ba.org>,
 "Paulo Alcantara" <pc@...guebit.com>, "Ronnie Sahlberg" <lsahlber@...hat.com>,
 "Shyam Prasad N" <sprasad@...rosoft.com>,
 "Namjae Jeon" <linkinjeon@...nel.org>,
 "Sergey Senozhatsky" <senozhatsky@...omium.org>,
 "Steven Rostedt" <rostedt@...dmis.org>,
 "Masami Hiramatsu" <mhiramat@...nel.org>,
 "Mathieu Desnoyers" <mathieu.desnoyers@...icios.com>,
 linux-kernel@...r.kernel.org, v9fs@...ts.linux.dev,
 linux-afs@...ts.infradead.org, ceph-devel@...r.kernel.org,
 gfs2@...ts.linux.dev, linux-fsdevel@...r.kernel.org,
 linux-nfs@...r.kernel.org, ocfs2-devel@...ts.linux.dev,
 linux-cifs@...r.kernel.org, samba-technical@...ts.samba.org,
 linux-trace-kernel@...r.kernel.org, "Jeff Layton" <jlayton@...nel.org>
Subject: Re: [PATCH 13/20] filelock: convert __locks_insert_block, conflict
 and deadlock checks to use file_lock_core

On Wed, 17 Jan 2024, Jeff Layton wrote:
> Have both __locks_insert_block and the deadlock and conflict checking
> functions take a struct file_lock_core pointer instead of a struct
> file_lock one. Also, change posix_locks_deadlock to return bool.
> 
> Signed-off-by: Jeff Layton <jlayton@...nel.org>
> ---
>  fs/locks.c | 132 ++++++++++++++++++++++++++++++++-----------------------------
>  1 file changed, 70 insertions(+), 62 deletions(-)
> 


>  
>  /* Must be called with the blocked_lock_lock held! */
> -static int posix_locks_deadlock(struct file_lock *caller_fl,
> -				struct file_lock *block_fl)
> +static bool posix_locks_deadlock(struct file_lock *caller_fl,
> +				 struct file_lock *block_fl)
>  {
> +	struct file_lock_core *caller = &caller_fl->fl_core;
> +	struct file_lock_core *blocker = &block_fl->fl_core;
>  	int i = 0;
> -	struct file_lock_core *flc = &caller_fl->fl_core;
>  
>  	lockdep_assert_held(&blocked_lock_lock);
>  
> @@ -1034,16 +1040,16 @@ static int posix_locks_deadlock(struct file_lock *caller_fl,
>  	 * This deadlock detector can't reasonably detect deadlocks with
>  	 * FL_OFDLCK locks, since they aren't owned by a process, per-se.
>  	 */
> -	if (IS_OFDLCK(flc))
> +	if (IS_OFDLCK(caller))
>  		return 0;

      return false;

Thanks,
NeilBrown

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ