From owner-svn-src-all@FreeBSD.ORG Wed Oct 15 13:08:54 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0BDD3134; Wed, 15 Oct 2014 13:08:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 EBF8C405; Wed, 15 Oct 2014 13:08:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9FD8rct032850; Wed, 15 Oct 2014 13:08:53 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9FD8rY4032849; Wed, 15 Oct 2014 13:08:53 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201410151308.s9FD8rY4032849@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 15 Oct 2014 13:08:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273130 - head/sys/fs/deadfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Oct 2014 13:08:54 -0000 Author: kib Date: Wed Oct 15 13:08:53 2014 New Revision: 273130 URL: https://svnweb.freebsd.org/changeset/base/273130 Log: Change the deadfs poll VOP to return POLLIN|POLLRDNORM if the caller is interested in i/o state. Return POLLNVAL for invalid bits, similar to poll_no_poll(). Note that POLLOUT must not be returned, since POLLHUP is set. Noted and reviewed by: bde Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/fs/deadfs/dead_vnops.c Modified: head/sys/fs/deadfs/dead_vnops.c ============================================================================== --- head/sys/fs/deadfs/dead_vnops.c Wed Oct 15 12:38:26 2014 (r273129) +++ head/sys/fs/deadfs/dead_vnops.c Wed Oct 15 13:08:53 2014 (r273130) @@ -163,16 +163,19 @@ dead_write(ap) return (EIO); } -/* - * Trivial poll routine that always returns POLLHUP. - * This is necessary so that a process which is polling a file - * gets notified when that file is revoke()d. - */ static int dead_poll(ap) struct vop_poll_args *ap; { - return (POLLHUP); + + if (ap->a_events & ~POLLSTANDARD) + return (POLLNVAL); + + /* + * Let the user find out that the descriptor is gone. + */ + return (POLLHUP | ((POLLIN | POLLRDNORM) & ap->a_events)); + } static int