From owner-svn-src-head@freebsd.org Wed Nov 15 20:58:19 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 D53D2DE72DA for ; Wed, 15 Nov 2017 20:58:19 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22b.google.com (mail-io0-x22b.google.com [IPv6:2607:f8b0:4001:c06::22b]) (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 966D87BA75 for ; Wed, 15 Nov 2017 20:58:19 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22b.google.com with SMTP id x63so2974767ioe.6 for ; Wed, 15 Nov 2017 12:58:19 -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=V8eVkdelRKju1wZCxyZ0ofYU+ibpPHEHqMuEddkBK24=; b=k3vCsLQmblP/QhrN7+rvLjnVY4WHy2Jdx4Arwxbh+9+ozrAIuitvnUGRVkm38RzZ9n UwQ8TbI9vf6rSPrKmmDORDOEmXeQXPhU1K1d8E/0oXET8KX553QH7T7eq5XQ2v16X08D db806DiwYNRWPr95/NMvaZ7Aq9tGauQaDP8Yc0aG8sn/nw2QrpiHdhg6hc0zwa3BBGDe 8mvYLyHdBlYXqS1SIiybiAIcm7ayjDBGEZ7P6ZbqVRSp6LfIAruIr/mEC7PX9N1ro3uy JIfvmUdR8TkWfTfdeGSe9HxwbzOAE5ko1yqWQ5JP7v/Ekr/v6GnhTGOjwQvDuK2vyVba 6knA== 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=V8eVkdelRKju1wZCxyZ0ofYU+ibpPHEHqMuEddkBK24=; b=Vs3ghqX+t7mljh2r4gKH1bTCruxUrzE/6PuuDn5VyElntvqQNTwogPnNJZgdeSK92h Kt7WZUVL5/xALeQb5uxxrnXPlNoZHVuTvUglrGdpFcyZIhdSGIEQKr5/afYQ/Obzrq3c hp5LoOoC2tZMm+MGBO3QnK7QuQXDdwHeJDP8i//VUQG6cD78O4v8XP3ugCYMCNTjJXgZ qfUBWErRGx1vozPyA2Ag2PDeYdh/a5TaQjHODr+3rYZl5iQe/oM7sbaFjCdRGzp0uU7t LYyizPYUSsJ8CZqvHECumGnIySmjTO+SP1lU5q4aZt2GqEmjMjVJ8VQB5txSCN4PJY4B mWxQ== X-Gm-Message-State: AJaThX4bkQ0Wfv8bwKCCQ0VJOMseCmxkyq3TZwGeylWvyeRsrTB2qMo5 gxJJaAGdqSdGLZYzN6OackT1ArTr0J5aTxLMQOAYIA== X-Google-Smtp-Source: AGs4zMa/IMag2ZMewKiYp6modJWGrsTqqQIUWgnEGshirt4XJ+Gvb+VXVKVOkwOpets5Q2Bw64l8eY5+0Uqhh8lJp2c= X-Received: by 10.107.30.73 with SMTP id e70mr19446757ioe.130.1510779497490; Wed, 15 Nov 2017 12:58:17 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.108.204 with HTTP; Wed, 15 Nov 2017 12:58:16 -0800 (PST) X-Originating-IP: [2607:fb90:6cbb:3482:ed95:2e8b:8936:7768] Received: by 10.79.108.204 with HTTP; Wed, 15 Nov 2017 12:58:16 -0800 (PST) In-Reply-To: <201711152051.vAFKp6Is052998@pdx.rh.CN85.dnsmgr.net> References: <201711152051.vAFKp6Is052998@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Wed, 15 Nov 2017 13:58:16 -0700 X-Google-Sender-Auth: 0jr1LXkwWI8tUVnXwLAhXejhJSc Message-ID: Subject: Re: svn commit: r325860 - head/sbin/newfs To: "Rodney W. Grimes" Cc: Ed Maste , 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: Wed, 15 Nov 2017 20:58:19 -0000 On Nov 15, 2017 1:51 PM, "Rodney W. Grimes" wrote: [ Charset UTF-8 unsupported, converting... ] > On Nov 15, 2017 11:47 AM, "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. > > > Not really. The cg stuff is really only a hassle for the case ed is testing > for. Its too late now, but if you take a newer ufs with the cg stuff in them and mount it on an old system it politly well corrupt the data that the newer kernel needs. So your right, doing this check in newfs wont do anything, but I can tell you this tiny little chain has been a PITA for people that move HD around.... Fsck automatically fixes issues like that. It recomputes the checksums. > *Sigh* why did not UFS grow a version number of its own > when things started to change other than UFS1 vs UFS2. > > > This isn't anything like those changes.. UFS changed in a way that makes it difficult to move UFS drives accross systems that are at differing versions. That IS bad no mater how you slice it. I now have to make sure I fsck a drive when moving it from an old to new system to get the cg checksum stuff fixed. Except it isn't as bad as you say. Warner > Warner > > > Reviewed by: gjb, jhb, mckusick > > Sponsored by: The FreeBSD Foundation > > Differential Revision: https://reviews.freebsd.org/D12765 > > > > Modified: > > head/sbin/newfs/newfs.c > > > > Modified: head/sbin/newfs/newfs.c > > ============================================================ > ================== > > --- head/sbin/newfs/newfs.c Wed Nov 15 18:03:31 2017 (r325859) > > +++ head/sbin/newfs/newfs.c Wed Nov 15 18:40:40 2017 (r325860) > > @@ -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) > > > > > > -- > Rod Grimes > rgrimes@freebsd.org -- Rod Grimes rgrimes@freebsd.org