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) { > > > > . > -- dm-devel mailing list dm-devel@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/dm-devel