All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Wilck <mwilck@suse.com>
To: Benjamin Marzinski <bmarzins@redhat.com>
Cc: dm-devel@redhat.com, Guozhonghua <guozh88@chinatelecom.cn>
Subject: Re: [dm-devel] [PATCH v2 06/11] libmultipath: add callback for remove_map()
Date: Tue, 22 Mar 2022 09:35:48 +0100	[thread overview]
Message-ID: <e1064847c02559b157238ec104aa75b3568fd4f6.camel@suse.com> (raw)
In-Reply-To: <CAPt1nt4LU_pHJA2m9zWjPhn2i=WOaVnzgiKY+V5za=u2a6StUQ@mail.gmail.com>

On Mon, 2022-03-21 at 19:28 -0500, Benjamin Marzinski wrote:
> On Fri, Mar 18, 2022 at 5:33 PM <mwilck@suse.com> wrote:
> > 
> > From: Martin Wilck <mwilck@suse.com>
> > 
> > This callback is be used by multipathd to unblock pending
> > reconfigure requests if a map is removed that multipathd is
> > currently
> > waiting for.
> > 
> > Signed-off-by: Martin Wilck <mwilck@suse.com>
> > ---
> >  libmultipath/libmultipath.version | 3 ++-
> >  libmultipath/structs_vec.c        | 6 ++++++
> >  2 files changed, 8 insertions(+), 1 deletion(-)
> > 
> > diff --git a/libmultipath/libmultipath.version
> > b/libmultipath/libmultipath.version
> > index 216f0ee..8132df7 100644
> > --- a/libmultipath/libmultipath.version
> > +++ b/libmultipath/libmultipath.version
> > @@ -31,7 +31,7 @@
> >   *   The new version inherits the previous ones.
> >   */
> > 
> > -LIBMULTIPATH_14.0.0 {
> > +LIBMULTIPATH_14.1.0 {
> >  global:
> >         /* symbols referenced by multipath and multipathd */
> >         add_foreign;
> > @@ -164,6 +164,7 @@ global:
> >         remember_wwid;
> >         remove_map;
> >         remove_map_by_alias;
> > +       remove_map_callback;
> >         remove_maps;
> >         remove_wwid;
> >         replace_wwids;
> > diff --git a/libmultipath/structs_vec.c
> > b/libmultipath/structs_vec.c
> > index 6c23df8..a69f064 100644
> > --- a/libmultipath/structs_vec.c
> > +++ b/libmultipath/structs_vec.c
> > @@ -336,11 +336,17 @@ void set_path_removed(struct path *pp)
> >         pp->initialized = INIT_REMOVED;
> >  }
> > 
> > +void remove_map_callback(struct multipath *mpp
> > __attribute__((unused)))
> > +{
> > +}
> > +
> 
> Does this work? I thought that unless you specifically declared the
> symbol weak, the call in remove_map() would have already gotten
> resolved to point to the existing remove_map_callback() when the
> shared library was getting created.  Is it because the function is
> empty? Am I just misunderstanding something?

This works because I added the symbol to libmultipath.version,
assigning it "global" visibility. To be consistent, we could do the
same thing with get_multipath_config() et al., but I didn't want to
change that just now.

We (or actually, users and distro integrators) have to be somewhat
careful with adding linker flags. As discussed e.g. in
https://github.com/opensvc/multipath-tools/issues/26
flags like "-Bsymbolic-functions" would mess this up, because this flag
overrides the settings from our linker script. But declaring the symbol
"weak" wouldn't protect against -Bsymbolic mess-up, either.

I had a long discussion with our toolchain experts about this, which
lead to the conclusion above. I am pretty positive about it. 
Feel free to ask the RH experts, too ;-)

Regards
Martin


--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


  reply	other threads:[~2022-03-22  8:36 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-18 22:33 [dm-devel] [PATCH v2 00/11] multipathd: fix __delayed_reconfig logic mwilck
2022-03-18 22:33 ` [dm-devel] [PATCH v2 01/11] multipathd: child(): remove superfluous if condition mwilck
2022-03-22  0:18   ` Benjamin Marzinski
2022-03-18 22:33 ` [dm-devel] [PATCH v2 02/11] multipathd: set reload_type in when calling reconfigure() mwilck
2022-03-18 22:33 ` [dm-devel] [PATCH v2 03/11] multipathd: avoid busy loop in child() for delayed reconfigure mwilck
2022-03-22  0:19   ` Benjamin Marzinski
2022-03-18 22:33 ` [dm-devel] [PATCH v2 04/11] multipathd: reset __delayed_reconfig from ev_add_map() mwilck
2022-03-22  0:21   ` Benjamin Marzinski
2022-03-18 22:33 ` [dm-devel] [PATCH v2 05/11] multipathd: remove volatile qualifier from running_state mwilck
2022-03-22  0:23   ` Benjamin Marzinski
2022-03-18 22:33 ` [dm-devel] [PATCH v2 06/11] libmultipath: add callback for remove_map() mwilck
2022-03-22  0:28   ` Benjamin Marzinski
2022-03-22  8:35     ` Martin Wilck [this message]
2022-03-22 14:59       ` Benjamin Marzinski
2022-03-22 16:37         ` Martin Wilck
2022-03-18 22:33 ` [dm-devel] [PATCH v2 07/11] multipathd: use remove_map_callback for delayed reconfigure mwilck
2022-03-22  0:34   ` Benjamin Marzinski
2022-03-22  9:08     ` Martin Wilck
2022-03-22 15:36       ` Benjamin Marzinski
2022-03-18 22:33 ` [dm-devel] [PATCH v2 08/11] libmultipath: warn only once about deprecated options mwilck
2022-03-22  0:34   ` Benjamin Marzinski
2022-03-18 22:33 ` [dm-devel] [PATCH v2 09/11] multipathd: improve logging of reconfigure() mwilck
2022-03-22  0:35   ` Benjamin Marzinski
2022-03-18 22:33 ` [dm-devel] [PATCH v2 10/11] multipathd: log state changes mwilck
2022-03-22  0:37   ` Benjamin Marzinski
2022-03-18 22:33 ` [dm-devel] [PATCH v2 11/11] multipathd: remove unhelpful startup / shutdown messages mwilck
2022-03-22  0:43   ` Benjamin Marzinski
2022-03-22  9:30     ` Martin Wilck
2022-03-22 15:38       ` Benjamin Marzinski

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=e1064847c02559b157238ec104aa75b3568fd4f6.camel@suse.com \
    --to=mwilck@suse.com \
    --cc=bmarzins@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=guozh88@chinatelecom.cn \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.