From owner-freebsd-emulation@FreeBSD.ORG Wed Nov 8 07:03:03 2006 Return-Path: X-Original-To: freebsd-emulation@FreeBSD.org Delivered-To: freebsd-emulation@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 58C0B16A403; Wed, 8 Nov 2006 07:03:03 +0000 (UTC) (envelope-from xdivac02@stud.fit.vutbr.cz) Received: from eva.fit.vutbr.cz (eva.fit.vutbr.cz [147.229.176.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id A18D943D4C; Wed, 8 Nov 2006 07:03:01 +0000 (GMT) (envelope-from xdivac02@stud.fit.vutbr.cz) Received: from eva.fit.vutbr.cz (localhost [127.0.0.1]) by eva.fit.vutbr.cz (envelope-from xdivac02@eva.fit.vutbr.cz) (8.13.8/8.13.7) with ESMTP id kA872w14061786 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 8 Nov 2006 08:02:59 +0100 (CET) Received: (from xdivac02@localhost) by eva.fit.vutbr.cz (8.13.8/8.13.3/Submit) id kA872wqS061783; Wed, 8 Nov 2006 08:02:58 +0100 (CET) Date: Wed, 8 Nov 2006 08:02:58 +0100 From: Divacky Roman To: Jung-uk Kim Message-ID: <20061108070258.GA61393@stud.fit.vutbr.cz> References: <20061106174033.GA70360@stud.fit.vutbr.cz> <200611071201.11899.jkim@FreeBSD.org> <20061107171904.GA50772@stud.fit.vutbr.cz> <200611071237.11856.jkim@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200611071237.11856.jkim@FreeBSD.org> User-Agent: Mutt/1.4.2.2i X-Scanned-By: MIMEDefang 2.57 on 147.229.176.14 Cc: freebsd-emulation@FreeBSD.org Subject: Re: [PATCH]: possible fix for the fifoor problem X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2006 07:03:03 -0000 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