Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Feb 2020 09:37:17 +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: r357405 - head/sys/kern
Message-ID:  <202002020937.0129bH9E023017@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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))



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202002020937.0129bH9E023017>