[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

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



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 redhat com
> https://www.redhat.com/mailman/listinfo/dm-devel


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]