From: Christoph Hellwig Date: Wed, 15 Jan 2020 20:07:44 +0100 Subject: [Cluster-devel] RFC: hold i_rwsem until aio completes In-Reply-To: <849239ff-d2d1-4048-da58-b4347e0aa2bd@redhat.com> References: <20200114161225.309792-1-hch@lst.de> <20200114192700.GC22037@ziepe.ca> <20200115065614.GC21219@lst.de> <20200115132428.GA25201@ziepe.ca> <20200115143347.GL2827@hirez.programming.kicks-ass.net> <20200115144948.GB25201@ziepe.ca> <849239ff-d2d1-4048-da58-b4347e0aa2bd@redhat.com> Message-ID: <20200115190744.GA2628@lst.de> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Wed, Jan 15, 2020 at 02:03:22PM -0500, Waiman Long wrote: > >> (1) no unlocking by another process than the one that acquired it > >> (2) no return to userspace with locks held > > As an example flow: obtain the read side lock, schedual a work queue, > > return to user space, and unlock the read side from the work queue. > > We currently have down_read_non_owner() and up_read_non_owner() that > perform the lock and unlock without lockdep tracking. Of course, that is > a hack and their use must be carefully scrutinized to make sure that > there is no deadlock or other potentially locking issues. That doesn't help with returning to userspace while the lock is held.