filedesc: make sure to force table reload in fget_unlocked when count == 0

This is a fixup to r273843.
This commit is contained in:
Mateusz Guzik 2014-10-30 07:21:38 +00:00
parent de9dd94772
commit f55cf4b0d1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=273845

View File

@ -2362,7 +2362,12 @@ fget_unlocked(struct filedesc *fdp, int fd, cap_rights_t *needrightsp,
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;
}
/*