From 81191e0ae93e179f148ee4f89deedfe444d7baaa Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Mon, 21 Aug 2023 20:11:28 +0200 Subject: pkg/bisect: start cause bisections from any commits For cause bisections, don't require Kernel.Commit to be reachable from Kernel.Branch. We can start cause bisections from any existing commit. This should help with linux-next bisections, where no older HEADs are ever reachable from each new `master`. --- pkg/bisect/bisect.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'pkg/bisect/bisect.go') diff --git a/pkg/bisect/bisect.go b/pkg/bisect/bisect.go index 440de5a5d..fbb8d031c 100644 --- a/pkg/bisect/bisect.go +++ b/pkg/bisect/bisect.go @@ -348,6 +348,22 @@ func (env *env) identifyRewrittenCommit() (string, error) { return cfg.Kernel.Commit, err } + if !cfg.Fix { + // If we're doing a cause bisection, we don't really need the commit to be + // reachable from cfg.Kernel.Branch. + // So let's try to force tag fetch and check if the commit is present in the + // repository. + env.log("fetch other tags and check if the commit is present") + commit, err := env.repo.CheckoutCommit(cfg.Kernel.Repo, cfg.Kernel.Commit) + if err != nil { + // Ignore the error because the command will fail if the commit is really not + // present in the tree. + env.log("fetch failed with %s", err) + } else if commit != nil { + return commit.Hash, nil + } + } + // We record the tested kernel commit when syzkaller triggers a crash. These commits can become // unreachable after the crash was found, when the history of the tested kernel branch was // rewritten. The commit might have been completely deleted from the branch or just changed in -- cgit mrf-deployment