From nobody Wed Mar 16 22:57:58 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 4DCB41A2FEF7; Wed, 16 Mar 2022 22:57:59 +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 4KJlzq1lbsz4bpZ; Wed, 16 Mar 2022 22:57:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1647471479; 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=UF6ciqTY+EBzHITnzqaHzZUMTNSlta/s4ITf9f5M4Yo=; b=v4NtUn3ahS4mIkSj2+esYRkVu/hmBfI8H8M94cPODBc1CfsCpGEtigtIWWHoT1UUxqmL4T FYVkdK7Z3Jdv+x0Cc1kSzxJjOBaJXcaUatMdhySmTs6HMFYGdPl9R+EAA6pp/cWAOsHt/i SkcRVpzre37xzy7dGn6NBn/QyW8ZT+5o6iN/LvaoLBWeEHJjmmZyuDD4vC2boYxbGkxeEF Rw7jBluxwuulZTNjC5v+MCA9un+gXoyhpUjxADEWh0oOFuXRQ2Dy4TqLX+Ayl2yebWQn+m dEGbXcMape4LQoyiikxEJ06op5r8bVX6Or03JQTo7eiMcnyy2Med0oPRAJlS+A== 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 19FD81EFCD; Wed, 16 Mar 2022 22:57:59 +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 22GMvw3g093083; Wed, 16 Mar 2022 22:57:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 22GMvwnB093082; Wed, 16 Mar 2022 22:57:58 GMT (envelope-from git) Date: Wed, 16 Mar 2022 22:57:58 GMT Message-Id: <202203162257.22GMvwnB093082@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: 934ba51bc929 - stable/13 - Ensure that fsck(8) / fsck_ffs(8) produces the correct exit code for missing devices. 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 934ba51bc929ee23248353a081a4cc4327a4ec54 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1647471479; 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=UF6ciqTY+EBzHITnzqaHzZUMTNSlta/s4ITf9f5M4Yo=; b=l7IJbuXWuT7mpfOaSS0Pn1KKQnEZVuA/bRk85vxLOaDVnx2VAoL44xd/KnwKylAXx+/5/j h2JHnt9ESr/lHsj2hipbr3PMseYiRD14aAjOJ6eVvO0nb55rWk5E7rUO9Lk9Rp+qMgTV4B Yweg6Wfr6m6rVU24ayeUSKIt0uDnpBz5628WfEm0y7DXB2SRcbkjAE3fhi3eTFk2eG3CWv 8IhWluqHUbGiqARA+6HFGUEgRQrIJSJDxt2nPLzxLA4ZU/VsoGDAI89wYjRS+aDIVMaupv xATG2tqBcvy2QckCzm9TSDD467WSLQE3DpUvlZ1VYkEG0En0VnbLh0+fVEtiBA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1647471479; a=rsa-sha256; cv=none; b=qv7GEmN5jjxOmuJPEPW2GQlP/bbh1QSoGRWKikDL1p90twKkcw/27vy+nZ+U55lBloDjHY 8T8PxkS8OCxehukAVJ5AyacBbKfijUvDoh+x6qWH3pUtQLWIIffalY9Bf+554Qjjpg4PP9 lA4FuX5+Jn7aPkGVciHMQ3tn7Z/VJKn4J+92FvgoXMGt7mIzV0Gef/kGUKQ/X0ih2hZsvu 5Ej5iUcS5fx+MNysZf7tLr1q7kIdhzQPViD3oImvJtusaeAgYXqQvKDwuxhHNs9c9PLr2X VtNV8tkSI8CvF1AtkBAKaCSgFwOAAJRva+poexe+J/dUvOBpICo/fPZdwFeAVw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=934ba51bc929ee23248353a081a4cc4327a4ec54 commit 934ba51bc929ee23248353a081a4cc4327a4ec54 Author: Kirk McKusick AuthorDate: 2022-03-16 18:37:15 +0000 Commit: Kirk McKusick CommitDate: 2022-03-16 22:56:52 +0000 Ensure that fsck(8) / fsck_ffs(8) produces the correct exit code for missing devices. PR: 262580 Approved by: re (gjb, early MFC) (cherry picked from commit 2983ec0a87a18943564548c5c00c879c8db83edf) --- sbin/fsck_ffs/setup.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sbin/fsck_ffs/setup.c b/sbin/fsck_ffs/setup.c index 45662636557d..14b34962d3fe 100644 --- a/sbin/fsck_ffs/setup.c +++ b/sbin/fsck_ffs/setup.c @@ -219,10 +219,8 @@ openfilesys(char *dev) struct stat statb; int saved_fsreadfd; - if (stat(dev, &statb) < 0) { - pfatal("CANNOT STAT %s: %s\n", dev, strerror(errno)); + if (stat(dev, &statb) < 0) return (0); - } if ((statb.st_mode & S_IFMT) != S_IFCHR && (statb.st_mode & S_IFMT) != S_IFBLK) { if (bkgrdflag != 0 && (statb.st_flags & SF_SNAPSHOT) == 0) { @@ -240,7 +238,6 @@ openfilesys(char *dev) saved_fsreadfd = fsreadfd; if ((fsreadfd = open(dev, O_RDONLY)) < 0) { fsreadfd = saved_fsreadfd; - pfatal("CANNOT OPEN %s: %s\n", dev, strerror(errno)); return (0); } if (saved_fsreadfd != -1)