mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-26 11:47:31 +00:00
Restore the old behaviour. If requested partition is a BSD slice,
but d_partition isn't explicitly set, then try to open BSD label and its first partition.
This commit is contained in:
parent
baf3d8bfeb
commit
9131425146
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=239232
@ -185,10 +185,18 @@ disk_open(struct disk_devdesc *dev, off_t mediasize, u_int sectorsize)
|
||||
if (rc != 0) /* Partition doesn't exist */
|
||||
goto out;
|
||||
dev->d_offset = part.start;
|
||||
if (dev->d_partition == -1 ||
|
||||
dev->d_partition == 255)
|
||||
if (dev->d_partition == 255)
|
||||
goto out; /* Nothing more to do */
|
||||
|
||||
if (dev->d_partition == -1) {
|
||||
/*
|
||||
* If we are looking at a BSD slice, and the
|
||||
* partition is < 0, assume the 'a' partition.
|
||||
*/
|
||||
if (part.type == PART_FREEBSD)
|
||||
dev->d_partition = 0;
|
||||
else
|
||||
goto out;
|
||||
}
|
||||
/* Try to read BSD label */
|
||||
table = ptable_open(dev, part.end - part.start + 1,
|
||||
od->sectorsize, ptblread);
|
||||
|
Loading…
Reference in New Issue
Block a user