Module Name:    src
Committed By:   christos
Date:           Sun Jan 28 15:48:44 UTC 2018

Modified Files:
        src/sys/fs/union: union_subr.c

Log Message:
CID-1428639: make sure we always initialiaze hash, because if ultimately
the file is not found and we end up looping we need them.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/sys/fs/union/union_subr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/fs/union/union_subr.c
diff -u src/sys/fs/union/union_subr.c:1.76 src/sys/fs/union/union_subr.c:1.77
--- src/sys/fs/union/union_subr.c:1.76	Mon Jul 17 05:22:36 2017
+++ src/sys/fs/union/union_subr.c	Sun Jan 28 10:48:44 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: union_subr.c,v 1.76 2017/07/17 09:22:36 hannken Exp $	*/
+/*	$NetBSD: union_subr.c,v 1.77 2018/01/28 15:48:44 christos Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -72,7 +72,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: union_subr.c,v 1.76 2017/07/17 09:22:36 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: union_subr.c,v 1.77 2018/01/28 15:48:44 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -377,11 +377,6 @@ union_allocvp(
 		lowervp = NULLVP;
 	}
 
-	if (!docache) {
-		un = NULL;
-		goto found;
-	}
-
 	/*
 	 * If both uppervp and lowervp are not NULL we have to
 	 * search union nodes with one vnode as NULL too.
@@ -394,6 +389,11 @@ union_allocvp(
 		hash[2] = UNION_HASH(NULLVP, lowervp);
 	}
 
+	if (!docache) {
+		un = NULL;
+		goto found;
+	}
+
 loop:
 	mutex_enter(&uhash_lock);
 

Reply via email to