summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMateusz Guzik <mjg@FreeBSD.org>2020-12-16 18:01:41 +0000
committerMateusz Guzik <mjg@FreeBSD.org>2020-12-16 18:01:41 +0000
commit08241fedc4fa2fe35ee068cdcab6a021c275ecbb (patch)
tree90ed3dd882dc634ada7de8b9e93d5d63b6b1d994
parent7bd0c4c47d83d3e58aa8076227f282514dbc4a6a (diff)
downloadsrc-test2-08241fedc4fa2fe35ee068cdcab6a021c275ecbb.tar.gz
src-test2-08241fedc4fa2fe35ee068cdcab6a021c275ecbb.zip
fd: remove redundant saturation check from fget_unlocked_seq
refcount_acquire_if_not_zero returns true on saturation. The case of 0 is handled by looping again, after which the originally found pointer will no longer be there. Noted by: kib
Notes
Notes: svn path=/head/; revision=368703
-rw-r--r--sys/kern/kern_descrip.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c
index dbcf6d316a2f..aea37d3dfc75 100644
--- a/sys/kern/kern_descrip.c
+++ b/sys/kern/kern_descrip.c
@@ -3022,13 +3022,6 @@ fget_unlocked_seq(struct filedesc *fdp, int fd, cap_rights_t *needrightsp,
#endif
if (__predict_false(!refcount_acquire_if_not_zero(&fp->f_count))) {
/*
- * The count was found either saturated or zero.
- * This re-read is not any more racy than using the
- * return value from fcmpset.
- */
- if (refcount_load(&fp->f_count) != 0)
- return (EBADF);
- /*
* Force a reload. Other thread could reallocate the
* table before this fd was closed, so it is possible
* that there is a stale fp pointer in cached version.