From owner-freebsd-fs@FreeBSD.ORG Sat Feb 17 05:56:40 2007 Return-Path: X-Original-To: freebsd-fs@freebsd.org Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4B3E916A406 for ; Sat, 17 Feb 2007 05:56:40 +0000 (UTC) (envelope-from anderson@freebsd.org) Received: from mh1.centtech.com (moat3.centtech.com [64.129.166.50]) by mx1.freebsd.org (Postfix) with ESMTP id 25DD113C4A8 for ; Sat, 17 Feb 2007 05:56:40 +0000 (UTC) (envelope-from anderson@freebsd.org) Received: from [192.168.42.21] (andersonbox1.centtech.com [192.168.42.21]) by mh1.centtech.com (8.13.8/8.13.8) with ESMTP id l1H5ucnQ090945 for ; Fri, 16 Feb 2007 23:56:39 -0600 (CST) (envelope-from anderson@freebsd.org) Message-ID: <45D69918.3000008@freebsd.org> Date: Fri, 16 Feb 2007 23:56:40 -0600 From: Eric Anderson User-Agent: Thunderbird 1.5.0.9 (X11/20070204) MIME-Version: 1.0 To: "freebsd-fs@freebsd.org" Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.88.4/2586/Fri Feb 16 21:52:45 2007 on mh1.centtech.com X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=8.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.6 X-Spam-Checker-Version: SpamAssassin 3.1.6 (2006-10-03) on mh1.centtech.com Subject: question about vfs_lookup X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2007 05:56:40 -0000 I'm just curious about how this block (starting at line 712) could possibly ever get executed, since right before it there is a condition that would cause a panic. Can anyone explain this please? In sys/kern/vfs_lookup.c: 710 KASSERT((cnp->cn_flags & ISLASTCN) || *ndp->ni_next == '/', 711 ("lookup: invalid path state.")); 712 if (*ndp->ni_next == '/') { 713 cnp->cn_nameptr = ndp->ni_next; 714 while (*cnp->cn_nameptr == '/') { 715 cnp->cn_nameptr++; 716 ndp->ni_pathlen--; 717 } 718 if (ndp->ni_dvp != dp) 719 vput(ndp->ni_dvp); 720 else 721 vrele(ndp->ni_dvp); 722 VFS_UNLOCK_GIANT(dvfslocked); 723 dvfslocked = vfslocked; /* dp becomes dvp in dirloop */ 724 vfslocked = 0; 725 goto dirloop; 726 } Thanks! Eric