From owner-svn-src-all@FreeBSD.ORG Thu Oct 30 07:21:39 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 40F818CA; Thu, 30 Oct 2014 07:21:39 +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 2E895F1B; Thu, 30 Oct 2014 07:21:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9U7LdWL051393; Thu, 30 Oct 2014 07:21:39 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9U7Ld6Z051392; Thu, 30 Oct 2014 07:21:39 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201410300721.s9U7Ld6Z051392@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 30 Oct 2014 07:21:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273845 - head/sys/kern 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: Thu, 30 Oct 2014 07:21:39 -0000 Author: mjg Date: Thu Oct 30 07:21:38 2014 New Revision: 273845 URL: https://svnweb.freebsd.org/changeset/base/273845 Log: filedesc: make sure to force table reload in fget_unlocked when count == 0 This is a fixup to r273843. Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Thu Oct 30 06:54:25 2014 (r273844) +++ head/sys/kern/kern_descrip.c Thu Oct 30 07:21:38 2014 (r273845) @@ -2362,7 +2362,12 @@ fget_unlocked(struct filedesc *fdp, int retry: count = fp->f_count; if (count == 0) { - fdt = fdp->fd_files; + /* + * Force a reload. Other thread could reallocate the + * table before this fd was closed, so it possible that + * there is a stale fp pointer in cached version. + */ + fdt = *(struct fdescenttbl * volatile *)&(fdp->fd_files); continue; } /*