From nobody Fri May 26 01:59:38 2023 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 4QS7Qf72Cwz4THs7; Fri, 26 May 2023 01:59:38 +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 4QS7Qf6XXZz3NXH; Fri, 26 May 2023 01:59:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685066378; 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=JhZBZaprS5D3NgWSGpSgS3TS6OicRckmUmz6Vzr0w7w=; b=Nxx0RCGKN5/t0xb2leS/QQFCiGTdjyRFTS3yRaZXuEw9aBkR96WqikaRUWFBGz6koqMuO0 VtCJ7kFKzcVERnEL1ITlpy3kdFmILLPMMuCIiJ975VG2JgVn5FLQUAg8d7Z0wNuHZfDwI1 YIysjJuHVer0h973DmqHgbz3mh6Cu2mvhVvEeUNzX1vck93Wco81WFB296c6dl0w6fsGho i/sS9BDnFxUwGn+P/r74b5icHel4INDp0MvNF64huocQofsYxFCjZkVd6mcEsUqhMMcCej FpCunqwtaukUzE05YHMAfLCertStpofpGbsVcH/ktE438pp7t0q9OnEr7Jzdsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685066378; 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=JhZBZaprS5D3NgWSGpSgS3TS6OicRckmUmz6Vzr0w7w=; b=ROtNcVpQwQGS6V2cU/QTECriTACkLWNbdT9WLuVF/ncczZcSooDp2W2Oxh1JDWNwrE31ag vLPz9GqmXDbLsBjVr5QEdzOjwarrrZaemWCQpg0ClfEZDAhgUY7GHoEAPpfIAPz7xzzL33 gKGYwn8eH/rab65XdUJBgkodZmGsLXXu6TKnCGWg0vwC0bdpimMtD77QXoqh0K/Isk9P0T RCdPwHa11Wg0gyT9p+3Hd/rullfy1ohCmxN+MpvYLlkXfGn6wMYbaZ4cBV/uywjH8srkEj m/k6sIX8iSaTOzzWPFncuBw6zgMMU+5JPArR0dQwlBbwcx7qrFAKlddFk/bcNA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685066378; a=rsa-sha256; cv=none; b=K3wceap4PHG4VU0wjbwjXl749NDRFHsA67okB3/fnaCHXQCQJzJkt2hUKWHL5eFHhD3iwY icraSm0ujiEpnUBfn0GTtQ9jMc1TvpNyxBtJXSxaTDrmVA+g86AM/H2A9MvZr/Q2rbRPEI soggiNXNCGX3ErF+FGUDvmZ/d6IR5iH84bb/zOrdpH9G4/GUuPpp5gHuV5/uczKiXeb3Lv t6T7KayNVUAuRAlkv+xc0eZ55WSDg7pO2hG3QZSo58WBsraYIcC9EB2/vPTgUEQfPyuY+Z tfrHDzCPM32C+DMr9M4GjiZpYxe0IwgClHV/4OJhjX5jBv2BMK243iAoRac21Q== 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 4QS7Qf5cBXzpMB; Fri, 26 May 2023 01:59:38 +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 34Q1xcBW001996; Fri, 26 May 2023 01:59:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34Q1xcA0001994; Fri, 26 May 2023 01:59:38 GMT (envelope-from git) Date: Fri, 26 May 2023 01:59:38 GMT Message-Id: <202305260159.34Q1xcA0001994@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kirk McKusick Subject: git: 4b08a62ed441 - main - When running fsck_ffs(8) in background ensure that a superblock has been read. 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: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4b08a62ed441668c103f834f5fe756ece5a8d9b3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=4b08a62ed441668c103f834f5fe756ece5a8d9b3 commit 4b08a62ed441668c103f834f5fe756ece5a8d9b3 Author: Kirk McKusick AuthorDate: 2023-05-26 01:56:22 +0000 Commit: Kirk McKusick CommitDate: 2023-05-26 01:59:16 +0000 When running fsck_ffs(8) in background ensure that a superblock has been read. Reported by: Mikhail T. PR: 271352 MFC after: 1 week Sponsored by: The FreeBSD Foundation --- sbin/fsck_ffs/main.c | 5 ++++- sbin/fsck_ffs/setup.c | 8 ++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/sbin/fsck_ffs/main.c b/sbin/fsck_ffs/main.c index 566fbe5ccd15..60a542785541 100644 --- a/sbin/fsck_ffs/main.c +++ b/sbin/fsck_ffs/main.c @@ -711,7 +711,10 @@ setup_bkgrdchk(struct statfs *mntp, int sbreadfailed, char **filesys) } free(sblock.fs_csp); free(sblock.fs_si); - havesb = 0; + if (readsb() == 0) { + pwarn("CANNOT READ SNAPSHOT SUPERBLOCK\n"); + return (0); + } *filesys = snapname; cmd.version = FFS_CMD_VERSION; cmd.handle = fsreadfd; diff --git a/sbin/fsck_ffs/setup.c b/sbin/fsck_ffs/setup.c index 1d62a733c2f6..fbcf069c9c97 100644 --- a/sbin/fsck_ffs/setup.c +++ b/sbin/fsck_ffs/setup.c @@ -88,8 +88,12 @@ setup(char *dev) * We are expected to have an open file descriptor and a superblock. */ if (fsreadfd < 0 || havesb == 0) { - if (debug) - printf("setup: bad fsreadfd or missing superblock\n"); + if (debug) { + if (fsreadfd < 0) + printf("setup: missing fsreadfd\n"); + else + printf("setup: missing superblock\n"); + } return (0); } if (preen == 0)