From owner-freebsd-arch@FreeBSD.ORG Fri Sep 2 10:37:57 2005 Return-Path: X-Original-To: freebsd-arch@freebsd.org Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7601416A41F for ; Fri, 2 Sep 2005 10:37:57 +0000 (GMT) (envelope-from phk@phk.freebsd.dk) Received: from haven.freebsd.dk (haven.freebsd.dk [130.225.244.222]) by mx1.FreeBSD.org (Postfix) with ESMTP id 20C5543D45 for ; Fri, 2 Sep 2005 10:37:57 +0000 (GMT) (envelope-from phk@phk.freebsd.dk) Received: from phk.freebsd.dk (unknown [192.168.48.2]) by haven.freebsd.dk (Postfix) with ESMTP id 97C7DBC66; Fri, 2 Sep 2005 10:37:55 +0000 (UTC) To: Dmitry Pryanishnikov From: "Poul-Henning Kamp" In-Reply-To: Your message of "Thu, 01 Sep 2005 11:56:06 +0300." <20050901113819.F95708@atlantis.atlantis.dp.ua> Date: Fri, 02 Sep 2005 12:37:54 +0200 Message-ID: <35184.1125657474@phk.freebsd.dk> Sender: phk@phk.freebsd.dk Cc: freebsd-arch@freebsd.org Subject: Re: kern/85503: panic: wrong dirclust using msdosfs in RELENG_6 X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Sep 2005 10:37:57 -0000 In message <20050901113819.F95708@atlantis.atlantis.dp.ua>, Dmitry Pryanishniko v writes: > >Hello! > > During the hunting the bug kern/85503 (panic: wrong dirclust in msdosfs) >I've tried to think about the solution, but it seems to be >architecture-related. The problem is: msdosfs uses pseudo-inodes (that is, >the offset from the start of the partition to the start of directory entry >in bytes) which must therefore have off_t bitness (at least 64 bits). I've >found the primary error (lack of casts leaded to 32-bit result), but then >we should transfer this 64-bit "inode" number to vfs_hash_get(). Oops, >it also limited to u_int (32 bits on i386). Finally, I see that the >primary shortcoming here: in sys/vnode.h we have NFS has the same sort of problem, it has 16 or 32 *bytes* filehandles that need to hash to 32 bit "inode numbers". If you look at vfs_hash_get calls in sys/nfsclient you can see that it calculates a 32bit hash but then provides a "nfs_vncmpf" function to do the actual comparison to resolve hash collisions. You need to do the same thing. Making the hashes be 64bit is pointless since no filesystems will have that many inodes and it still doesn't solve the problem properly. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.