svn commit: r304265 - stable/11/sys/fs/tmpfs

Konstantin Belousov kib at FreeBSD.org
Wed Aug 17 07:15:52 UTC 2016


Author: kib
Date: Wed Aug 17 07:15:50 2016
New Revision: 304265
URL: https://svnweb.freebsd.org/changeset/base/304265

Log:
  MFC r303916:
  Convert another tmpfs assert into runtime check.

Modified:
  stable/11/sys/fs/tmpfs/tmpfs_subr.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/fs/tmpfs/tmpfs_subr.c
==============================================================================
--- stable/11/sys/fs/tmpfs/tmpfs_subr.c	Wed Aug 17 07:13:25 2016	(r304264)
+++ stable/11/sys/fs/tmpfs/tmpfs_subr.c	Wed Aug 17 07:15:50 2016	(r304265)
@@ -819,10 +819,13 @@ tmpfs_dir_lookup_cookie(struct tmpfs_nod
 		goto out;
 	}
 
-	MPASS((cookie & TMPFS_DIRCOOKIE_MASK) == cookie);
-	dekey.td_hash = cookie;
-	/* Recover if direntry for cookie was removed */
-	de = RB_NFIND(tmpfs_dir, dirhead, &dekey);
+	if ((cookie & TMPFS_DIRCOOKIE_MASK) != cookie) {
+		de = NULL;
+	} else {
+		dekey.td_hash = cookie;
+		/* Recover if direntry for cookie was removed */
+		de = RB_NFIND(tmpfs_dir, dirhead, &dekey);
+	}
 	dc->tdc_tree = de;
 	dc->tdc_current = de;
 	if (de != NULL && tmpfs_dirent_duphead(de)) {


More information about the svn-src-all mailing list