diff options
author | des <des@FreeBSD.org> | 2005-02-08 12:34:11 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2005-02-08 12:34:11 +0000 |
commit | 80eee84ab50470b0d3b454cd420c5fe8a2b70dd5 (patch) | |
tree | 4a974592569b1cb914ccae09109f35d4c2f15a5a /sys | |
parent | 34796900fc16517003b228e5ca4f3a86884df937 (diff) | |
download | FreeBSD-src-80eee84ab50470b0d3b454cd420c5fe8a2b70dd5.zip FreeBSD-src-80eee84ab50470b0d3b454cd420c5fe8a2b70dd5.tar.gz |
merge from geom_vol_ffs.c rev 1.14 (avoid unaligned I/O requests)
Diffstat (limited to 'sys')
-rw-r--r-- | sys/geom/label/g_label_ufs.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/geom/label/g_label_ufs.c b/sys/geom/label/g_label_ufs.c index dc188f7..d15cbec 100644 --- a/sys/geom/label/g_label_ufs.c +++ b/sys/geom/label/g_label_ufs.c @@ -60,6 +60,16 @@ g_label_ufs_taste(struct g_consumer *cp, char *label, size_t size) * provider based on that. */ for (sb = 0; (superblock = superblocks[sb]) != -1; sb++) { + /* + * Take care not to issue an invalid I/O request. The + * offset and size of the superblock candidate must be + * multiples of the provider's sector size, otherwise an + * FFS can't exist on the provider anyway. + */ + if (superblock % cp->provider->sectorsize != 0 || + SBLOCKSIZE % cp->provider->sectorsize != 0) + continue; + fs = (struct fs *)g_read_data(cp, superblock, SBLOCKSIZE, &error); if (fs == NULL || error != 0) |