From owner-svn-src-head@FreeBSD.ORG Thu Feb 7 14:53:34 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DB8B9BFB; Thu, 7 Feb 2013 14:53:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CDEA038D; Thu, 7 Feb 2013 14:53:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r17ErYEP090421; Thu, 7 Feb 2013 14:53:34 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r17ErYK4090418; Thu, 7 Feb 2013 14:53:34 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201302071453.r17ErYK4090418@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 7 Feb 2013 14:53:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246472 - in head/sys: fs/devfs kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 14:53:34 -0000 Author: kib Date: Thu Feb 7 14:53:33 2013 New Revision: 246472 URL: http://svnweb.freebsd.org/changeset/base/246472 Log: Stop translating the ERESTART error from the open(2) into EINTR. Posix requires that open(2) is restartable for SA_RESTART. For non-posix objects, in particular, devfs nodes, still disable automatic restart of the opens. The open call to a driver could have significant side effects for the hardware. Noted and reviewed by: jilles Discussed with: bde MFC after: 2 weeks Modified: head/sys/fs/devfs/devfs_vnops.c head/sys/kern/vfs_syscalls.c Modified: head/sys/fs/devfs/devfs_vnops.c ============================================================================== --- head/sys/fs/devfs/devfs_vnops.c Thu Feb 7 14:49:55 2013 (r246471) +++ head/sys/fs/devfs/devfs_vnops.c Thu Feb 7 14:53:33 2013 (r246472) @@ -1089,8 +1089,11 @@ devfs_open(struct vop_open_args *ap) vn_lock(vp, vlocked | LK_RETRY); dev_relthread(dev, ref); - if (error) + if (error != 0) { + if (error == ERESTART) + error = EINTR; return (error); + } #if 0 /* /dev/console */ KASSERT(fp != NULL, ("Could not vnode bypass device on NULL fp")); Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Thu Feb 7 14:49:55 2013 (r246471) +++ head/sys/kern/vfs_syscalls.c Thu Feb 7 14:53:33 2013 (r246472) @@ -1106,8 +1106,6 @@ kern_openat(struct thread *td, int fd, c goto success; } - if (error == ERESTART) - error = EINTR; goto bad; } td->td_dupfd = 0;