svn commit: r357405 - head/sys/kern

Mateusz Guzik mjg at FreeBSD.org
Sun Feb 2 09:37:17 UTC 2020


Author: mjg
Date: Sun Feb  2 09:37:16 2020
New Revision: 357405
URL: https://svnweb.freebsd.org/changeset/base/357405

Log:
  fd: use atomic_load_ptr instead of hand-rolled cast through volatile
  
  No change in assembly.

Modified:
  head/sys/kern/kern_descrip.c

Modified: head/sys/kern/kern_descrip.c
==============================================================================
--- head/sys/kern/kern_descrip.c	Sun Feb  2 09:36:32 2020	(r357404)
+++ head/sys/kern/kern_descrip.c	Sun Feb  2 09:37:16 2020	(r357405)
@@ -2737,8 +2737,7 @@ fget_unlocked(struct filedesc *fdp, int fd, cap_rights
 			 * table before this fd was closed, so it possible that
 			 * there is a stale fp pointer in cached version.
 			 */
-			fdt = *(const struct fdescenttbl * const volatile *)
-			    &(fdp->fd_files);
+			fdt = (struct fdescenttbl *)atomic_load_ptr(&fdp->fd_files);
 			continue;
 		}
 		if (__predict_false(count + 1 < count))


More information about the svn-src-all mailing list