Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Aug 2016 07:15:51 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r304265 - stable/11/sys/fs/tmpfs
Message-ID:  <201608170715.u7H7FpO4003819@repo.freebsd.org>

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



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