gfs2.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Alexander Aring <aahringo@redhat.com>
To: teigland@redhat.com
Cc: gfs2@lists.linux.dev
Subject: Re: [RFC v6.8-rc6 6/7] dlm: fix race between final callback and remove
Date: Fri, 8 Mar 2024 11:30:39 -0500	[thread overview]
Message-ID: <CAK-6q+hYA-6MNcvrVYzZeJfy0xT_jMo5HaNU1h10i=P0pm9utQ@mail.gmail.com> (raw)
In-Reply-To: <20240308161818.2388451-7-aahringo@redhat.com>

Hi,

On Fri, Mar 8, 2024 at 11:18 AM Alexander Aring <aahringo@redhat.com> wrote:
...
> -}
> -
>  /* Figure out if this lock is at the end of its life and no longer
>     available for the application to use.  The lkb still exists until
>     the final ast is read.  A lock becomes EOL in three situations:
> @@ -198,6 +181,7 @@ void dlm_user_add_ast(struct dlm_lkb *lkb, uint32_t flags, int mode,
>         struct dlm_ls *ls;
>         struct dlm_user_args *ua;
>         struct dlm_user_proc *proc;
> +       struct dlm_callback *cb;
>         int rv;
>
>         if (test_bit(DLM_DFL_ORPHAN_BIT, &lkb->lkb_dflags) ||
> @@ -229,11 +213,18 @@ void dlm_user_add_ast(struct dlm_lkb *lkb, uint32_t flags, int mode,
>
>         spin_lock(&proc->asts_spin);
>
> -       rv = dlm_enqueue_lkb_callback(lkb, flags, mode, status, sbflags);
> +       rv = dlm_queue_lkb_callback(lkb, flags, mode, status, sbflags, &cb);
>         switch (rv) {
>         case DLM_ENQUEUE_CALLBACK_NEED_SCHED:
> -               kref_get(&lkb->lkb_ref);
> -               list_add_tail(&lkb->lkb_cb_list, &proc->asts);
> +               cb->ua = *ua;
> +               cb->lkb_lksb = &cb->ua.lksb;
> +               if (cb->copy_lvb) {
> +                       memcpy(&cb->lvbptr, lkb->lkb_lksb->sb_lvbptr,
> +                              DLM_USER_LVB_LEN);

That should be:

memcpy(cb->lvbptr, ua->lksb.sb_lvbptr, DLM_USER_LVB_LEN);

as for user space callbacks the lvbptr information is not in
lkb->lkb_lksb->sb_lvbptr it's in lkb->lkb_ua->...

I have it on my list to "more" merge the kernel and user space
handling to have it at one place only...

- Alex


  reply	other threads:[~2024-03-08 16:30 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-08 16:18 [RFC v6.8-rc6 0/7] dlm: fix race between callback and remove message Alexander Aring
2024-03-08 16:18 ` [RFC v6.8-rc6 1/7] dlm: fix user space lock decision to copy lvb Alexander Aring
2024-03-10 14:27   ` Alexander Aring
2024-03-08 16:18 ` [RFC v6.8-rc6 2/7] dlm: remove lkb from ast bast tracepoints Alexander Aring
2024-03-08 16:18 ` [RFC v6.8-rc6 3/7] dlm: remove callback queue debugfs functionality Alexander Aring
2024-03-08 16:18 ` [RFC v6.8-rc6 4/7] dlm: move lkb debug information out of callback Alexander Aring
2024-03-08 16:18 ` [RFC v6.8-rc6 5/7] dlm: combine switch case fail and default statements Alexander Aring
2024-03-08 16:18 ` [RFC v6.8-rc6 6/7] dlm: fix race between final callback and remove Alexander Aring
2024-03-08 16:30   ` Alexander Aring [this message]
2024-03-13 13:46   ` Alexander Aring
2024-03-08 16:18 ` [RFC v6.8-rc6 7/7] dlm: remove callback reference counting Alexander Aring
2024-03-10 14:25   ` Alexander Aring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAK-6q+hYA-6MNcvrVYzZeJfy0xT_jMo5HaNU1h10i=P0pm9utQ@mail.gmail.com' \
    --to=aahringo@redhat.com \
    --cc=gfs2@lists.linux.dev \
    --cc=teigland@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).