Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Feb 2008 14:33:20 +0200
From:      Andriy Gapon <avg@icyb.net.ua>
To:        Poul-Henning Kamp <phk@phk.freebsd.dk>
Cc:        freebsd-fs@FreeBSD.org, freebsd-hackers@FreeBSD.org, Pav Lucistnik <pav@FreeBSD.org>, Bruce Evans <bde@zeta.org.au>
Subject:   Re: fs/udf: vm pages "overlap" while reading large dir
Message-ID:  <47B19210.3010508@icyb.net.ua>
In-Reply-To: <4299.1202816854@critter.freebsd.dk>
References:  <4299.1202816854@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
on 12/02/2008 13:47 Poul-Henning Kamp said the following:
> 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"));
> 
> 

Thank you for this very insightful and neat suggestion!
I think that it must work but I will try test it tonight on whatever
media and FS-s I have available.
Thank you again!

P.S. hope to not get '"suitable diagnostic"' from something like msdosfs :-)

-- 
Andriy Gapon



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