From nobody Wed Jun 07 23:15:34 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 4Qc39L6lvvz4bhRm; Wed, 7 Jun 2023 23:15:34 +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 4Qc39L6HhWz3Cw6; Wed, 7 Jun 2023 23:15:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686179734; 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=T3Q/JLCxW5eWncLJTFrQxpOlxVeBdWp7NpdCKPZAyA0=; b=rmuUSw1OmW5McZNIwIvz2QKSlHN0h91zG0rU84JClpmsJdcCLxahtkVOtNXgN7sDFe5ieM IHyKp3J8BOKAVQt10hys/e0ZU9/1y+xaCNBA/awHsMhY1rww1W854LMNqMMsIccOLoao1Y EeLjdSUeVyG4Ij5DOYAxayn94CXBLODsatRBUrtA9y/tLWQch+L0hPO3OaT90rjxufibFb 2RwKP2hk3baf9y9E5OdE4XAx0LnKu/YAqmgJg+StusLHCN+xYxtXlZ9tIaj8s3JYgeHH4q 6gKsooYpxtuBg3XyaMFCdEUdSEu38FnyRJ9zYw+cfZFp2mfWxd24vZyhyEgogQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686179734; 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=T3Q/JLCxW5eWncLJTFrQxpOlxVeBdWp7NpdCKPZAyA0=; b=W0Q8/QyY6VAlz7RepPw5qUTzOTvObsQLZhyRgCaqRKozhKl8AkQT19QyHHoIF/EEtUYuhB eFaglm2gUCe1AGhxdb+wwkYK7kOXgJxnqv1v2GFa/YXpgu9zIBid7z9mjxInNF4lBKCxCL zeYN8R+JkJfur/ecoqQjh6PLXZNq248RO+KMC0HTcXBQmwN3DzZJJ2jBWbzZGHQ8qGoozI b4fnKcrgYOTNFpYt/rN/ccJG2W2w7COp0O0gI+16ifgQCWbDQSW2rSi+5zAlR1leFxvkak fQSf249FDBqHjUwpoJ+i/t91bc8e04ljA56FZLg++pdAba59mHcdZTw37HWyzg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686179734; a=rsa-sha256; cv=none; b=KgaeJcWrSQnT7iUGrR44Sn9ue310BrPPULE6dZFuWbLZtzPXHttARjRwzS4HcoMpXlnHcM jYk1kGTVLOMsmhDdw168p8SPCR2kuZPUeTXIb3SERm8whRL25RQggBRSTaA7j98SUzKwnu fx74EftnBdSSI7QNver3zOtYsrSX88hGMYa2kL9NxZVQ3lQ6MPiISx4AD0jov/EwSdSaFh fgmh+hSyQ8LYcjcGKTgwhc2ilOFbHlVRjI8WdT3atUMQBP2+9fdrOb+82ZKrMq9aYVFjD+ B9t90mx9qK2Feboba7mlmj8VcSvBGHJ+/jMqpFQoTXOBGTvSXU4Sqawl0jr5bw== 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 4Qc39L5MNBzWGG; Wed, 7 Jun 2023 23:15:34 +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 357NFYpC048376; Wed, 7 Jun 2023 23:15:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 357NFYo6048375; Wed, 7 Jun 2023 23:15:34 GMT (envelope-from git) Date: Wed, 7 Jun 2023 23:15:34 GMT Message-Id: <202306072315.357NFYo6048375@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: 52f50301aaab - stable/13 - Correct two bugs in fsck_ffs(8) triggered by corrupted filesystems. 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: 52f50301aaabddc6e3c1bc8c354101cfd7ea0463 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=52f50301aaabddc6e3c1bc8c354101cfd7ea0463 commit 52f50301aaabddc6e3c1bc8c354101cfd7ea0463 Author: Kirk McKusick AuthorDate: 2023-05-27 05:41:57 +0000 Commit: Kirk McKusick CommitDate: 2023-06-07 22:40:35 +0000 Correct two bugs in fsck_ffs(8) triggered by corrupted filesystems. Reported-by: Robert Morris PR: 271310 PR: 271354 Sponsored-by: The FreeBSD Foundation (cherry picked from commit 03a8680202ef7d7e68adc70625633c490b4ed637) --- sbin/fsck_ffs/pass1.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sbin/fsck_ffs/pass1.c b/sbin/fsck_ffs/pass1.c index e784fd29dc1c..863bf34ff0fc 100644 --- a/sbin/fsck_ffs/pass1.c +++ b/sbin/fsck_ffs/pass1.c @@ -400,13 +400,13 @@ checkinode(ino_t inumber, struct inodesc *idesc, int rebuiltcg) if (mode == IFDIR) { if (DIP(dp, di_size) == 0) { inoinfo(inumber)->ino_state = DCLEAR; - } else if (DIP(dp, di_nlink) <= 0) { + } else if (DIP(dp, di_nlink) == 0) { inoinfo(inumber)->ino_state = DZLINK; } else { inoinfo(inumber)->ino_state = DSTATE; - cacheino(dp, inumber); - countdirs++; } + cacheino(dp, inumber); + countdirs++; } else if (DIP(dp, di_nlink) <= 0) inoinfo(inumber)->ino_state = FZLINK; else