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
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
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
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
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
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
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
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 +--
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
---
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
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)
11 matches
Mail list logo