diff options
author | avg <avg@FreeBSD.org> | 2009-02-26 18:58:41 +0000 |
---|---|---|
committer | avg <avg@FreeBSD.org> | 2009-02-26 18:58:41 +0000 |
commit | 2b666c76d21981720da7ad4acb258421af23d85e (patch) | |
tree | 125c079d76bf54373b96a99842f4f442c44d9436 /sys/fs/udf/udf_vfsops.c | |
parent | dfd6f02e2ffd77ba010288c4ecd81941adcc4c65 (diff) | |
download | FreeBSD-src-2b666c76d21981720da7ad4acb258421af23d85e.zip FreeBSD-src-2b666c76d21981720da7ad4acb258421af23d85e.tar.gz |
udf_readatoffset: read through directory vnode, do not read > MAXBSIZE
Currently bread()-ing through device vnode with
(1) VMIO enabled,
(2) bo_bsize != DEV_BSIZE
(3) more than 1 block
results in data being incorrectly cached.
So instead a more common approach of using a vnode belonging to fs is now
employed.
Also, prevent attempt to bread more than MAXBSIZE bytes because of
adjustments made to account for offset that doesn't start on block
boundary.
Add expanded comments to explain the calculations.
Also drop unused inline function while here.
PR: kern/120967
PR: kern/129084
Reviewed by: scottl, kib
Approved by: jhb (mentor)
Diffstat (limited to 'sys/fs/udf/udf_vfsops.c')
-rw-r--r-- | sys/fs/udf/udf_vfsops.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/fs/udf/udf_vfsops.c b/sys/fs/udf/udf_vfsops.c index b1a55d8..98a2a13 100644 --- a/sys/fs/udf/udf_vfsops.c +++ b/sys/fs/udf/udf_vfsops.c @@ -476,7 +476,7 @@ udf_mountfs(struct vnode *devvp, struct mount *mp) */ sector = le32toh(udfmp->root_icb.loc.lb_num) + udfmp->part_start; size = le32toh(udfmp->root_icb.len); - if ((error = udf_readlblks(udfmp, sector, size, &bp)) != 0) { + if ((error = udf_readdevblks(udfmp, sector, size, &bp)) != 0) { printf("Cannot read sector %d\n", sector); goto bail; } @@ -794,7 +794,7 @@ udf_find_partmaps(struct udf_mnt *udfmp, struct logvol_desc *lvd) * XXX If reading the first Sparing Table fails, should look * for another table. */ - if ((error = udf_readlblks(udfmp, le32toh(pms->st_loc[0]), + if ((error = udf_readdevblks(udfmp, le32toh(pms->st_loc[0]), le32toh(pms->st_size), &bp)) != 0) { if (bp != NULL) brelse(bp); |