From owner-freebsd-hackers@FreeBSD.ORG Tue Feb 12 11:47:38 2008 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3C9916A417; Tue, 12 Feb 2008 11:47:38 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id 7004213C45B; Tue, 12 Feb 2008 11:47:38 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (unknown [192.168.61.3]) by phk.freebsd.dk (Postfix) with ESMTP id CA95717104; Tue, 12 Feb 2008 11:47:36 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.14.2/8.14.2) with ESMTP id m1CBlYLx004300; Tue, 12 Feb 2008 11:47:34 GMT (envelope-from phk@critter.freebsd.dk) To: Andriy Gapon From: "Poul-Henning Kamp" In-Reply-To: Your message of "Tue, 12 Feb 2008 13:24:34 +0200." <47B181F2.2070808@icyb.net.ua> Date: Tue, 12 Feb 2008 11:47:34 +0000 Message-ID: <4299.1202816854@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: freebsd-fs@FreeBSD.org, freebsd-hackers@FreeBSD.org, Pav Lucistnik , Bruce Evans Subject: Re: fs/udf: vm pages "overlap" while reading large dir X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Feb 2008 11:47:38 -0000 In message <47B181F2.2070808@icyb.net.ua>, Andriy Gapon writes: >2.3. this code passes to bread blkno that is calculated as 4*sector, >where sector is a number of a physical 2048-byte sector. [**] >[**] - I think that this is a requirement of buffcache system, because >internally it performs many calculations that seem to assume that block >size is always 512. Yes, the buf-cache works in 512 bytes units throughout. >3.1. for a fresh buf getlbk would assign the following: >bsize = bo->bo_bsize; >offset = blkno * bsize; That's clearly wrong. We need to assert that the blkno is aligned to the start of a sector and use the 512 byte units, so I guess it would be: offset = dbtob(blkno); KASSERT(!(offset & (bsize - 1)), ("suitable diagnostic")); -- 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.