1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-14 10:09:48 +00:00

Use the actual sector size of the media instead of hard-coding it to 2048.

This eliminates KASSERTs in GEOM if we accidentally mount an audio CD
as a cd9660 filesystem.
This commit is contained in:
Craig Rodrigues 2005-10-17 03:27:35 +00:00
parent 073833a420
commit b137e1c8ba
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=151406
2 changed files with 24 additions and 6 deletions

View File

@ -247,9 +247,18 @@ iso_mountfs(devvp, mp, td)
/* This is the "logical sector size". The standard says this
* should be 2048 or the physical sector size on the device,
* whichever is greater. For now, we'll just use a constant.
* whichever is greater.
*/
iso_bsize = ISO_DEFAULT_BLOCK_SIZE;
if ((ISO_DEFAULT_BLOCK_SIZE % cp->provider->sectorsize) != 0) {
DROP_GIANT();
g_topology_lock();
g_vfs_close(cp, td);
g_topology_unlock();
PICKUP_GIANT();
return (EINVAL);
}
iso_bsize = cp->provider->sectorsize;
joliet_level = 0;
if (1 != vfs_scanopt(mp->mnt_optnew, "ssector", "%d", &ssector))
@ -257,7 +266,7 @@ iso_mountfs(devvp, mp, td)
for (iso_blknum = 16 + ssector;
iso_blknum < 100 + ssector;
iso_blknum++) {
if ((error = bread(devvp, iso_blknum * btodb(iso_bsize),
if ((error = bread(devvp, iso_blknum * btodb(ISO_DEFAULT_BLOCK_SIZE),
iso_bsize, NOCRED, &bp)) != 0)
goto out;

View File

@ -247,9 +247,18 @@ iso_mountfs(devvp, mp, td)
/* This is the "logical sector size". The standard says this
* should be 2048 or the physical sector size on the device,
* whichever is greater. For now, we'll just use a constant.
* whichever is greater.
*/
iso_bsize = ISO_DEFAULT_BLOCK_SIZE;
if ((ISO_DEFAULT_BLOCK_SIZE % cp->provider->sectorsize) != 0) {
DROP_GIANT();
g_topology_lock();
g_vfs_close(cp, td);
g_topology_unlock();
PICKUP_GIANT();
return (EINVAL);
}
iso_bsize = cp->provider->sectorsize;
joliet_level = 0;
if (1 != vfs_scanopt(mp->mnt_optnew, "ssector", "%d", &ssector))
@ -257,7 +266,7 @@ iso_mountfs(devvp, mp, td)
for (iso_blknum = 16 + ssector;
iso_blknum < 100 + ssector;
iso_blknum++) {
if ((error = bread(devvp, iso_blknum * btodb(iso_bsize),
if ((error = bread(devvp, iso_blknum * btodb(ISO_DEFAULT_BLOCK_SIZE),
iso_bsize, NOCRED, &bp)) != 0)
goto out;