[dm-devel] [RFC Patch 2/3] libmultipath: make sysfs_is_multipathed able to return wwid

Benjamin Marzinski bmarzins at redhat.com
Tue Mar 31 15:39:34 UTC 2020


On Tue, Mar 31, 2020 at 01:06:01PM +0000, Martin Wilck wrote:
> On Mon, 2020-03-30 at 21:00 -0500, Benjamin Marzinski wrote:
> > @@ -342,9 +342,25 @@ bool sysfs_is_multipathed(const struct path *pp)
> >  		if (nr == sizeof(uuid) && !memcmp(uuid, "mpath-",
> > sizeof(uuid)))
> >  			found = true;
> >  		else if (nr < 0) {
> > -			condlog(1, "%s: error reading from %s: %s",
> > -				__func__, pathbuf, strerror(errno));
> > +			condlog(1, "%s: error reading from %s: %m",
> > +				__func__, pathbuf);
> >  		}
> > +		if (found && set_wwid) {
> > +			nr = read(fd, pp->wwid, WWID_SIZE);
> 
> I'd rather read the whole UUID in a single syscall (i.e. merge this
> with the previous read() that fetched the first 6 chars).

Sure.

-Ben

> Regards,
> Martin
> 
> 
> -- 
> Dr. Martin Wilck <mwilck at suse.com>, Tel. +49 (0)911 74053 2107
> SUSE  Software Solutions Germany GmbH
> HRB 36809, AG Nürnberg GF: Felix
> Imendörffer
> 




More information about the dm-devel mailing list