From owner-freebsd-bugs@freebsd.org Sun Sep 13 23:48:32 2015 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 150BEA03C34 for ; Sun, 13 Sep 2015 23:48:32 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EECD71B1B for ; Sun, 13 Sep 2015 23:48:31 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id t8DNmVPd096249 for ; Sun, 13 Sep 2015 23:48:31 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 202933] unwanted behaviour change when writing to revoked terminals Date: Sun, 13 Sep 2015 23:48:32 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 10.2-RELEASE X-Bugzilla-Keywords: regression X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: fbsd.bugzilla@fenyo.net X-Bugzilla-Status: New X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2015 23:48:32 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=202933 --- Comment #1 from Alexandre Fenyo --- Hi, I've found the kernel sources change that has modified this behaviour: this is relative to base revision 273131 - https://svnweb.freebsd.org/base?view=revision&revision=273131 This revision modifies /usr/src/sys/fs/devfs/devfs_vnops.c:devfs_write_f(): ------------------------------------------------------------------- error = devfs_fp_check(fp, &dev, &dsw, &ref); if (error != 0) return (error); ------------------------------------------------------------------- is replaced by: ------------------------------------------------------------------- error = devfs_fp_check(fp, &dev, &dsw, &ref); if (error != 0) { error = vnops.fo_write(fp, uio, cred, flags, td); return (error); } ------------------------------------------------------------------- When a terminal is revoked, devfs_fp_check() returns ENXIO (6). This is for instance the value used by rsyslog8 to handle this case correctly. But with this modification, the kernel now returns EIO (5), that is the generic error value returned by vnops.fo_write(), since fo_write() does not handle specifically revoked terminals. This behaviour change seems to be wanted, reading the svn log message: > read/write/poll/ioctl, call standard vnode filedescriptor fop. This > restores the special handling for terminals by calling the deadfs VOP, > instead of always returning ENXIO for destroyed devices or revoked > terminals. > > Since destroyed (and not revoked) device would use devfs_specops VOP > vector, make dead_read/write/poll non-static and fill VOP table with > pointers to the functions, to instead of VOP_PANIC. But some ports, at least, are waiting for ENXIO to reopen a device that has been revoked, and they no longer work correctly because this kernel behaviour changed (for instance, rsyslog8 now loops endlessly at end of boot sequence, when /dev/console is revoked by getty). So, this seems to be an ABI change between FreeBSD 10.1 and 10.2, but I wonder if ABI changes should really occur in the same major branch (10-Release branch). I wonder if a special handling for revoked terminals, in devfs_write_f(), should be made to continue to return ENXIO for revoked terminals, in 10-Release branch at least. What do you think of this proposal ? Sincerely, -- You are receiving this mail because: You are the assignee for the bug.