Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Nov 2006 08:02:58 +0100
From:      Divacky Roman <xdivac02@stud.fit.vutbr.cz>
To:        Jung-uk Kim <jkim@FreeBSD.org>
Cc:        freebsd-emulation@FreeBSD.org
Subject:   Re: [PATCH]: possible fix for the fifoor problem
Message-ID:  <20061108070258.GA61393@stud.fit.vutbr.cz>
In-Reply-To: <200611071237.11856.jkim@FreeBSD.org>
References:  <20061106174033.GA70360@stud.fit.vutbr.cz> <200611071201.11899.jkim@FreeBSD.org> <20061107171904.GA50772@stud.fit.vutbr.cz> <200611071237.11856.jkim@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Nov 07, 2006 at 12:37:07PM -0500, Jung-uk Kim wrote:
> On Tuesday 07 November 2006 12:19 pm, Divacky Roman wrote:
> > the patch is wrong.... this forces NONBLOCKing on all opened files
> > which is wrong.
> 
> Nope.  It does not force anything.
> 
> static void
> translate_path_major_minor(struct thread *td, char *path, struct stat *buf)
> {
> 	struct proc *p = td->td_proc;   
> 	struct filedesc *fdp = p->p_fd;
> 	struct file *fp;
> 	int fd;
> 	int temp;
> 
> 	temp = td->td_retval[0];
> 	if (kern_open(td, path, UIO_SYSSPACE, O_RDONLY, 0) != 0)
> 		return;
> 	fd = td->td_retval[0];
> 	td->td_retval[0] = temp;
> 	translate_fd_major_minor(td, fd, buf);
> 	FILEDESC_LOCK(fdp);
> 	fp = fdp->fd_ofiles[fd];
> 	FILEDESC_UNLOCK(fdp);
> 	fdclose(fdp, fdp->fd_ofiles[fd], fd, td);
> }
> 
> As you can see the function is only used internally to convert
> major/minor and fd is closed at the end of the function.
 
oh.. I overlooked that. then I think your patch might be correct.
bde knows obviously more about it. but I personally dont object
to the patch
 
> > according to a comment in linux source code linux never blocks for
> > O_RDWR which is what I tried to implement with my patch
> 
> We don't advertise it but we do the same, AFAIK. ;-)

I read the code and I think it does but I am no expert



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20061108070258.GA61393>