From owner-freebsd-fs@freebsd.org Sun Nov 25 19:01:59 2018 Return-Path: Delivered-To: freebsd-fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F39A4113E288 for ; Sun, 25 Nov 2018 19:01:58 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it1-x12b.google.com (mail-it1-x12b.google.com [IPv6:2607:f8b0:4864:20::12b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DAEC572D19 for ; Sun, 25 Nov 2018 19:01:57 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it1-x12b.google.com with SMTP id x19so25042114itl.1 for ; Sun, 25 Nov 2018 11:01:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Kt3yPejAAvtxSkJTdwam9o1UxfgHUqac6OhEg/4KPrk=; b=F5Jbmy8EnuSxDd7Np/JRpKVEa2MaWlcVBW8BE1gRzCG2qplBcgy/c+WF2oUpm5Jvrp I0h6cPoTtxnuHKIqYmyk4QurvpEY9ce1Ey6sXlUqCEShO9zzK+r5okMPHUn8ybsNhqw2 4Su6r9du/3lZlHV/OfKOtPIFum3ila9Q7kZC2Lk91YdOqtaKR9rrJWjLrK0tN/wJS+xG VTvNoY5fukiO5sVNHJMrHUR8uW8QdG/1hB0pG7yLXlOko5ryZZ3SJdSVfFGs6lD/aG4i VcXeyDxs2Wc5eAT49AoGq2iNVpablG7kDU79B9BPdistSPrg4kdGdeV52OuQm27oelta sqPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Kt3yPejAAvtxSkJTdwam9o1UxfgHUqac6OhEg/4KPrk=; b=bhmt09YJRJ+wEMdkpV4ipT/zESunv2cEc8GUi1yhPyhLFohhsSU2S81Eez8Z9N6e// a99iWEVGg2zRtMf0tLdkTNi+ha2qcGXRXrz7X2DcTOJ3A1z1iP/UwcL+KSL1XVEHBARs dvz/NiYQ0stHxLo6ZcCEwajc7JpSjBHNkoPo3DbbhELyK0TnCc6FWnonrIoBbUHUO8Xk IbqYGAjJntsiR9LrxPzdCFZzOw5q08YDq58zJTIjELQpLG0MBMHjdwb3dE+SBpG6nA42 6+Qc9J+CXoWGhG1tyF7jSdEFqQHVhWqiaSOpzawoVg/sZQb85IRb7fVUxDexmLI3lE59 Hk4w== X-Gm-Message-State: AA+aEWb6ChLLwMUpsXgGqaX+9yRItaQkRLkuOmnZA6oS9YQ9TIMwhzBg 5H7Jn39Jf/8ou0BhSkMD1fvZIdJgUGJC9+kMcAccRQ== X-Google-Smtp-Source: AFSGD/UDEcvpYDZV5sdAo2XYINK0HWegibM6265ByxKk8ZXLIzrXrDMqHon1bXbvOQmBR04X2MdaBD4QX9AqZHVLP9c= X-Received: by 2002:a02:3da:: with SMTP id e87mr19587539jae.78.1543172516898; Sun, 25 Nov 2018 11:01:56 -0800 (PST) MIME-Version: 1.0 References: <201811251842.wAPIgEpW053136@chez.mckusick.com> In-Reply-To: <201811251842.wAPIgEpW053136@chez.mckusick.com> From: Warner Losh Date: Sun, 25 Nov 2018 12:01:45 -0700 Message-ID: Subject: Re: [bug] fsck refuses to repair damaged UFS using backup superblock To: Kirk McKusick Cc: Rick Macklem , FreeBSD FS , "Julian H. Stacey" , "soralx@cydem.org" X-Rspamd-Queue-Id: DAEC572D19 X-Spamd-Result: default: False [-4.50 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-fs@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; MX_GOOD(-0.01)[ALT1.aspmx.l.google.com,aspmx.l.google.com,ALT2.aspmx.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[b.2.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.92)[-0.920,0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-1.57)[ip: (-4.42), ipnet: 2607:f8b0::/32(-1.91), asn: 15169(-1.42), country: US(-0.09)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2018 19:01:59 -0000 On Sun, Nov 25, 2018, 11:35 AM Kirk McKusick > From: Rick Macklem > > To: "soralx@cydem.org" , > > Kirk McKusick > > CC: "freebsd-fs@freebsd.org" , > > "Julian H. Stacey" > > > > Subject: Re: [bug] fsck refuses to repair damaged UFS using backup > superblock > > Date: Sun, 25 Nov 2018 15:25:21 +0000 > > > >> Kirk McKusick wrote: > >> > >> Below is a proposed fix for fsck_ffs to properly handle superblock > >> check-hash failures (notably to optionally search for a usable > >> alternate superblock). Let me know if you still have a filesystem > >> on which you can test it, and if so whether it works correctly. > > > > As above, I think you can reproduce this by running an older kernel > > that mounts the file system. I ended up re-installing when I ran > > into this yesterday (no biggy, it was just a test machine). It > > happened after I had been running a kernel built from stable/12 on > > the system and then tried to boot it. (Since the root fs got these > > errors, I couldn't boot any kernel on the root fs.) > > Kernels before -r339671 clear the CK_SUPERBLOCK flag in the superblock. > Kernels at and after -r339671 ignore the check-hash if the CK_SUPERBLOCK > flag is clear. So you should be able to run on older kernels without > causing superblock check-hash failures on later kernels. Fsck will offer > to enable the superblock check-hash if you are running on a kernel at > or newer than -r339671. > > > It would be nice if there was a way to override the check and boot > > the system. (Is a loader tunable reasonable for this?) > > > > rick > > I have fixed the problem with fsck being unable to check filesystems > with check-hash failures in -r340925. > > Rather than adding a loader tunable to override the check (which people > would have to track down in the midst of a crisis), it might be better > to simply have the loader print a warning when there is a mismatch and > proceed to try using the filesystem. If successful, an fsck could then > be run to try and clean it up. Does this seem reasonable? > Yes. You have a big chicken and egg issue otherwise. And not booting seems like an extreme overreaction to a bad checksum. I can think of no use case where you'd want it. Let's let people ask for it with a decent use case before we do anything more than print a warning and soldier on... Warner Kirk McKusick > _______________________________________________ > freebsd-fs@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-fs > To unsubscribe, send any mail to "freebsd-fs-unsubscribe@freebsd.org" >