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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <244954CF-C177-406C-9CAC-6F62D65C94DE@oracle.com>
Date: Thu, 12 Sep 2024 14:01:27 +0000
From: Chuck Lever III <chuck.lever@...cle.com>
To: Benjamin Coddington <bcodding@...hat.com>,
        Christian Brauner
	<brauner@...nel.org>
CC: Jeff Layton <jlayton@...nel.org>, Amir Goldstein <amir73il@...il.com>,
        Neil Brown <neilb@...e.de>, Trond Myklebust <trondmy@...nel.org>,
        Anna
 Schumaker <anna@...nel.org>, Jonathan Corbet <corbet@....net>,
        Andreas
 Gruenbacher <agruenba@...hat.com>,
        Mark Fasheh <mark@...heh.com>, Joel Becker
	<jlbec@...lplan.org>,
        Joseph Qi <joseph.qi@...ux.alibaba.com>,
        Al Viro
	<viro@...iv.linux.org.uk>, Jan Kara <jack@...e.cz>,
        Alexander Ahring Oder
 Aring <aahringo@...hat.com>,
        Linux FS Devel <linux-fsdevel@...r.kernel.org>,
        Linux NFS Mailing List <linux-nfs@...r.kernel.org>,
        "linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
        Linux Kernel Mailing
 List <linux-kernel@...r.kernel.org>,
        "gfs2@...ts.linux.dev"
	<gfs2@...ts.linux.dev>,
        "ocfs2-devel@...ts.linux.dev"
	<ocfs2-devel@...ts.linux.dev>
Subject: Re: [PATCH v1 0/4] Fixup NLM and kNFSD file lock callbacks



> On Sep 11, 2024, at 3:42 PM, Benjamin Coddington <bcodding@...hat.com> wrote:
> 
> Last year both GFS2 and OCFS2 had some work done to make their locking more
> robust when exported over NFS.  Unfortunately, part of that work caused both
> NLM (for NFS v3 exports) and kNFSD (for NFSv4.1+ exports) to no longer send
> lock notifications to clients.
> 
> This in itself is not a huge problem because most NFS clients will still
> poll the server in order to acquire a conflicted lock, but now that I've
> noticed it I can't help but try to fix it because there are big advantages
> for setups that might depend on timely lock notifications, and we've
> supported that as a feature for a long time.
> 
> Its important for NLM and kNFSD that they do not block their kernel threads
> inside filesystem's file_lock implementations because that can produce
> deadlocks.  We used to make sure of this by only trusting that
> posix_lock_file() can correctly handle blocking lock calls asynchronously,
> so the lock managers would only setup their file_lock requests for async
> callbacks if the filesystem did not define its own lock() file operation.
> 
> However, when GFS2 and OCFS2 grew the capability to correctly
> handle blocking lock requests asynchronously, they started signalling this
> behavior with EXPORT_OP_ASYNC_LOCK, and the check for also trusting
> posix_lock_file() was inadvertently dropped, so now most filesystems no
> longer produce lock notifications when exported over NFS.
> 
> I tried to fix this by simply including the old check for lock(), but the
> resulting include mess and layering violations was more than I could accept.
> There's a much cleaner way presented here using an fop_flag, which while
> potentially flag-greedy, greatly simplifies the problem and grooms the
> way for future uses by both filesystems and lock managers alike.
> 
> Criticism welcomed,
> Ben
> 
> Benjamin Coddington (4):
>  fs: Introduce FOP_ASYNC_LOCK
>  gfs2/ocfs2: set FOP_ASYNC_LOCK
>  NLM/NFSD: Fix lock notifications for async-capable filesystems
>  exportfs: Remove EXPORT_OP_ASYNC_LOCK
> 
> Documentation/filesystems/nfs/exporting.rst |  7 -------
> fs/gfs2/export.c                            |  1 -
> fs/gfs2/file.c                              |  2 ++
> fs/lockd/svclock.c                          |  5 ++---
> fs/nfsd/nfs4state.c                         | 19 ++++---------------
> fs/ocfs2/export.c                           |  1 -
> fs/ocfs2/file.c                             |  2 ++
> include/linux/exportfs.h                    | 13 -------------
> include/linux/filelock.h                    |  5 +++++
> include/linux/fs.h                          |  2 ++
> 10 files changed, 17 insertions(+), 40 deletions(-)
> 
> -- 
> 2.44.0
> 

For the NFSD and exportfs hunks:

Acked-by: Chuck Lever <chuck.lever@...cle.com <mailto:chuck.lever@...cle.com>>

"lockd: introduce safe async lock op" is in v6.10. Does this
series need to be backported to v6.10.y ? Should the series
have "Fixes: 2dd10de8e6bc ("lockd: introduce safe async lock
 op")" ?


--
Chuck Lever


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ