mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-04 12:28:58 +00:00
Use the correct size for a sector in the search for a label in
readdisklabel(). Sectors may be larger than DEV_BSIZE.
This commit is contained in:
parent
0dd8d85b1c
commit
7e88aafca7
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=27377
@ -36,7 +36,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)ufs_disksubr.c 8.5 (Berkeley) 1/21/94
|
||||
* $Id$
|
||||
* $Id: ufs_disksubr.c,v 1.30 1997/02/22 09:47:45 peter Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -160,7 +160,7 @@ insert:
|
||||
* Attempt to read a disk label from a device using the indicated strategy
|
||||
* routine. The label must be partly set up before this: secpercyl, secsize
|
||||
* and anything required in the strategy routine (e.g., dummy bounds for the
|
||||
* partition containing the label) must be * filled in before calling us.
|
||||
* partition containing the label) must be filled in before calling us.
|
||||
* Returns NULL on success and an error string on failure.
|
||||
*/
|
||||
char *
|
||||
@ -184,7 +184,7 @@ readdisklabel(dev, strat, lp)
|
||||
msg = "I/O error";
|
||||
else for (dlp = (struct disklabel *)bp->b_data;
|
||||
dlp <= (struct disklabel *)((char *)bp->b_data +
|
||||
DEV_BSIZE - sizeof(*dlp));
|
||||
lp->d_secsize - sizeof(*dlp));
|
||||
dlp = (struct disklabel *)((char *)dlp + sizeof(long))) {
|
||||
if (dlp->d_magic != DISKMAGIC || dlp->d_magic2 != DISKMAGIC) {
|
||||
if (msg == NULL)
|
||||
|
@ -36,7 +36,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)ufs_disksubr.c 8.5 (Berkeley) 1/21/94
|
||||
* $Id$
|
||||
* $Id: ufs_disksubr.c,v 1.30 1997/02/22 09:47:45 peter Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -160,7 +160,7 @@ insert:
|
||||
* Attempt to read a disk label from a device using the indicated strategy
|
||||
* routine. The label must be partly set up before this: secpercyl, secsize
|
||||
* and anything required in the strategy routine (e.g., dummy bounds for the
|
||||
* partition containing the label) must be * filled in before calling us.
|
||||
* partition containing the label) must be filled in before calling us.
|
||||
* Returns NULL on success and an error string on failure.
|
||||
*/
|
||||
char *
|
||||
@ -184,7 +184,7 @@ readdisklabel(dev, strat, lp)
|
||||
msg = "I/O error";
|
||||
else for (dlp = (struct disklabel *)bp->b_data;
|
||||
dlp <= (struct disklabel *)((char *)bp->b_data +
|
||||
DEV_BSIZE - sizeof(*dlp));
|
||||
lp->d_secsize - sizeof(*dlp));
|
||||
dlp = (struct disklabel *)((char *)dlp + sizeof(long))) {
|
||||
if (dlp->d_magic != DISKMAGIC || dlp->d_magic2 != DISKMAGIC) {
|
||||
if (msg == NULL)
|
||||
|
Loading…
Reference in New Issue
Block a user