mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-11 14:10:34 +00:00
Warn when user use sectorsize bigger than the page size, which will lead
to problems when the geli device is used with file system or as a swap. Hopefully will prevent problems like kern/98742 in the future. MFC after: 1 week
This commit is contained in:
parent
4802040ebf
commit
97a669a3b2
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=167229
@ -609,6 +609,10 @@ eli_init(struct gctl_req *req)
|
||||
gctl_error(req, "Invalid sector size.");
|
||||
return;
|
||||
}
|
||||
if (val > sysconf(_SC_PAGE_SIZE)) {
|
||||
gctl_error(req, "warning: Using sectorsize bigger than "
|
||||
"the page size!");
|
||||
}
|
||||
md.md_sectorsize = val;
|
||||
}
|
||||
|
||||
|
@ -355,6 +355,10 @@ g_eli_ctl_onetime(struct gctl_req *req, struct g_class *mp)
|
||||
gctl_error(req, "Invalid sector size.");
|
||||
return;
|
||||
}
|
||||
if (*sectorsize > PAGE_SIZE) {
|
||||
gctl_error(req, "warning: Using sectorsize bigger than "
|
||||
"the page size!");
|
||||
}
|
||||
md.md_sectorsize = *sectorsize;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user