From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8FECDC7EE24 for ; Fri, 5 May 2023 19:30:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233466AbjEETap (ORCPT ); Fri, 5 May 2023 15:30:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233375AbjEETag (ORCPT ); Fri, 5 May 2023 15:30:36 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00A711BCC for ; Fri, 5 May 2023 12:30:33 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8852C63F9E for ; Fri, 5 May 2023 19:30:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DA2B4C433EF; Fri, 5 May 2023 19:30:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1683315033; bh=4yVitEFA5Zblzvr6O+NDutpFfutUkIi5ebVb9T6+0b8=; h=Date:To:From:Subject:From; b=C1mn0htI+E2IX2M6bvNQhLrmsLpJ59F4jPvKbFM6BArDe76HnhRlPmTESNEZzfxeL MsE+bGAwkrCOX30XefF9qQroh9W2mp3E/I0Ym1i8sTrduLRYE7AK2mXioEUG/Rtti+ v9siurFdTPBCruS+Sz3ENhkgvjERgxb4ZL8eMlTM= Date: Fri, 05 May 2023 12:30:32 -0700 To: mm-commits@vger.kernel.org, zhangpeng.00@bytedance.com, senozhatsky@chromium.org, richard.weiyang@gmail.com, Liam.Howlett@oracle.com, dcb314@hotmail.com, Liam.Howlett@Oracle.com, akpm@linux-foundation.org From: Andrew Morton Subject: + maple_tree-change-rcu-checks-to-warn_on-instead-of-bug_on.patch added to mm-unstable branch Message-Id: <20230505193032.DA2B4C433EF@smtp.kernel.org> Precedence: bulk Reply-To: linux-kernel@vger.kernel.org List-ID: X-Mailing-List: mm-commits@vger.kernel.org The patch titled Subject: maple_tree: change RCU checks to WARN_ON() instead of BUG_ON() has been added to the -mm mm-unstable branch. Its filename is maple_tree-change-rcu-checks-to-warn_on-instead-of-bug_on.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/maple_tree-change-rcu-checks-to-warn_on-instead-of-bug_on.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: "Liam R. Howlett" Subject: maple_tree: change RCU checks to WARN_ON() instead of BUG_ON() Date: Fri, 5 May 2023 13:41:36 -0400 If RCU is enabled and the tree isn't locked, just warn the user and avoid crashing the kernel. Link: https://lkml.kernel.org/r/20230505174204.2665599-9-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Cc: David Binderman Cc: Peng Zhang Cc: Sergey Senozhatsky Cc: Wei Yang Signed-off-by: Andrew Morton --- include/linux/maple_tree.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/include/linux/maple_tree.h~maple_tree-change-rcu-checks-to-warn_on-instead-of-bug_on +++ a/include/linux/maple_tree.h @@ -616,7 +616,7 @@ static inline void mt_clear_in_rcu(struc return; if (mt_external_lock(mt)) { - BUG_ON(!mt_lock_is_held(mt)); + WARN_ON(!mt_lock_is_held(mt)); mt->ma_flags &= ~MT_FLAGS_USE_RCU; } else { mtree_lock(mt); @@ -635,7 +635,7 @@ static inline void mt_set_in_rcu(struct return; if (mt_external_lock(mt)) { - BUG_ON(!mt_lock_is_held(mt)); + WARN_ON(!mt_lock_is_held(mt)); mt->ma_flags |= MT_FLAGS_USE_RCU; } else { mtree_lock(mt); _ Patches currently in -mm which might be from Liam.Howlett@Oracle.com are maple_tree-clean-up-mas_parent_enum-and-rename-to-mas_parent_type.patch maple_tree-add-format-option-to-mt_dump.patch maple_tree-convert-bug_on-to-mt_bug_on.patch maple_tree-change-rcu-checks-to-warn_on-instead-of-bug_on.patch maple_tree-convert-debug-code-to-use-mt_warn_on-and-mas_warn_on.patch