diff options
author | bde <bde@FreeBSD.org> | 2001-04-30 14:35:35 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 2001-04-30 14:35:35 +0000 |
commit | e7467b0a7b35cfe8f2958d4ac21f19a4ea30f939 (patch) | |
tree | cf3462b029c306f0a42d9687f57a3ef1561b7e03 /sys/miscfs/specfs | |
parent | 7969a0de506d9f054cbb638ff6afc4166ae0dc00 (diff) | |
download | FreeBSD-src-e7467b0a7b35cfe8f2958d4ac21f19a4ea30f939.zip FreeBSD-src-e7467b0a7b35cfe8f2958d4ac21f19a4ea30f939.tar.gz |
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().
ntfs seems to have the same bug.
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.
There may also be a problem with a_vp->v_mount being null. spec_bmap()
still checks for this, but I think the checks in specfs are dead code
which used to support block devices.
Diffstat (limited to 'sys/miscfs/specfs')
-rw-r--r-- | sys/miscfs/specfs/spec_vnops.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/miscfs/specfs/spec_vnops.c b/sys/miscfs/specfs/spec_vnops.c index 95922c8..2940f40 100644 --- a/sys/miscfs/specfs/spec_vnops.c +++ b/sys/miscfs/specfs/spec_vnops.c @@ -73,6 +73,7 @@ static struct vnodeopv_entry_desc spec_vnodeop_entries[] = { { &vop_default_desc, (vop_t *) vop_defaultop }, { &vop_access_desc, (vop_t *) vop_ebadf }, { &vop_advlock_desc, (vop_t *) spec_advlock }, + { &vop_bmap_desc, (vop_t *) spec_bmap }, { &vop_close_desc, (vop_t *) spec_close }, { &vop_create_desc, (vop_t *) vop_panic }, { &vop_freeblks_desc, (vop_t *) spec_freeblks }, |