Date: Fri, 22 Mar 2024 19:03:57 GMT From: Ed Maste <emaste@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 0459337491cd - stable/13 - makefs: warn that ffs sectorsize other than 512 may not work Message-ID: <202403221903.42MJ3vGI064425@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=0459337491cdfdd752507c0d2722999a6a9781ef commit 0459337491cdfdd752507c0d2722999a6a9781ef Author: Ed Maste <emaste@FreeBSD.org> AuthorDate: 2024-01-25 01:47:36 +0000 Commit: Ed Maste <emaste@FreeBSD.org> CommitDate: 2024-03-22 19:03:48 +0000 makefs: warn that ffs sectorsize other than 512 may not work newfs always sets sectorsize to DEV_BSIZE (512) and derives some other values based on the number of 512-byte sectors per real sector. Similar logic is required in makefs. Until that happens, emit a warning that the image may be incorrect. PR: 276571 (cherry picked from commit 176b9e0d724b4c1a24d2c46a1256381784f04edc) (cherry picked from commit 8e402178193f7b273a956b864d8d8b288ce62ee7) --- usr.sbin/makefs/ffs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/usr.sbin/makefs/ffs.c b/usr.sbin/makefs/ffs.c index 7504d6653180..cc83f2f2d3d2 100644 --- a/usr.sbin/makefs/ffs.c +++ b/usr.sbin/makefs/ffs.c @@ -340,6 +340,9 @@ ffs_validate(const char *dir, fsnode *root, fsinfo_t *fsopts) /* set FFS defaults */ if (fsopts->sectorsize == -1) fsopts->sectorsize = DFL_SECSIZE; + if (fsopts->sectorsize != DFL_SECSIZE) + warnx("sectorsize %d may produce nonfunctional image", + fsopts->sectorsize); if (ffs_opts->fsize == -1) ffs_opts->fsize = MAX(DFL_FRAGSIZE, fsopts->sectorsize); if (ffs_opts->bsize == -1)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202403221903.42MJ3vGI064425>