mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-18 10:35:55 +00:00
Sector size can not be greater than MAXPHYS. Since GRAID3 calculates
sector size from user-specified block size, report to user about big blocksize. PR: kern/147851 MFC after: 1 week
This commit is contained in:
parent
ab7a71f6e7
commit
95959703e1
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=217305
@ -213,6 +213,11 @@ raid3_label(struct gctl_req *req)
|
||||
md.md_sectorsize = sectorsize * (nargs - 2);
|
||||
md.md_mediasize -= (md.md_mediasize % md.md_sectorsize);
|
||||
|
||||
if (md.md_sectorsize > MAXPHYS) {
|
||||
gctl_error(req, "The blocksize is too big.");
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Clear last sector first, to spoil all components if device exists.
|
||||
*/
|
||||
|
@ -2913,6 +2913,10 @@ g_raid3_read_metadata(struct g_consumer *cp, struct g_raid3_metadata *md)
|
||||
cp->provider->name);
|
||||
return (error);
|
||||
}
|
||||
if (md->md_sectorsize > MAXPHYS) {
|
||||
G_RAID3_DEBUG(0, "The blocksize is too big.");
|
||||
return (EINVAL);
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user