Date: Thu, 7 Feb 2013 14:53:34 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> 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 Message-ID: <201302071453.r17ErYK4090418@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201302071453.r17ErYK4090418>