[dm-devel] Re: multipath tools racy on RUN file.

Dave Olien dmo at osdl.org
Tue Oct 19 00:44:30 UTC 2004


This change would be especially handy for dealing with those
cases in multipath/pgpolicies.c.  There are several functions
in that file that exit(1) on error, rather than returning a
failure status.

This means that whenever these errors occur, the multipath.run file
is left behind.

I'm also wondering whether you really want these failure cases to
just exit() on error.

On Mon, Oct 18, 2004 at 04:52:51PM -0700, Dave Olien wrote:
> 
> By the way, this should cancel the alarm() after the fcntl()....
> 
> > 
> > 	fd = open(RUN, O_CREAT)
> > 	if (fd < 0)
> > 		error
> > 
> > 	struct flock fl;
> > 	fl.l_type = FWRLCK;
> > 	fl.l_whence = 0;
> > 	fl.l_start = 0;
> > 	fl.l_len = 0;
> > 	alarm(5);		/* or however many seconds you want to wait */
> > 	if (fcntl(fd, F_SETLKW, &fl) == -1) {
> >        		if (errno == EINTR) /* timed out */
> >        	 	else /* other error */
> > 	}
> 	alarm(0)
> 
> --
> dm-devel mailing list
> dm-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/dm-devel




More information about the dm-devel mailing list