summaryrefslogtreecommitdiffstats
path: root/sys/fs
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2016-08-17 07:17:16 +0000
committerkib <kib@FreeBSD.org>2016-08-17 07:17:16 +0000
commitfbc0cd19ec698697b97b26be85fdf1b2a33969a7 (patch)
treee27058286f4ceece3d0c8e1e023cb394ba3839d7 /sys/fs
parenteed810eb5c6c73ef68a8529d7b2df045caebcceb (diff)
downloadFreeBSD-src-fbc0cd19ec698697b97b26be85fdf1b2a33969a7.zip
FreeBSD-src-fbc0cd19ec698697b97b26be85fdf1b2a33969a7.tar.gz
MFC r303916:
Convert another tmpfs assert into runtime check.
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/tmpfs/tmpfs_subr.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c
index f06958e..9781b2c 100644
--- a/sys/fs/tmpfs/tmpfs_subr.c
+++ b/sys/fs/tmpfs/tmpfs_subr.c
@@ -818,10 +818,13 @@ tmpfs_dir_lookup_cookie(struct tmpfs_node *node, off_t cookie,
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)) {
OpenPOWER on IntegriCloud