From owner-freebsd-hackers Mon Dec 8 00:10:24 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id AAA14777 for hackers-outgoing; Mon, 8 Dec 1997 00:10:24 -0800 (PST) (envelope-from owner-freebsd-hackers) Received: from alpo.whistle.com (alpo.whistle.com [207.76.204.38]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id AAA14758 for ; Mon, 8 Dec 1997 00:10:15 -0800 (PST) (envelope-from julian@whistle.com) Received: (from daemon@localhost) by alpo.whistle.com (8.8.5/8.8.5) id AAA04242; Mon, 8 Dec 1997 00:03:12 -0800 (PST) Received: from UNKNOWN(), claiming to be "current1.whistle.com" via SMTP by alpo.whistle.com, id smtpd004239; Mon Dec 8 00:03:03 1997 Date: Mon, 8 Dec 1997 00:00:36 -0800 (PST) From: Julian Elischer To: S?ren Schmidt cc: hackers@FreeBSD.ORG, mckusick@mckusick.com Subject: Re: [hackers:] Architectural advice needed In-Reply-To: <199712080724.IAA01786@sos.freebsd.dk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk On Mon, 8 Dec 1997, S?ren Schmidt wrote: > > Wrong, if a filesystem is mounted, it uses the mnt_stat.f_bsize instead. Exactly.. this is the 100% wrong thing to do. This represents the blocksize of the filesystem on which the /dev directory resides. This is completely independent of the blocksize of the device you are trying to write to. DEVFS has a blocksize of 1 byte, though I SAY 128 for no real reason. So therefore I started getting writes that were made to be multiples of 128. You think this is correct? I am talking about doing the right thing, which is somehow asking the device what it's blocksize is. My system here is working because I removed that code and said bsize = 512; which won't help with cdroms and other devices but at least get's me up and going.. I could have made DEVFS report it's blocksize as 512, but that would just bury the problem. I want to FIX it which is what this email was about.. > This is endeed an ugly hack (I put it there to accomodate devices with > != 512 byt sectors) Which it totally fails to do because everything thinks that they are 512 byte devices, because /dev is on a 512 byte filesystem device. >. Either we let it stay at all times at 512 bytes and > let the device driver chain cope with that, or we use the actual size > of the device throughout the system. #1 is not an option in the long run. I'm talking about #2 why is that wrong? > The whole thing boils down to the question of who deals with the actual > blocksize of the device. Either the entire system knows how to deal > with it (as it sortof is now), or it is handled in the device/slice > layer. I was newer able to favour one clearly above the other... the trouble is that you chose the wrong value to key off. If it were the correct value, the rest of the system would behave a LOT better. (and I know I've done similar things so this is really nothing more than a very MINOR pointy hat in your direction..) Just banging the number to 512 would have been more correct as at least it would have been OBVIOUSLY wrong rather than obscurely wrong. (hat awarded by BDE not me, he found it)