Subject: Bug(s) in genfs?
To: None <tech-kern@netbsd.org>
From: Reinoud Zandijk <reinoud@netbsd.org>
List: tech-kern
Date: 12/30/2005 03:29:33
--H+4ONPRPur6+Ovig
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Dear folks,
i've found the following in sys/misc/genfs/genfs_vnops.c:546
(genfs_getpages)
if (vp->v_type == VREG) {
fs_bshift = vp->v_mount->mnt_fs_bshift;
dev_bshift = vp->v_mount->mnt_dev_bshift;
} else {
fs_bshift = DEV_BSHIFT;
dev_bshift = DEV_BSHIFT;
}
at line 1356 (genfs_gop_write) :
if (vp->v_type == VREG) {
fs_bshift = vp->v_mount->mnt_fs_bshift;
dev_bshift = vp->v_mount->mnt_dev_bshift;
} else {
fs_bshift = DEV_BSHIFT;
dev_bshift = DEV_BSHIFT;
}
Isn't this plain wrong and an FFS-ism to assume that all but a VREG is a
DEV_BSHIFT length? Shouldn't those if's just be deleted? together with the
KASSERTS that demand it to be a VREG or VBLK ?
With regards,
Reinoud
--H+4ONPRPur6+Ovig
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (NetBSD)
iQEVAwUBQ7SbgIKcNwBDyKpoAQLyvQgAkS6Lm6rWz7wZ64NkRF2ZZHgPXp+q6eM+
xpkx/dwdC+mqtAaXAJGa9SyDcHROnwhvRKd3b8gH5Kat3s1PjD77FxMGairX+NMC
x+nbJ6XfEvz8yf+cQcigKabrR9VS165pESFrsdCuOLHJga4PJo3GlmPKy2x9/maT
PQvfM5bKtLNitxuNF0bDyVA8ha3o9e8ZMLXURwWBBoMf991qfR8jk7ZgNqZTs8rR
gtlFvTFGPGv+2XCYa+rbKvV3CExqYnNgfzDJmQtRUSoyBGVMc70fR/0qrnugSd+0
ya1FnYDy5ByuEiZHaKkXE/vCFHGuHW6TzYEuceyedXeiZtlbmnEamA==
=VT8v
-----END PGP SIGNATURE-----
--H+4ONPRPur6+Ovig--