From: Benjamin Marzinski Subject: Re: [PATCH 69/74] libmultipath: disassemble_map(): get rid of "is_daemon" argument Date: Mon, 10 Aug 2020 23:56:30 -0500 Message-ID: <20200811045630.GR19233@octiron.msp.redhat.com> References: <20200709105145.9211-1-mwilck@suse.com> <20200709105145.9211-17-mwilck@suse.com> <20200719052617.GY11089@octiron.msp.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com Content-Disposition: inline To: Martin Wilck Cc: dm-devel@redhat.com List-Id: dm-devel.ids On Wed, Aug 05, 2020 at 10:05:19PM +0200, Martin Wilck wrote: > On Sun, 2020-07-19 at 00:26 -0500, Benjamin Marzinski wrote: > > On Thu, Jul 09, 2020 at 12:51:40PM +0200, mwilck@suse.com wrote: > > > From: Martin Wilck > > > > > > The reason for the is_daemon parameter in disassemble_map() lies > > > deep in multipath-tools' past, in b96dead ("[multipathd] remove the > > > retry login in uev_remove_path()"): By not adding paths from > > > disassembled maps to the pathvec, we avoided to re-add removed > > > paths on > > > future map reloads (logic in update_mpp_paths()). As we can handle > > > this with > > > INIT_REMOVED now, we don't need to distinguish daemon and non- > > > daemon > > > mode any more. This fixes a memory leak, because only paths which > > > are in > > > pathvec will be freed on program exit. > > > > I don't have any problems with the code in this patch. I just want to > > reiterate that I don't think that multipathd should automatically be > > adding paths, just because they were in a multipath device. In my > > opinion, multipathd should have the final decision as to what a > > multipath device should look like. If it sees an unexpected path, > > and > > runs pathinfo on it, and finds that that path does belong, it's fine > > to > > add it. But if pathinfo says that the path doesn't belong, multipathd > > shouldn't add it to the pathvec. It should instead trigger a reload > > of > > the device to remove path. > > Got it. I commented in my reply to 65/74. I'll repost this part with > the minor issues you raised fixed (hopefully). Then let's review / > discuss this again. If we agree on your PoV, we can probably ditch the > whole INIT_REMOVED part of my series. Sure. > I hope you agree that "if (!is_daemon)" so deep in libmultipath > is ugly and should be replaced by something cleaner. That really never bothered me, but I see your point. > We should take the opportunity to agree on a definition on the exact > semantics of pathvec, i.e. which devices should be members of pathvec, > and which ones shouldn't. I don't see a clear, consequent definition > currently. I think that you're correct that all paths that multipathd is dealing with should be on the pathvec. Obviously paths that are only accessable via a local variable are fine, but code shouldn't be dropping the vecs lock with a path that is accessable globally (for instance from mpp->paths) but not on the pathvec. What disassemble_map() has been doing is definitely wrong. -Ben > Martin >