diff options
author | pjd <pjd@FreeBSD.org> | 2007-03-05 12:41:44 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2007-03-05 12:41:44 +0000 |
commit | b23a2a2ffb457e9aeca3508b7e9fb9bfb0a04f48 (patch) | |
tree | 55cc48861903309fe856b25c403cf954f34a0724 /sbin | |
parent | d623026ad10fd369470ba71bbd2b8891ec0b9ea4 (diff) | |
download | FreeBSD-src-b23a2a2ffb457e9aeca3508b7e9fb9bfb0a04f48.zip FreeBSD-src-b23a2a2ffb457e9aeca3508b7e9fb9bfb0a04f48.tar.gz |
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
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/geom/class/eli/geom_eli.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sbin/geom/class/eli/geom_eli.c b/sbin/geom/class/eli/geom_eli.c index ed13555..3bf4fdc 100644 --- a/sbin/geom/class/eli/geom_eli.c +++ b/sbin/geom/class/eli/geom_eli.c @@ -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; } |