From mboxrd@z Thu Jan 1 00:00:00 1970 From: lixiaokeng Subject: Re: [PATCH 01/14] multipathd: return if dm_get_major_minor failed in, cli_add_map Date: Fri, 4 Sep 2020 10:48:40 +0800 Message-ID: References: <37544d4c-950f-4281-3b66-e4d1884c5167@huawei.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-Language: en-GB To: Martin Wilck , Benjamin Marzinski , Christophe Varoqui , dm-devel mailing list Cc: linfeilong , "liuzhiqiang (I)" List-Id: dm-devel.ids On 2020/9/4 1:26, Martin Wilck wrote: > > Why not just quit the "do" loop in the error case > for dm_get_major_minor()? > > Martin If dm_get_major failed at first time, it will be executed again for some reason I don't know in the original code. Quiting the "do" loop in the error case for dm_get_major_minor() is against the twice attempt rule. Lixiaokeng > >> else { >> sprintf(dev_path, "dm-%d", minor); >> alias = dm_mapname(major, minor); >> + if (!alias) >> + condlog(2, "%s: mapname not found for >> %d:%d", >> + param, major, minor); >> } >> /*if there is no mapname found, we first create the >> device*/ >> if (!alias && !count) { >> - condlog(2, "%s: mapname not found for %d:%d", >> - param, major, minor); >> get_refwwid(CMD_NONE, param, DEV_DEVMAP, >> vecs->pathvec, &refwwid); >> if (refwwid) { > > > > . >