filedesc: make sure to force table reload in fget_unlocked when count == 0
This is a fixup to r273843.
This commit is contained in:
parent
de9dd94772
commit
f55cf4b0d1
@ -2362,7 +2362,12 @@ fget_unlocked(struct filedesc *fdp, int fd, cap_rights_t *needrightsp,
|
|||||||
retry:
|
retry:
|
||||||
count = fp->f_count;
|
count = fp->f_count;
|
||||||
if (count == 0) {
|
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;
|
continue;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user