From: Bob Peterson Date: Thu, 15 Aug 2019 09:41:26 -0400 (EDT) Subject: [Cluster-devel] [GFS2 PATCH 2/2] gfs2: Use async glocks for rename In-Reply-To: <20190815132722.1522-3-rpeterso@redhat.com> References: <20190815132722.1522-1-rpeterso@redhat.com> <20190815132722.1522-3-rpeterso@redhat.com> Message-ID: <1147324513.8687737.1565876486114.JavaMail.zimbra@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit I just noticed the parameter comments for gfs2_glock_async_wait are wrong, and I've fixed them in a newer version. I can post the new version after I get people's initial reactions. Bob ----- Original Message ----- > Because s_vfs_rename_mutex is not cluster-wide, multiple nodes can > reverse the roles of which directories are "old" and which are "new" > for the purposes of rename. This can cause deadlocks where two nodes > can lock old-then-new but since their roles are reversed, they wait > for each other. > > This patch fixes the problem by acquiring all gfs2_rename's inode > glocks asychronously and waits for all glocks to be acquired. > That way all inodes are locked regardless of the order. > > Signed-off-by: Bob Peterson > --- (snip) > + * gfs2_glock_async_wait - wait on multiple asynchronous glock acquisitions > + * @gh: the glock holder (snip) > +int gfs2_glock_async_wait(unsigned int num_gh, struct gfs2_holder *ghs)