From owner-svn-src-head@freebsd.org Thu Nov 16 00:36:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C33DDEFFC5 for ; Thu, 16 Nov 2017 00:36:24 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x235.google.com (mail-io0-x235.google.com [IPv6:2607:f8b0:4001:c06::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E3E3264BF1 for ; Thu, 16 Nov 2017 00:36:23 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x235.google.com with SMTP id h205so2748052iof.5 for ; Wed, 15 Nov 2017 16:36:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=34l5XLYo28ts21m6mRnO5E4l/uPa/2CEs6dbIHYKYSs=; b=IxcD3MjfusC0OY9SlwE6yajWv/fqhX2RjaU5NggiN2NfWF+TC9ojovkiM/dEg66CpY +MKR2RK9uewHS4vGGVx4eAaf/7kFRBJq1QQ6TH7Ai28F/u52awAA0qwbFLswMO47KKAE RY7emVmR7zRCcORqgN0ajBAlpHOIMsaVqGvVn1LUzuY8h0Lg9U14oewbxZRc7jQBtgwp y8u4hs4AIjYkCU5GrOTyzFM0Y+QHsFnXP8YrKOJtnqJJkc/SCH2e8Tz5+r1Xoo+tEaAO 547Z2/ySfs7NhqX/0/r+oI64tXWVCrIzyTFZsDCas1oB7Z00AqnMHbAcDQwxvb83meuf V3aQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=34l5XLYo28ts21m6mRnO5E4l/uPa/2CEs6dbIHYKYSs=; b=nDyw5H5xDA5+hn2jhCSTcWKaMLb8KT5YAuhCoZYFU6yN0MITE22kvJwnN3K4p14Qdb DXQWqyIX8/kVtcLa8s8XE6WLypENVS/RswdqINmCLWqU2o+4rHYjuUgmXzydG9nskw9o +k/SAY+cj5PB3oBECqqfDIykBYi7VGXlrg8fgS+ya81H7YwDSnLc4RmWD2hIuZv/ho7g YAa+bpJCTi6u/1BHSS9r/P39Byp7g735fmjiqtpZBfjzrjTeY4nKux95a8Zz+V/dZSxG Nzipl2W+u0amu4m4fxAmoa0dW7EfGqGKdBILG6BBQC+5dnYmhtsNKlAdQU0FTCHqjrzg bwgg== X-Gm-Message-State: AJaThX6W7NyNC8PhSJUYe3xMItqjC2xCDz3EovAbtYYIGKZxzFhjrBRo 4etbgSFchJDU/iKxce4U2RhnW0rBNCsAvojwcHlswg== X-Google-Smtp-Source: AGs4zMb6cVPC99IK2Q3CI1tZksHxzALd9DgilGsDrupCr5kagbAlKQV0+GWD64RdF4PywjvuFnLzqLXsj7Bhb+yi7Ro= X-Received: by 10.107.48.195 with SMTP id w186mr6540201iow.301.1510792582821; Wed, 15 Nov 2017 16:36:22 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.108.204 with HTTP; Wed, 15 Nov 2017 16:36:22 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:9151:cca:5a07:fd20] In-Reply-To: References: <201711151840.vAFIefKV002185@repo.freebsd.org> <201711151847.vAFIlGD9052509@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Wed, 15 Nov 2017 17:36:22 -0700 X-Google-Sender-Auth: LAfCrngUGOI2tfayqxF1sAvjaoE Message-ID: Subject: Re: svn commit: r325860 - head/sbin/newfs To: Ed Maste Cc: "Rodney W. Grimes" , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Nov 2017 00:36:24 -0000 On Wed, Nov 15, 2017 at 5:05 PM, Ed Maste wrote: > On 15 November 2017 at 13:47, Rodney W. Grimes > wrote: > >> Author: emaste > >> Date: Wed Nov 15 18:40:40 2017 > >> New Revision: 325860 > >> URL: https://svnweb.freebsd.org/changeset/base/325860 > >> > >> Log: > >> 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. > > > > You should probably make the warning if (newer || older) as > > either is likely to have interesting side effects, as are > > mounting ufs file systems on different versions. > > Why would an older newfs cause trouble? Forward compatibility should be > fine > The only scenario that 'old' would cause problems is that if you did a newfs with a new binary on a new kernel, mounted the file system, wrote files to it, then rebooted with an old kernel, mounted the filesystem there, writing new files to it, and then unmounting and running with a new kernel. At that point, the new kernel will start printing cg mismatch errors and will limit its allocation to CGs that weren't modified when it was mounted under the old kernel (since those CGs will have changed their checksum, but no new checksum will have been computed). The root cause here is that the old kernel doesn't know that the CK_CYLGRP tags the cg as having the proper hash metadata associated with them. It sounds like this is exactly what Rod does on a regular basis as he's taking a disk from one system to another and back again, maybe for file transport on a USB stick. It's not a crazy scenario. At this point, there's the annoyance of the messages, but that will be fixed with an fsck. The scenario where I have a newer kernel and an old newfs will be a nop: the old newfs won't set CK_CYLGRP, so the kernel won't checksum, so there won't be any mismatch possible. I'm not sure that the new safety belt is reasonable. Today it's fine, but over time it will start producing false-positive warnings since the real issue is just before/after the cg change, not old/new in general. I'd be tempted to make a check against newfs being >= 1200046 while the kernel is < 1200046. There wasn't a specific bump for this change to sys/param.h, but this version was bumped within a few hours of Kirk's change. Warner