From nobody Tue Aug 27 20:38:05 2024 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 4WtfWK6mQRz5Jt9w; Tue, 27 Aug 2024 20:38:05 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WtfWK64v6z4scM; Tue, 27 Aug 2024 20:38:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724791085; 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=ilro21MpfaUjEazGO5v9y7bQ8QA4pAS8j6Gv3jZ9A58=; b=e1lMxTXdCel3zOWyfNFPemXWrQpE8mLNNbQ2mAxqAgb7tz3sk8WktpT24bsJNkEYFdw/tS 7YerrXXzT2kzIRvGNEQQ39oHE0f4ELGiYUnktN4OtyjN87YiCe13FkFsDmq0BCxjNfoOpZ G7aCuE1U+Iw/LL6O//9iDFdscBx91i69fum6WCrlAEU/Q4ehMcKS24/8IRenB1ozG56vFF JxGsLlO+R4fL/IbEWg06oIRl0k9rum/MWLFauKDd6HBchqtbfcSv+efXL65q/Y1RHDu+op FmO3VC97kd59fRu1MwxMJ37OQV1o+ds5nX0ipxT48HlilO8A6vgmpZnu9o+QSw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724791085; a=rsa-sha256; cv=none; b=NJiOXWXSeNPabhSVRoS/N/tlE65V4Yg32/8eFuIzW5U+tEpDlDeJk/9toVfLrGrXs7YCc4 xvVPnzEAyfNeT3RpLUQpFHwgF6VBg8da3KjfqESlmqy+aErndszRG1QhMC8FT9ItE0s5jf Yoh4GloXKpmubkVhB95OnwNrOz0nY+waP+MDciuF++MqFFSsWD2YM3q2pda2s8FERqmKOO l/Wut0U9MF2+FdcOD0y+KbX9hUQcO8czPS2i4Zl4L1bthWxs41DPGe6cbfZmQQF9rkdfEG HhIsh/Zg0mdGaLQpYQJWArnPWBFAk7rHQ1k/qenP+gBFKAOytE00ft/PSNZ3Cg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724791085; 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=ilro21MpfaUjEazGO5v9y7bQ8QA4pAS8j6Gv3jZ9A58=; b=YRxLWDAWzoRJE+znXYAGOKJ1iNbPhaWiqSXX48GTenhBoXT5NNn6KPXgMLJ2/JAQiSxs5j uwbeciptBNHlcN9u6P5oQ/+0M+eCgToubNURLk5M8LSn8QBLuTO2fp78p0r/+7acEKSdPl F1mq79uiuR8fF6UTz2iWaWSizL6HjEnT7p1f1nopvwhUe6ncd6whZFY6K8iHm0SCaYR5AD o3xFagXh1jL/NwXJXEungQgsOhgxJhdu1Qa1q+bglgVEuVv6TE6i4HZ9e0bSB/7HF5zc99 gjr35NYgDlguLrk6EXTunUHqEAnieTiCEs6pL0wAo8/fwZDsy+bSAWScsaJzxg== 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 4WtfWK5gygz14Dk; Tue, 27 Aug 2024 20:38:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47RKc5H4049029; Tue, 27 Aug 2024 20:38:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47RKc5cn049026; Tue, 27 Aug 2024 20:38:05 GMT (envelope-from git) Date: Tue, 27 Aug 2024 20:38:05 GMT Message-Id: <202408272038.47RKc5cn049026@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: e6651546c2dd - main - rangelock: Fix an off-by-one error 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e6651546c2dd72e028b9422f1695c432dbf47d75 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e6651546c2dd72e028b9422f1695c432dbf47d75 commit e6651546c2dd72e028b9422f1695c432dbf47d75 Author: Mark Johnston AuthorDate: 2024-08-27 20:29:18 +0000 Commit: Mark Johnston CommitDate: 2024-08-27 20:35:08 +0000 rangelock: Fix an off-by-one error A rangelock entry covers the range [start, end), so entries e1 and e2 with e1->end == e2->start do not overlap. PR: 281073 Fixes: 5badbeeaf061 ("Re-implement rangelocks part 2") Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D46458 --- sys/kern/kern_rangelock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_rangelock.c b/sys/kern/kern_rangelock.c index e3bb413ab1bb..14163dd1c782 100644 --- a/sys/kern/kern_rangelock.c +++ b/sys/kern/kern_rangelock.c @@ -544,7 +544,7 @@ again: cur = rl_q_load(prev); MPASS(!rl_e_is_marked(cur)); /* nobody can unlock e yet */ for (;;) { - if (cur == NULL || cur->rl_q_start > e->rl_q_end) + if (cur == NULL || cur->rl_q_start >= e->rl_q_end) return (RL_LOCK_SUCCESS); next = rl_q_load(&cur->rl_q_next); if (rl_e_is_marked(next)) {