From nobody Thu Aug 18 12:41:56 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4M7kzS5MBvz4ZPvv; Thu, 18 Aug 2022 12:41:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4M7kzS4wYsz3q8p; Thu, 18 Aug 2022 12:41:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660826516; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PLCCLQoXaarISm+0+OKbMcLqeCxLFyhmDZ76rtCoXrs=; b=VVfFkfqcFnogEkHrMM4RfsRmcewS4HzLMSgfol1j9y9Ro3fPQTNjjPs7shP+f9GMgpEYbE uHW7uXCJnsxhZ7waqnma/4RjV992NUODmhEoxuHpKtpMTXlmo5p2qYxWk20HC3D6Ot6jnT k85vDRTC/qxj6dJVK/+V0PdnkCYbyowmNc798LfbKfpArQNgvfyrEktkRXw3SlSrtmBa5u ydmF+vWPrk94k1VnLFA9ZMPiA+OoMmN38WmtDmsB004W47AEuzNwzS25YiUYALNCxtoqo6 DRMk/vBiNNKeAAMFUCSuJWVVgTXQTLJ/GN+al2W3BsHgomkyvUKmA5RPuzU2sg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4M7kzS3zdZzF1J; Thu, 18 Aug 2022 12:41:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 27ICfuHs024413; Thu, 18 Aug 2022 12:41:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27ICfuiE024412; Thu, 18 Aug 2022 12:41:56 GMT (envelope-from git) Date: Thu, 18 Aug 2022 12:41:56 GMT Message-Id: <202208181241.27ICfuiE024412@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 6d645da0d49d - main - stand: Search less agressively for UFS super block List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6d645da0d49decc0352f27b8b5ff1983c611659d Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660826516; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PLCCLQoXaarISm+0+OKbMcLqeCxLFyhmDZ76rtCoXrs=; b=pgzIF4BzDXB16NIhUzSNdAOuvIT9Wehj9PPUtNFsKI3dSte/YQLfYGvSfCuprdKkyOPO4O /X0qbryotcImlN8t4JI2MSOjHZKafiqGfJ84d+qZL14v5ZaPrPY/ck/zZ0WFjP5rXMfPWL k6kETX25KnLcm3ymI5t1a8Na0CEnMkp2Woqw3uBa11XGDv1tQjEO6yL84mbKDYDlJpygu7 GwJS1DJhBuEt6P0I2FXSIm2rmpYprSGImTyMWnGg7xG22HdAaMTtZGNa+OChb+2JDCdwtC HhqlS4exGWbPcVDTLDLKuXQxGsFFi0eVDr3FjjQBuhVXY7p4lLqncysqNVGDTA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1660826516; a=rsa-sha256; cv=none; b=ARMDL2zvb2pazyQ2X27Ie1z3ud0Ksgy6EsovZsKJJ5fjUE2bA3E6GX/WQTEjAeuEFGQahz dx403C1QOwxshlvh9lUR8kdlCb6uFWQfwcFUSs1aSXBd2xWGs/JU7dlQqEtx2x66AudmB/ YNYmx27cR7GHFoZorMrGl3GFUuFDY9J/dje1r0wN6w+AO31RmoRD6Dbpj455W5HHd2/wc7 xBegxNPRNPtYGi5x+AVMb9I4Arq7MAZwpbPEM8ztyOLGfDlQIMUx/WbSO2aVS4Q2IUOSlC XyhNqqIJlmSdQM4e7rN+NNGCEnaFZwZhabmD5JIwQQQdaIVdi+bKQdXBxYnLyA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=6d645da0d49decc0352f27b8b5ff1983c611659d commit 6d645da0d49decc0352f27b8b5ff1983c611659d Author: Warner Losh AuthorDate: 2022-08-18 12:40:24 +0000 Commit: Warner Losh CommitDate: 2022-08-18 12:41:11 +0000 stand: Search less agressively for UFS super block The boot loader should look in the standard places for the UFS superblock, but not go too far into the speculative realm. Supress errors about hash being invalid, which will allow us to boot, even when the superblock looks good, but fails the hash test. This defers any policy decisions about booting and/or recovery to userland. This also has the side effect of eliminating some rather spammy messages when UFS searches devices with filesystems that are not UFS... Sponsored by: Netflix Reviewed by: mckusick Differential Revision: https://reviews.freebsd.org/D36253 --- stand/libsa/ufs.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/stand/libsa/ufs.c b/stand/libsa/ufs.c index 65cda349879a..769fe9120ee6 100644 --- a/stand/libsa/ufs.c +++ b/stand/libsa/ufs.c @@ -151,6 +151,9 @@ static int search_directory(char *, struct open_file *, ino_t *); static int ufs_use_sa_read(void *, off_t, void **, int); /* from ffs_subr.c */ +int ffs_sbget(void *devfd, struct fs **fsp, off_t sblock, int flags, + char *filltype, + int (*readfunc)(void *devfd, off_t loc, void **bufp, int size)); int ffs_sbsearch(void *, struct fs **, int, char *, int (*)(void *, off_t, void **, int)); @@ -529,8 +532,8 @@ ufs_open(const char *upath, struct open_file *f) if (mnt == NULL) { /* read super block */ twiddle(1); - if ((rc = ffs_sbsearch(f, &fs, 0, "stand", ufs_use_sa_read)) - != 0) { + if ((rc = ffs_sbget(f, &fs, UFS_STDSB, UFS_NOHASHFAIL, "stand", + ufs_use_sa_read)) != 0) { goto out; } } else {