[Cluster-devel] [PATCH 3/9] gfs2: Revert 'Fix "truncate in progress" hang'

2022-06-29 Thread Andreas Gruenbacher
Now that interrupted truncates are completed in the context of the process taking the glock, there is no need for the glock state engine to delegate that task to gfs2_quotad or for quotad to perform those truncates anymore. Get rid of the obsolete associated infrastructure. Reverts commit

[Cluster-devel] [PATCH 0/9] gfs2: glock instantiation and holder auto-demotion fixes

2022-06-29 Thread Andreas Gruenbacher
So far, glocks were instantiated inside of do_promote() as part of the glock state engine logic. This code can be moved outside the state engine, which simplifies things significantly. We no longer need to release and re-acquire the glock spin lock in do_promote(), so the glock holder we're

[Cluster-devel] [PATCH 2/9] gfs2: Instantiate glocks ouside of glock state engine

2022-06-29 Thread Andreas Gruenbacher
Instantiate glocks outside of the glock state engine: there is no real reason for instantiating them inside the glock state engine; it only complicates the code. Instead, instantiate them in gfs2_glock_wait() and gfs2_glock_async_wait() using the new gfs2_glock_holder_ready() helper. On top of

[Cluster-devel] [PATCH 7/9] gfs2: do_promote glock holder stealing fix

2022-06-29 Thread Andreas Gruenbacher
From: Bob Peterson In do_promote(), when the glock had no strong holders, we were accidentally calling demote_incompat_holders() with new_gh == NULL, so no weak holders were considered incompatible. Instead, the new holder should have been passed in. For doing that, the HIF_HOLDER flag needs

[Cluster-devel] [PATCH 1/9] gfs2: Fix up gfs2_glock_async_wait

2022-06-29 Thread Andreas Gruenbacher
Since commit 1fc05c8d8426 ("gfs2: cancel timed-out glock requests"), a pending locking request can be canceled by calling gfs2_glock_dq() on the pending holder. In gfs2_glock_async_wait(), when we time out, use that to cancel the remaining locking requests and dequeue the locking requests already

[Cluster-devel] [PATCH 4/9] gfs2: Add new go_held glock operation

2022-06-29 Thread Andreas Gruenbacher
Right now, inode_go_instantiate() contains functionality that relates to how a glock is held rather than the glock itself, like waiting for pending direct I/O to complete and completing interrupted truncates. This code is meant to be run each time a holder is acquired, but go_instantiate is

[Cluster-devel] [PATCH 8/9] gfs2: List traversal in do_promote is safe

2022-06-29 Thread Andreas Gruenbacher
In do_promote(), we're never removing the current entry from the list and so the list traversal is actually safe. Switch back to list_for_each_entry(). Signed-off-by: Andreas Gruenbacher --- fs/gfs2/glock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/gfs2/glock.c

[Cluster-devel] [PATCH 5/9] gfs2: Make go_instantiate take a glock

2022-06-29 Thread Andreas Gruenbacher
Make go_instantiate take a glock instead of a glock holder as its argument: this handler is supposed to instantiate the object associated with the glock. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/glock.c | 2 +- fs/gfs2/glops.c | 3 +-- fs/gfs2/incore.h | 2 +- fs/gfs2/rgrp.c | 3 +--

[Cluster-devel] [PATCH 6/9] gfs2: Use better variable name

2022-06-29 Thread Andreas Gruenbacher
In do_promote() and add_to_queue(), use current_gh as the variable name for the first strong holder we could find: this matches the variable name is may_grant(), and more clearly indicates that we're interested in one (any) of the current strong holders. Signed-off-by: Andreas Gruenbacher ---

[Cluster-devel] [PATCH 9/9] Revert "gfs2: Stop using glock holder auto-demotion for now"

2022-06-29 Thread Andreas Gruenbacher
With the glock holder auto-demotion in do_promote fixed, we can re-enable this feature. This reverts commit e1fa9ea85ce89207d2ac0316da35a4a7736801f9. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/file.c | 46 -- 1 file changed, 32 insertions(+), 14

Re: [Cluster-devel] sparse warnings related to kref_put_lock() and refcount_dec_and_lock()

2022-06-29 Thread Alexander Aring
Hi, On Tue, Jun 28, 2022 at 1:27 PM Linus Torvalds wrote: > > On Tue, Jun 28, 2022 at 1:58 AM Luc Van Oostenryck > wrote: > > > > I would certainly not recommend this but ... > > if it's OK to cheat and lie then you can do: > > + bool refcount_dec_and_lock(refcount_t *r, spinlock_t *lock)