Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 Nov 2008 12:40:14 +0000 (UTC)
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r185431 - head/sys/kern
Message-ID:  <200811291240.mATCeEd3051276@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pjd
Date: Sat Nov 29 12:40:14 2008
New Revision: 185431
URL: http://svn.freebsd.org/changeset/base/185431

Log:
  Improve KASSERT() call a bit:
  - Print flags in hex.
  - Note that flags can be fine and panic can be due unexpected error condition.
  - Remove redundant new line character.
  
  Eventhough panic message excess 80 characters keep it in one line so it is
  easier to grep.

Modified:
  head/sys/kern/vfs_vnops.c

Modified: head/sys/kern/vfs_vnops.c
==============================================================================
--- head/sys/kern/vfs_vnops.c	Sat Nov 29 12:32:42 2008	(r185430)
+++ head/sys/kern/vfs_vnops.c	Sat Nov 29 12:40:14 2008	(r185431)
@@ -881,7 +881,8 @@ _vn_lock(struct vnode *vp, int flags, ch
 		error = VOP_LOCK1(vp, flags, file, line);
 		flags &= ~LK_INTERLOCK;	/* Interlock is always dropped. */
 		KASSERT((flags & LK_RETRY) == 0 || error == 0,
-		    ("LK_RETRY set with incompatible flags %d\n", flags));
+		    ("LK_RETRY set with incompatible flags (0x%x) or an error occured (%d)",
+		    flags, error));
 		/*
 		 * Callers specify LK_RETRY if they wish to get dead vnodes.
 		 * If RETRY is not set, we return ENOENT instead.



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