[dm-devel] [PATCH 3/4] libmultipath: use regular array for field widths

Martin Wilck martin.wilck at suse.com
Fri Oct 21 20:12:51 UTC 2022


On Fri, 2022-10-21 at 12:51 -0500, Benjamin Marzinski wrote:
> On Fri, Oct 21, 2022 at 07:04:55AM +0000, Martin Wilck wrote:
> > On Tue, 2022-10-11 at 16:53 -0500, Benjamin Marzinski wrote:
> > > We know the size of these arrays, so we can just allocate them on
> > > the
> > > stack. Also, show_path() doesn't use the width, so don't
> > > initialize
> > > it
> > > in the first place.
> > > 
> > > Signed-off-by: Benjamin Marzinski <bmarzins at redhat.com>
> > 
> > This isn't wrong, but I'm not sure what it actually achieves except
> > a
> > few less NULL checks (I'm sure you're aware that this doesn't mean
> > better protection against out-of-memory situations). It comes at
> > the
> > cost of an ABI change. I understand that the intention is to
> > eliminate
> > __attribute__((cleanup())). But if we agree we don't want to do
> > that
> > everywhere, I see no particular reason to do it in this code path.
> > 
> > I'm not totally against it, but I'm not enthusiastic, either.
> 
> That's fine. How about I send a patch to just fix show_path().

Yes, please.

Martin



More information about the dm-devel mailing list