Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Aug 2016 07:17:16 +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-10@freebsd.org
Subject:   svn commit: r304266 - stable/10/sys/fs/tmpfs
Message-ID:  <201608170717.u7H7HGUs003923@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Wed Aug 17 07:17:16 2016
New Revision: 304266
URL: https://svnweb.freebsd.org/changeset/base/304266

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

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

Modified: stable/10/sys/fs/tmpfs/tmpfs_subr.c
==============================================================================
--- stable/10/sys/fs/tmpfs/tmpfs_subr.c	Wed Aug 17 07:15:50 2016	(r304265)
+++ stable/10/sys/fs/tmpfs/tmpfs_subr.c	Wed Aug 17 07:17:16 2016	(r304266)
@@ -818,10 +818,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?201608170717.u7H7HGUs003923>