From owner-cvs-all Mon Apr 30 12: 6:40 2001 Delivered-To: cvs-all@freebsd.org Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by hub.freebsd.org (Postfix) with ESMTP id 4CD6037B422; Mon, 30 Apr 2001 12:06:33 -0700 (PDT) (envelope-from phk@critter.freebsd.dk) Received: from critter (localhost [127.0.0.1]) by critter.freebsd.dk (8.11.3/8.11.3) with ESMTP id f3UJ6FU53267; Mon, 30 Apr 2001 21:06:16 +0200 (CEST) (envelope-from phk@critter.freebsd.dk) To: Bruce Evans Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/miscfs/specfs spec_vnops.c In-Reply-To: Your message of "Mon, 30 Apr 2001 07:35:37 PDT." <200104301435.f3UEZbX08864@freefall.freebsd.org> Date: Mon, 30 Apr 2001 21:06:15 +0200 Message-ID: <53265.988657575@critter> From: Poul-Henning Kamp Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message <200104301435.f3UEZbX08864@freefall.freebsd.org>, Bruce Evans writes : >bde 2001/04/30 07:35:37 PDT > > Modified files: > sys/miscfs/specfs spec_vnops.c > Log: > Backed out previous commit. It cause massive filesystem corruption, > not to mention a compile-time warning about the critical function > becoming unused, by replacing spec_bmap() with vop_stdbmap(). > The factor for converting specfs block numbers to physical block > numbers is 1, but vop_stdbmap() uses the bogus factor > btodb(ap->a_vp->v_mount->mnt_stat.f_iosize), which is 16 for ffs with > the default block size of 8K. This factor is bogus even for vop_stdbmap() > -- the correct factor is related to the filesystem blocksize which is not > necessarily the same to the optimal i/o size. vop_stdbmap() was apparently > cloned from nfs where these sizes happen to be the same. While you may be semantically right btodb(ap->a_vp->v_mount->mnt_stat.f_iosize) had better be the right size, because other code relies on it: vnode_pager_addr() vnode_pager_haspage() inmem() just to mention some... I guess that the comment in sys/mount.h is the wrong thing... Or rather: the entire VOP_BMAP API is what's wrong... -- 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. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message