Date: Thu, 30 Oct 2014 07:21:39 +0000 (UTC) From: Mateusz Guzik <mjg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273845 - head/sys/kern Message-ID: <201410300721.s9U7Ld6Z051392@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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; } /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201410300721.s9U7Ld6Z051392>