Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Nov 2017 18:00:03 -0700
From:      Warner Losh <imp@bsdimp.com>
To:        "Rodney W. Grimes" <rgrimes@freebsd.org>
Cc:        Warner Losh <imp@freebsd.org>, src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r325903 - in head: sbin/fsck_ffs sbin/newfs sys/sys
Message-ID:  <CANCZdfpSSWZDxO7V-LN4NMLnHK97exdzghOcFuYXy41Dz29_xg@mail.gmail.com>
In-Reply-To: <201711162324.vAGNONIg058059@pdx.rh.CN85.dnsmgr.net>
References:  <201711162128.vAGLSEpZ019174@repo.freebsd.org> <201711162324.vAGNONIg058059@pdx.rh.CN85.dnsmgr.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Nov 16, 2017 4:24 PM, "Rodney W. Grimes" <freebsd@pdx.rh.cn85.dnsmgr.net>
wrote:

[ Charset UTF-8 unsupported, converting... ]
> Author: imp
> Date: Thu Nov 16 21:28:14 2017
> New Revision: 325903
> URL: https://svnweb.freebsd.org/changeset/base/325903
>
> Log:
>   Only try to enable CK_CLYGRP if we're running on kernel newer than
>   1200046, the first version that supports this feature. If we set it,
>   then use an old kernel, we'll break the 'contract' of having
>   checksummed cylinder groups this flag signifies. To avoid creating
>   something with an inconsistent state, don't turn the flag on in these
>   cases. The first full fsck with a new kernel will turn this on.

I would much rather have to force this flag on, then
my problem would for the most part just go away, I can move file
systems back and forth between kernels without any problems.

Having fsck just turn it on without even a message let alone
a way to stop it being turned on increases the pain factor.


That's a request for Kirk. I'm not changing his design for this detail. If
it helps, it is only with some options it is turned on.... it only does
this for non preen -p, non -y runs.

Warner


>   Spnsored by: Netflix
>   Differential Revision: https://reviews.freebsd.org/D13114
>
> Modified:
>   head/sbin/fsck_ffs/pass5.c
>   head/sbin/newfs/mkfs.c
>   head/sbin/newfs/newfs.c
>   head/sys/sys/param.h
>
> Modified: head/sbin/fsck_ffs/pass5.c
> ============================================================
==================
> --- head/sbin/fsck_ffs/pass5.c        Thu Nov 16 19:07:19 2017
(r325902)
> +++ head/sbin/fsck_ffs/pass5.c        Thu Nov 16 21:28:14 2017
(r325903)
> @@ -35,6 +35,7 @@ static const char sccsid[] = "@(#)pass5.c   8.9 (Berkele
>  #include <sys/cdefs.h>
>  __FBSDID("$FreeBSD$");
>
> +#define      IN_RTLD                 /* So we pickup the P_OSREL defines
*/
>  #include <sys/param.h>
>  #include <sys/sysctl.h>
>
> @@ -73,6 +74,7 @@ pass5(void)
>       newcg->cg_niblk = fs->fs_ipg;
>       if (preen == 0 && yflag == 0 && fs->fs_magic == FS_UFS2_MAGIC &&
>           fswritefd != -1 && (fs->fs_metackhash & CK_CYLGRP) == 0 &&
> +         getosreldate() >= P_OSREL_CK_CLYGRP &&
>           reply("ADD CYLINDER GROUP CHECKSUM PROTECTION") != 0) {
>               fs->fs_metackhash |= CK_CYLGRP;
>               rewritecg = 1;
>
> Modified: head/sbin/newfs/mkfs.c
> ============================================================
==================
> --- head/sbin/newfs/mkfs.c    Thu Nov 16 19:07:19 2017        (r325902)
> +++ head/sbin/newfs/mkfs.c    Thu Nov 16 21:28:14 2017        (r325903)
> @@ -44,6 +44,7 @@ static char sccsid[] = "@(#)mkfs.c  8.11 (Berkeley) 5/3
>  #include <sys/cdefs.h>
>  __FBSDID("$FreeBSD$");
>
> +#define      IN_RTLD                 /* So we pickup the P_OSREL defines
*/
>  #include <sys/param.h>
>  #include <sys/disklabel.h>
>  #include <sys/file.h>
> @@ -495,7 +496,7 @@ restart:
>       /*
>        * Set flags for metadata that is being check-hashed.
>        */
> -     if (Oflag > 1)
> +     if (Oflag > 1 && getosreldate() >= P_OSREL_CK_CLYGRP)
>               sblock.fs_metackhash = CK_CYLGRP;
>
>       /*
>
> Modified: head/sbin/newfs/newfs.c
> ============================================================
==================
> --- head/sbin/newfs/newfs.c   Thu Nov 16 19:07:19 2017        (r325902)
> +++ head/sbin/newfs/newfs.c   Thu Nov 16 21:28:14 2017        (r325903)
> @@ -398,10 +398,6 @@ 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)
>
> Modified: head/sys/sys/param.h
> ============================================================
==================
> --- head/sys/sys/param.h      Thu Nov 16 19:07:19 2017        (r325902)
> +++ head/sys/sys/param.h      Thu Nov 16 21:28:14 2017        (r325903)
> @@ -84,6 +84,7 @@
>  #define      P_OSREL_SHUTDOWN_ENOTCONN       1100077
>  #define      P_OSREL_MAP_GUARD               1200035
>  #define      P_OSREL_WRFSBASE                1200041
> +#define      P_OSREL_CK_CLYGRP               1200046
>  #define      P_OSREL_VMTOTAL64               1200054
>
>  #define      P_OSREL_MAJOR(x)                ((x) / 100000)
>
>

--
Rod Grimes
rgrimes@freebsd.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfpSSWZDxO7V-LN4NMLnHK97exdzghOcFuYXy41Dz29_xg>