mirror of
https://github.com/opnsense/src.git
synced 2026-06-04 06:15:33 -04:00
newfs: warn if newer than kernel
Creating a UFS filesystem with a newfs newer than the running kernel, and then mounting that filesystem, can lead to interesting failures. Add a safety belt to explicitly warn when newfs is newer than the running kernel. Reviewed by: gjb, jhb, mckusick Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D12765
This commit is contained in:
parent
92b800cc1a
commit
4acb68a8a5
1 changed files with 4 additions and 0 deletions
|
|
@ -398,6 +398,10 @@ main(int argc, char *argv[])
|
|||
if (pp != NULL)
|
||||
pp->p_size *= secperblk;
|
||||
}
|
||||
if (getosreldate() < __FreeBSD_version) {
|
||||
warnx("%s is newer than the running kernel and may not be compatible",
|
||||
getprogname());
|
||||
}
|
||||
mkfs(pp, special);
|
||||
ufs_disk_close(&disk);
|
||||
if (!jflag)
|
||||
|
|
|
|||
Loading…
Reference in a new issue